From 9de22232a890e87c416e4dbce945e09483f6e8ea Mon Sep 17 00:00:00 2001 From: mage2-team <mage2-team@magento.com> Date: Thu, 1 Mar 2012 18:41:25 -0800 Subject: [PATCH] Published Magento 2 update as of 2/29/2012 - Added jQuery to Magento 2. It has not been made a main library yet, however all new features are developed using jQuery. - Added support for new versions of testing tools - PHPUnit 3.6, PHPMD 1.3.0. Confirmed compatibility with latest PHPCS 1.3.2 and PHPCPD 1.3.5. - Improved legacy tests: -- Refactored Integrity_ClassesTest and Legacy_ClassesTest. -- Implemented a tool for migrating factory names from 1.x to 2.x. The tool scans PHP-code and replaces the most "popular" cases. -- Added tests for "//model" in config.xml files and "//*[@module]" in all xml files. -- Implemented a test that verifies the absence of relocated directories. -- Added a test against the obsolete Varien_Profiler. - Bug fixes: -- Fixed phpdoc for Mage_Core_Model_Design_Package. -- Fixed static code analysis failures related to case-sensitivity. -- Fixed several typos and minor mistakes. -- Fixed integration test's failures due to specifics of xpath library version. - Imported fresh features and bug fixes from Magento 1.x. --- .gitignore | 1 - app/Mage.php | 49 +- app/bootstrap.php | 2 +- .../Phoenix/Moneybookers/Block/Form.php | 2 +- .../Phoenix/Moneybookers/Block/Info.php | 2 +- .../Phoenix/Moneybookers/Block/Jsinit.php | 2 +- .../Phoenix/Moneybookers/Block/Payment.php | 2 +- .../Phoenix/Moneybookers/Block/Placeform.php | 2 +- .../Phoenix/Moneybookers/Block/Redirect.php | 2 +- .../Phoenix/Moneybookers/Helper/Data.php | 2 +- .../Phoenix/Moneybookers/Model/Abstract.php | 2 +- .../Phoenix/Moneybookers/Model/Acc.php | 2 +- .../Phoenix/Moneybookers/Model/Csi.php | 2 +- .../Phoenix/Moneybookers/Model/Did.php | 2 +- .../Phoenix/Moneybookers/Model/Dnk.php | 2 +- .../Phoenix/Moneybookers/Model/Ebt.php | 2 +- .../Phoenix/Moneybookers/Model/Ent.php | 2 +- .../Phoenix/Moneybookers/Model/Event.php | 2 +- .../Phoenix/Moneybookers/Model/Gcb.php | 2 +- .../Phoenix/Moneybookers/Model/Gir.php | 2 +- .../Phoenix/Moneybookers/Model/Idl.php | 2 +- .../Phoenix/Moneybookers/Model/Lsr.php | 2 +- .../Phoenix/Moneybookers/Model/Mae.php | 2 +- .../Phoenix/Moneybookers/Model/Npy.php | 2 +- .../Phoenix/Moneybookers/Model/Obt.php | 2 +- .../Phoenix/Moneybookers/Model/Pli.php | 2 +- .../Phoenix/Moneybookers/Model/Psp.php | 2 +- .../Phoenix/Moneybookers/Model/Pwy.php | 2 +- .../Phoenix/Moneybookers/Model/Sft.php | 2 +- .../Phoenix/Moneybookers/Model/So2.php | 2 +- .../Phoenix/Moneybookers/Model/Wlt.php | 2 +- .../controllers/MoneybookersController.php | 2 +- .../controllers/ProcessingController.php | 2 +- .../Phoenix/Moneybookers/etc/adminhtml.xml | 2 +- .../Phoenix/Moneybookers/etc/config.xml | 2 +- .../Phoenix/Moneybookers/etc/system.xml | 2 +- .../moneybookers_setup/install-1.6.0.0.php | 2 +- .../Moneybookers/view/adminhtml/activation.js | 2 +- .../Moneybookers/view/adminhtml/info.phtml | 2 +- .../Moneybookers/view/adminhtml/jsinit.phtml | 2 +- .../Moneybookers/view/adminhtml/layout.xml | 2 +- .../view/adminhtml/pdf/info.phtml | 2 +- .../Moneybookers/view/frontend/blank.phtml | 2 +- .../Moneybookers/view/frontend/form.phtml | 2 +- .../Moneybookers/view/frontend/info.phtml | 2 +- .../Moneybookers/view/frontend/layout.xml | 2 +- .../Moneybookers/view/frontend/payment.phtml | 2 +- .../view/frontend/placeform.phtml | 2 +- .../Moneybookers/view/frontend/redirect.phtml | 2 +- app/code/core/Mage/Admin/Helper/Data.php | 2 +- app/code/core/Mage/Admin/Model/Acl.php | 2 +- .../core/Mage/Admin/Model/Acl/Resource.php | 2 +- .../Mage/Admin/Model/Acl/Role/Generic.php | 2 +- .../core/Mage/Admin/Model/Acl/Role/Group.php | 2 +- .../Mage/Admin/Model/Acl/Role/Registry.php | 2 +- .../core/Mage/Admin/Model/Acl/Role/User.php | 2 +- app/code/core/Mage/Admin/Model/Config.php | 5 +- app/code/core/Mage/Admin/Model/Observer.php | 8 +- .../core/Mage/Admin/Model/Resource/Acl.php | 2 +- .../Model/Resource/Permissions/Collection.php | 2 +- .../core/Mage/Admin/Model/Resource/Role.php | 2 +- .../Admin/Model/Resource/Role/Collection.php | 2 +- .../core/Mage/Admin/Model/Resource/Roles.php | 2 +- .../Admin/Model/Resource/Roles/Collection.php | 2 +- .../Model/Resource/Roles/User/Collection.php | 2 +- .../core/Mage/Admin/Model/Resource/Rules.php | 2 +- .../Admin/Model/Resource/Rules/Collection.php | 2 +- .../core/Mage/Admin/Model/Resource/User.php | 2 +- .../Admin/Model/Resource/User/Collection.php | 2 +- app/code/core/Mage/Admin/Model/Role.php | 2 +- app/code/core/Mage/Admin/Model/Roles.php | 62 +- app/code/core/Mage/Admin/Model/Rules.php | 2 +- app/code/core/Mage/Admin/Model/Session.php | 2 +- app/code/core/Mage/Admin/Model/User.php | 15 +- .../data/admin_setup/data-install-1.6.0.0.php | 2 +- app/code/core/Mage/Admin/etc/config.xml | 2 +- .../Admin/sql/admin_setup/install-1.6.0.0.php | 2 +- .../mysql4-upgrade-1.6.0.0-1.6.1.0.php | 2 +- .../Mage/AdminNotification/Helper/Data.php | 2 +- .../Mage/AdminNotification/Model/Feed.php | 2 +- .../Mage/AdminNotification/Model/Inbox.php | 2 +- .../Mage/AdminNotification/Model/Observer.php | 2 +- .../Model/Resource/Inbox.php | 2 +- .../Model/Resource/Inbox/Collection.php | 2 +- .../Mage/AdminNotification/Model/Survey.php | 2 +- .../Mage/AdminNotification/etc/adminhtml.xml | 2 +- .../Mage/AdminNotification/etc/config.xml | 2 +- .../Mage/AdminNotification/etc/system.xml | 2 +- .../install-1.6.0.0.php | 2 +- .../core/Mage/Adminhtml/Block/Abstract.php | 2 +- .../core/Mage/Adminhtml/Block/Api/Buttons.php | 2 +- .../Mage/Adminhtml/Block/Api/Editroles.php | 2 +- .../Mage/Adminhtml/Block/Api/Grid/Role.php | 2 +- .../core/Mage/Adminhtml/Block/Api/Role.php | 2 +- .../Adminhtml/Block/Api/Role/Grid/User.php | 2 +- .../core/Mage/Adminhtml/Block/Api/Roles.php | 2 +- .../Mage/Adminhtml/Block/Api/Tab/Roleinfo.php | 2 +- .../Adminhtml/Block/Api/Tab/Rolesedit.php | 2 +- .../Adminhtml/Block/Api/Tab/Rolesusers.php | 2 +- .../core/Mage/Adminhtml/Block/Api/User.php | 12 +- .../Mage/Adminhtml/Block/Api/User/Edit.php | 2 +- .../Adminhtml/Block/Api/User/Edit/Form.php | 2 +- .../Block/Api/User/Edit/Tab/Main.php | 2 +- .../Block/Api/User/Edit/Tab/Roles.php | 2 +- .../Adminhtml/Block/Api/User/Edit/Tabs.php | 2 +- .../Mage/Adminhtml/Block/Api/User/Grid.php | 2 +- app/code/core/Mage/Adminhtml/Block/Backup.php | 66 +- .../Mage/Adminhtml/Block/Backup/Dialogs.php | 53 + .../core/Mage/Adminhtml/Block/Backup/Grid.php | 72 +- app/code/core/Mage/Adminhtml/Block/Cache.php | 2 +- .../Mage/Adminhtml/Block/Cache/Additional.php | 2 +- .../core/Mage/Adminhtml/Block/Cache/Grid.php | 2 +- .../Adminhtml/Block/Cache/Notifications.php | 2 +- .../Block/Catalog/Category/Abstract.php | 2 +- .../Catalog/Category/Checkboxes/Tree.php | 2 +- .../Adminhtml/Block/Catalog/Category/Edit.php | 2 +- .../Block/Catalog/Category/Edit/Form.php | 2 +- .../Block/Catalog/Category/Helper/Image.php | 2 +- .../Catalog/Category/Helper/Pricestep.php | 2 +- .../Category/Helper/Sortby/Available.php | 2 +- .../Category/Helper/Sortby/Default.php | 2 +- .../Block/Catalog/Category/Tab/Attributes.php | 4 +- .../Block/Catalog/Category/Tab/Design.php | 2 +- .../Block/Catalog/Category/Tab/General.php | 2 +- .../Block/Catalog/Category/Tab/Product.php | 2 +- .../Adminhtml/Block/Catalog/Category/Tabs.php | 2 +- .../Adminhtml/Block/Catalog/Category/Tree.php | 2 +- .../Block/Catalog/Category/Widget/Chooser.php | 2 +- .../Mage/Adminhtml/Block/Catalog/Form.php | 2 +- .../Form/Renderer/Attribute/Urlkey.php | 2 +- .../Form/Renderer/Config/DateFieldsOrder.php | 9 +- .../Form/Renderer/Config/YearRange.php | 2 +- .../Form/Renderer/Fieldset/Element.php | 2 +- .../Block/Catalog/Helper/Form/Wysiwyg.php | 2 +- .../Catalog/Helper/Form/Wysiwyg/Content.php | 2 +- .../Mage/Adminhtml/Block/Catalog/Product.php | 2 +- .../Block/Catalog/Product/Attribute.php | 2 +- .../Block/Catalog/Product/Attribute/Edit.php | 2 +- .../Catalog/Product/Attribute/Edit/Form.php | 2 +- .../Product/Attribute/Edit/Tab/Front.php | 2 +- .../Product/Attribute/Edit/Tab/Main.php | 2 +- .../Product/Attribute/Edit/Tab/Options.php | 2 +- .../Product/Attribute/Edit/Tab/System.php | 2 +- .../Catalog/Product/Attribute/Edit/Tabs.php | 2 +- .../Block/Catalog/Product/Attribute/Grid.php | 2 +- .../Attribute/New/Product/Attributes.php | 2 +- .../Product/Attribute/New/Product/Created.php | 2 +- .../Catalog/Product/Attribute/Set/Grid.php | 2 +- .../Catalog/Product/Attribute/Set/Main.php | 2 +- .../Attribute/Set/Main/Formattribute.php | 2 +- .../Product/Attribute/Set/Main/Formgroup.php | 2 +- .../Product/Attribute/Set/Main/Formset.php | 2 +- .../Attribute/Set/Main/Tree/Attribute.php | 2 +- .../Product/Attribute/Set/Main/Tree/Group.php | 2 +- .../Product/Attribute/Set/Toolbar/Add.php | 2 +- .../Product/Attribute/Set/Toolbar/Main.php | 2 +- .../Attribute/Set/Toolbar/Main/Filter.php | 2 +- .../Catalog/Product/Composite/Configure.php | 2 +- .../Block/Catalog/Product/Composite/Error.php | 2 +- .../Catalog/Product/Composite/Fieldset.php | 2 +- .../Composite/Fieldset/Configurable.php | 2 +- .../Product/Composite/Fieldset/Grouped.php | 2 +- .../Product/Composite/Fieldset/Options.php | 2 +- .../Product/Composite/Fieldset/Qty.php | 2 +- .../Product/Composite/Update/Result.php | 2 +- .../Block/Catalog/Product/Created.php | 2 +- .../Adminhtml/Block/Catalog/Product/Edit.php | 2 +- .../Catalog/Product/Edit/Action/Attribute.php | 2 +- .../Edit/Action/Attribute/Tab/Attributes.php | 10 +- .../Edit/Action/Attribute/Tab/Inventory.php | 2 +- .../Edit/Action/Attribute/Tab/Websites.php | 2 +- .../Product/Edit/Action/Attribute/Tabs.php | 2 +- .../Block/Catalog/Product/Edit/Js.php | 2 +- .../Product/Edit/Tab/Ajax/Serializer.php | 2 +- .../Block/Catalog/Product/Edit/Tab/Alerts.php | 2 +- .../Catalog/Product/Edit/Tab/Alerts/Price.php | 2 +- .../Catalog/Product/Edit/Tab/Alerts/Stock.php | 2 +- .../Catalog/Product/Edit/Tab/Attributes.php | 101 +- .../Product/Edit/Tab/Attributes/Create.php | 2 +- .../Catalog/Product/Edit/Tab/Categories.php | 2 +- .../Catalog/Product/Edit/Tab/Crosssell.php | 2 +- .../Catalog/Product/Edit/Tab/Inventory.php | 2 +- .../Catalog/Product/Edit/Tab/Options.php | 2 +- .../Product/Edit/Tab/Options/Option.php | 2 +- .../Edit/Tab/Options/Type/Abstract.php | 2 +- .../Product/Edit/Tab/Options/Type/Date.php | 2 +- .../Product/Edit/Tab/Options/Type/File.php | 2 +- .../Product/Edit/Tab/Options/Type/Select.php | 2 +- .../Product/Edit/Tab/Options/Type/Text.php | 2 +- .../Block/Catalog/Product/Edit/Tab/Price.php | 2 +- .../Catalog/Product/Edit/Tab/Price/Group.php | 97 + .../Product/Edit/Tab/Price/Group/Abstract.php | 348 ++ .../Product/Edit/Tab/Price/Recurring.php | 2 +- .../Catalog/Product/Edit/Tab/Price/Tier.php | 302 +- .../Catalog/Product/Edit/Tab/Related.php | 2 +- .../Catalog/Product/Edit/Tab/Reviews.php | 2 +- .../Catalog/Product/Edit/Tab/Settings.php | 2 +- .../Catalog/Product/Edit/Tab/Super/Config.php | 25 +- .../Product/Edit/Tab/Super/Config/Grid.php | 2 +- .../Super/Config/Grid/Filter/Inventory.php | 2 +- .../Super/Config/Grid/Renderer/Checkbox.php | 2 +- .../Super/Config/Grid/Renderer/Inventory.php | 2 +- .../Product/Edit/Tab/Super/Config/Simple.php | 21 +- .../Catalog/Product/Edit/Tab/Super/Group.php | 2 +- .../Product/Edit/Tab/Super/Settings.php | 2 +- .../Block/Catalog/Product/Edit/Tab/Tag.php | 2 +- .../Catalog/Product/Edit/Tab/Tag/Customer.php | 2 +- .../Block/Catalog/Product/Edit/Tab/Upsell.php | 2 +- .../Catalog/Product/Edit/Tab/Websites.php | 2 +- .../Block/Catalog/Product/Edit/Tabs.php | 2 +- .../Product/Edit/Tabs/Configurable.php | 2 +- .../Catalog/Product/Edit/Tabs/Grouped.php | 2 +- .../Product/Frontend/Product/Watermark.php | 2 +- .../Adminhtml/Block/Catalog/Product/Grid.php | 2 +- .../Catalog/Product/Helper/Form/Apply.php | 2 +- .../Catalog/Product/Helper/Form/Boolean.php | 2 +- .../Catalog/Product/Helper/Form/Config.php | 2 +- .../Catalog/Product/Helper/Form/Gallery.php | 2 +- .../Product/Helper/Form/Gallery/Content.php | 4 +- .../Catalog/Product/Helper/Form/Image.php | 2 +- .../Product/Helper/Form/Msrp/Enabled.php | 2 +- .../Product/Helper/Form/Msrp/Price.php | 2 +- .../Catalog/Product/Helper/Form/Price.php | 2 +- .../Catalog/Product/Helper/Form/Weight.php | 46 + .../Adminhtml/Block/Catalog/Product/Price.php | 2 +- .../Block/Catalog/Product/Widget/Chooser.php | 6 +- .../Product/Widget/Chooser/Container.php | 2 +- .../Mage/Adminhtml/Block/Catalog/Search.php | 2 +- .../Adminhtml/Block/Catalog/Search/Edit.php | 2 +- .../Block/Catalog/Search/Edit/Form.php | 54 +- .../Adminhtml/Block/Catalog/Search/Grid.php | 2 +- .../Adminhtml/Block/Checkout/Agreement.php | 4 +- .../Block/Checkout/Agreement/Edit.php | 4 +- .../Block/Checkout/Agreement/Edit/Form.php | 3 +- .../Block/Checkout/Agreement/Grid.php | 2 +- .../core/Mage/Adminhtml/Block/Cms/Block.php | 2 +- .../Mage/Adminhtml/Block/Cms/Block/Edit.php | 2 +- .../Adminhtml/Block/Cms/Block/Edit/Form.php | 7 +- .../Mage/Adminhtml/Block/Cms/Block/Grid.php | 2 +- .../Block/Cms/Block/Widget/Chooser.php | 2 +- .../core/Mage/Adminhtml/Block/Cms/Page.php | 2 +- .../Mage/Adminhtml/Block/Cms/Page/Edit.php | 2 +- .../Adminhtml/Block/Cms/Page/Edit/Form.php | 2 +- .../Block/Cms/Page/Edit/Tab/Content.php | 2 +- .../Block/Cms/Page/Edit/Tab/Design.php | 2 +- .../Block/Cms/Page/Edit/Tab/Main.php | 5 +- .../Block/Cms/Page/Edit/Tab/Meta.php | 2 +- .../Adminhtml/Block/Cms/Page/Edit/Tabs.php | 2 +- .../Mage/Adminhtml/Block/Cms/Page/Grid.php | 2 +- .../Block/Cms/Page/Grid/Renderer/Action.php | 2 +- .../Block/Cms/Page/Widget/Chooser.php | 2 +- .../Block/Cms/Wysiwyg/Images/Content.php | 2 +- .../Cms/Wysiwyg/Images/Content/Files.php | 2 +- .../Cms/Wysiwyg/Images/Content/Newfolder.php | 2 +- .../Cms/Wysiwyg/Images/Content/Uploader.php | 2 +- .../Block/Cms/Wysiwyg/Images/Tree.php | 2 +- .../core/Mage/Adminhtml/Block/Customer.php | 2 +- .../Mage/Adminhtml/Block/Customer/Edit.php | 2 +- .../Adminhtml/Block/Customer/Edit/Form.php | 2 +- .../Edit/Renderer/Attribute/Group.php | 105 + .../Block/Customer/Edit/Renderer/Newpass.php | 2 +- .../Block/Customer/Edit/Renderer/Region.php | 2 +- .../Block/Customer/Edit/Tab/Account.php | 76 +- .../Block/Customer/Edit/Tab/Addresses.php | 4 +- .../Block/Customer/Edit/Tab/Cart.php | 14 +- .../Block/Customer/Edit/Tab/Carts.php | 2 +- .../Block/Customer/Edit/Tab/Newsletter.php | 2 +- .../Customer/Edit/Tab/Newsletter/Grid.php | 2 +- .../Tab/Newsletter/Grid/Filter/Status.php | 2 +- .../Tab/Newsletter/Grid/Renderer/Action.php | 2 +- .../Tab/Newsletter/Grid/Renderer/Status.php | 2 +- .../Block/Customer/Edit/Tab/Orders.php | 2 +- .../Block/Customer/Edit/Tab/Reviews.php | 2 +- .../Adminhtml/Block/Customer/Edit/Tab/Tag.php | 2 +- .../Block/Customer/Edit/Tab/Tags.php | 2 +- .../Block/Customer/Edit/Tab/View.php | 2 +- .../Customer/Edit/Tab/View/Accordion.php | 6 +- .../Block/Customer/Edit/Tab/View/Cart.php | 2 +- .../Edit/Tab/View/Grid/Renderer/Item.php | 2 +- .../Block/Customer/Edit/Tab/View/Orders.php | 2 +- .../Block/Customer/Edit/Tab/View/Sales.php | 2 +- .../Block/Customer/Edit/Tab/View/Wishlist.php | 2 +- .../Block/Customer/Edit/Tab/Wishlist.php | 2 +- .../Wishlist/Grid/Renderer/Description.php | 2 +- .../Adminhtml/Block/Customer/Edit/Tabs.php | 2 +- .../Block/Customer/Form/Element/Boolean.php | 2 +- .../Block/Customer/Form/Element/File.php | 2 +- .../Block/Customer/Form/Element/Image.php | 2 +- .../Mage/Adminhtml/Block/Customer/Grid.php | 2 +- .../Block/Customer/Grid/Filter/Country.php | 2 +- .../Customer/Grid/Renderer/Multiaction.php | 2 +- .../Mage/Adminhtml/Block/Customer/Group.php | 2 +- .../Adminhtml/Block/Customer/Group/Edit.php | 2 +- .../Block/Customer/Group/Edit/Form.php | 5 +- .../Adminhtml/Block/Customer/Group/Grid.php | 2 +- .../Mage/Adminhtml/Block/Customer/Online.php | 2 +- .../Block/Customer/Online/Filter.php | 2 +- .../Adminhtml/Block/Customer/Online/Grid.php | 2 +- .../Customer/Online/Grid/Renderer/Ip.php | 2 +- .../Customer/Online/Grid/Renderer/Type.php | 2 +- .../Customer/Online/Grid/Renderer/Url.php | 2 +- .../Sales/Order/Address/Form/Renderer/Vat.php | 93 + .../Customer/System/Config/Validatevat.php | 79 + .../core/Mage/Adminhtml/Block/Dashboard.php | 2 +- .../Adminhtml/Block/Dashboard/Abstract.php | 2 +- .../Mage/Adminhtml/Block/Dashboard/Bar.php | 2 +- .../Adminhtml/Block/Dashboard/Diagrams.php | 2 +- .../Mage/Adminhtml/Block/Dashboard/Graph.php | 2 +- .../Mage/Adminhtml/Block/Dashboard/Grid.php | 2 +- .../Mage/Adminhtml/Block/Dashboard/Grids.php | 2 +- .../Adminhtml/Block/Dashboard/Orders/Grid.php | 2 +- .../Mage/Adminhtml/Block/Dashboard/Sales.php | 2 +- .../Block/Dashboard/Searches/Last.php | 2 +- .../Searches/Renderer/Searchquery.php | 2 +- .../Block/Dashboard/Searches/Top.php | 2 +- .../Adminhtml/Block/Dashboard/Tab/Amounts.php | 2 +- .../Block/Dashboard/Tab/Customers/Most.php | 2 +- .../Block/Dashboard/Tab/Customers/Newest.php | 2 +- .../Adminhtml/Block/Dashboard/Tab/Orders.php | 2 +- .../Block/Dashboard/Tab/Products/Ordered.php | 2 +- .../Block/Dashboard/Tab/Products/Viewed.php | 2 +- .../Mage/Adminhtml/Block/Dashboard/Totals.php | 2 +- app/code/core/Mage/Adminhtml/Block/Denied.php | 2 +- .../core/Mage/Adminhtml/Block/Html/Date.php | 2 +- .../core/Mage/Adminhtml/Block/Html/Select.php | 2 +- .../Mage/Adminhtml/Block/Media/Editor.php | 2 +- .../Mage/Adminhtml/Block/Media/Uploader.php | 7 +- .../core/Mage/Adminhtml/Block/Messages.php | 2 +- .../Adminhtml/Block/Newsletter/Problem.php | 2 +- .../Block/Newsletter/Problem/Grid.php | 2 +- .../Problem/Grid/Filter/Checkbox.php | 2 +- .../Problem/Grid/Renderer/Checkbox.php | 2 +- .../Mage/Adminhtml/Block/Newsletter/Queue.php | 2 +- .../Adminhtml/Block/Newsletter/Queue/Edit.php | 2 +- .../Block/Newsletter/Queue/Edit/Form.php | 2 +- .../Adminhtml/Block/Newsletter/Queue/Grid.php | 2 +- .../Newsletter/Queue/Grid/Renderer/Action.php | 2 +- .../Block/Newsletter/Queue/Preview.php | 2 +- .../Block/Newsletter/Queue/Preview/Form.php | 2 +- .../Adminhtml/Block/Newsletter/Subscriber.php | 2 +- .../Block/Newsletter/Subscriber/Grid.php | 2 +- .../Subscriber/Grid/Filter/Checkbox.php | 2 +- .../Subscriber/Grid/Filter/Website.php | 2 +- .../Subscriber/Grid/Renderer/Checkbox.php | 2 +- .../Adminhtml/Block/Newsletter/Template.php | 2 +- .../Block/Newsletter/Template/Edit.php | 2 +- .../Block/Newsletter/Template/Edit/Form.php | 2 +- .../Block/Newsletter/Template/Grid.php | 2 +- .../Template/Grid/Renderer/Action.php | 2 +- .../Template/Grid/Renderer/Sender.php | 2 +- .../Block/Newsletter/Template/Preview.php | 2 +- .../Newsletter/Template/Preview/Form.php | 2 +- .../Adminhtml/Block/Notification/Baseurl.php | 2 +- .../Adminhtml/Block/Notification/Grid.php | 2 +- .../Notification/Grid/Renderer/Actions.php | 2 +- .../Notification/Grid/Renderer/Notice.php | 2 +- .../Notification/Grid/Renderer/Severity.php | 2 +- .../Adminhtml/Block/Notification/Inbox.php | 2 +- .../Adminhtml/Block/Notification/Security.php | 2 +- .../Adminhtml/Block/Notification/Survey.php | 2 +- .../Adminhtml/Block/Notification/Toolbar.php | 2 +- .../Adminhtml/Block/Notification/Window.php | 2 +- app/code/core/Mage/Adminhtml/Block/Page.php | 2 +- .../core/Mage/Adminhtml/Block/Page/Footer.php | 2 +- .../core/Mage/Adminhtml/Block/Page/Head.php | 2 +- .../core/Mage/Adminhtml/Block/Page/Header.php | 2 +- .../core/Mage/Adminhtml/Block/Page/Menu.php | 2 +- .../Mage/Adminhtml/Block/Page/Notices.php | 2 +- .../Adminhtml/Block/Permissions/Buttons.php | 2 +- .../Adminhtml/Block/Permissions/Editroles.php | 2 +- .../Adminhtml/Block/Permissions/Grid/Role.php | 2 +- .../Adminhtml/Block/Permissions/Grid/User.php | 2 +- .../Mage/Adminhtml/Block/Permissions/Role.php | 2 +- .../Block/Permissions/Role/Grid/User.php | 2 +- .../Adminhtml/Block/Permissions/Roles.php | 2 +- .../Block/Permissions/Tab/Roleinfo.php | 2 +- .../Block/Permissions/Tab/Rolesedit.php | 2 +- .../Block/Permissions/Tab/Rolesusers.php | 2 +- .../Block/Permissions/Tab/Useredit.php | 2 +- .../Mage/Adminhtml/Block/Permissions/User.php | 12 +- .../Adminhtml/Block/Permissions/User/Edit.php | 2 +- .../Block/Permissions/User/Edit/Form.php | 2 +- .../Block/Permissions/User/Edit/Tab/Main.php | 2 +- .../Block/Permissions/User/Edit/Tab/Roles.php | 2 +- .../Block/Permissions/User/Edit/Tabs.php | 2 +- .../Adminhtml/Block/Permissions/User/Grid.php | 2 +- .../Adminhtml/Block/Permissions/Users.php | 2 +- .../Mage/Adminhtml/Block/Poll/Answer/Edit.php | 2 +- .../Adminhtml/Block/Poll/Answer/Edit/Form.php | 2 +- .../core/Mage/Adminhtml/Block/Poll/Edit.php | 2 +- .../Mage/Adminhtml/Block/Poll/Edit/Form.php | 2 +- .../Adminhtml/Block/Poll/Edit/Tab/Answers.php | 2 +- .../Block/Poll/Edit/Tab/Answers/Form.php | 2 +- .../Block/Poll/Edit/Tab/Answers/Grid.php | 2 +- .../Block/Poll/Edit/Tab/Answers/List.php | 2 +- .../Adminhtml/Block/Poll/Edit/Tab/Form.php | 5 +- .../Mage/Adminhtml/Block/Poll/Edit/Tabs.php | 2 +- .../core/Mage/Adminhtml/Block/Poll/Grid.php | 2 +- .../core/Mage/Adminhtml/Block/Poll/Poll.php | 2 +- .../Mage/Adminhtml/Block/Promo/Catalog.php | 2 +- .../Adminhtml/Block/Promo/Catalog/Edit.php | 55 +- .../Block/Promo/Catalog/Edit/Form.php | 2 +- .../Adminhtml/Block/Promo/Catalog/Edit/Js.php | 2 +- .../Block/Promo/Catalog/Edit/Tab/Actions.php | 2 +- .../Promo/Catalog/Edit/Tab/Conditions.php | 2 +- .../Block/Promo/Catalog/Edit/Tab/Main.php | 54 +- .../Block/Promo/Catalog/Edit/Tabs.php | 2 +- .../Adminhtml/Block/Promo/Catalog/Grid.php | 55 +- .../core/Mage/Adminhtml/Block/Promo/Quote.php | 2 +- .../Mage/Adminhtml/Block/Promo/Quote/Edit.php | 51 +- .../Adminhtml/Block/Promo/Quote/Edit/Form.php | 2 +- .../Block/Promo/Quote/Edit/Tab/Actions.php | 2 +- .../Block/Promo/Quote/Edit/Tab/Conditions.php | 2 +- .../Block/Promo/Quote/Edit/Tab/Coupons.php | 88 + .../Promo/Quote/Edit/Tab/Coupons/Form.php | 147 + .../Promo/Quote/Edit/Tab/Coupons/Grid.php | 146 + .../Tab/Coupons/Grid/Column/Renderer/Used.php | 42 + .../Block/Promo/Quote/Edit/Tab/Labels.php | 5 +- .../Block/Promo/Quote/Edit/Tab/Main.php | 79 +- .../Quote/Edit/Tab/Main/Renderer/Checkbox.php | 59 + .../Adminhtml/Block/Promo/Quote/Edit/Tabs.php | 2 +- .../Mage/Adminhtml/Block/Promo/Quote/Grid.php | 56 +- .../Adminhtml/Block/Promo/Widget/Chooser.php | 6 +- .../Block/Promo/Widget/Chooser/Daterange.php | 2 +- .../Block/Promo/Widget/Chooser/Sku.php | 2 +- .../core/Mage/Adminhtml/Block/Rating/Edit.php | 2 +- .../Mage/Adminhtml/Block/Rating/Edit/Form.php | 2 +- .../Adminhtml/Block/Rating/Edit/Tab/Form.php | 5 +- .../Block/Rating/Edit/Tab/Options.php | 2 +- .../Mage/Adminhtml/Block/Rating/Edit/Tabs.php | 2 +- .../core/Mage/Adminhtml/Block/Rating/Grid.php | 2 +- .../Mage/Adminhtml/Block/Rating/Rating.php | 2 +- .../Report/Config/Form/Field/MtdStart.php | 2 +- .../Report/Config/Form/Field/YtdStart.php | 2 +- .../Block/Report/Customer/Accounts.php | 2 +- .../Block/Report/Customer/Accounts/Grid.php | 2 +- .../Block/Report/Customer/Orders.php | 2 +- .../Block/Report/Customer/Orders/Grid.php | 2 +- .../Block/Report/Customer/Totals.php | 2 +- .../Block/Report/Customer/Totals/Grid.php | 2 +- .../Adminhtml/Block/Report/Filter/Form.php | 2 +- .../core/Mage/Adminhtml/Block/Report/Grid.php | 2 +- .../Adminhtml/Block/Report/Grid/Abstract.php | 47 +- .../Grid/Column/Renderer/Blanknumber.php | 2 +- .../Report/Grid/Column/Renderer/Currency.php | 2 +- .../Report/Grid/Column/Renderer/Customer.php | 2 +- .../Report/Grid/Column/Renderer/Product.php | 2 +- .../Adminhtml/Block/Report/Grid/Shopcart.php | 2 +- .../Mage/Adminhtml/Block/Report/Product.php | 2 +- .../Block/Report/Product/Downloads.php | 2 +- .../Block/Report/Product/Downloads/Grid.php | 2 +- .../Product/Downloads/Renderer/Purchases.php | 2 +- .../Adminhtml/Block/Report/Product/Grid.php | 2 +- .../Block/Report/Product/Lowstock.php | 2 +- .../Block/Report/Product/Lowstock/Grid.php | 2 +- .../Adminhtml/Block/Report/Product/Sold.php | 2 +- .../Block/Report/Product/Sold/Grid.php | 2 +- .../Adminhtml/Block/Report/Product/Viewed.php | 18 +- .../Block/Report/Product/Viewed/Grid.php | 97 +- .../Block/Report/Refresh/Statistics.php | 2 +- .../Block/Report/Refresh/Statistics/Grid.php | 10 +- .../Block/Report/Review/Customer.php | 2 +- .../Block/Report/Review/Customer/Grid.php | 2 +- .../Adminhtml/Block/Report/Review/Detail.php | 2 +- .../Block/Report/Review/Detail/Grid.php | 2 +- .../Adminhtml/Block/Report/Review/Product.php | 2 +- .../Block/Report/Review/Product/Grid.php | 2 +- .../Block/Report/Sales/Bestsellers.php | 2 +- .../Block/Report/Sales/Bestsellers/Grid.php | 2 +- .../Adminhtml/Block/Report/Sales/Coupons.php | 2 +- .../Block/Report/Sales/Coupons/Grid.php | 28 +- .../Sales/Grid/Column/Renderer/Date.php | 2 +- .../Adminhtml/Block/Report/Sales/Invoiced.php | 2 +- .../Block/Report/Sales/Invoiced/Grid.php | 2 +- .../Adminhtml/Block/Report/Sales/Refunded.php | 2 +- .../Block/Report/Sales/Refunded/Grid.php | 2 +- .../Adminhtml/Block/Report/Sales/Sales.php | 2 +- .../Block/Report/Sales/Sales/Grid.php | 2 +- .../Adminhtml/Block/Report/Sales/Shipping.php | 2 +- .../Block/Report/Sales/Shipping/Grid.php | 2 +- .../Mage/Adminhtml/Block/Report/Sales/Tax.php | 2 +- .../Adminhtml/Block/Report/Sales/Tax/Grid.php | 2 +- .../Mage/Adminhtml/Block/Report/Search.php | 2 +- .../Adminhtml/Block/Report/Search/Grid.php | 2 +- .../Block/Report/Shopcart/Abandoned.php | 2 +- .../Block/Report/Shopcart/Abandoned/Grid.php | 2 +- .../Block/Report/Shopcart/Customer.php | 2 +- .../Block/Report/Shopcart/Customer/Grid.php | 2 +- .../Block/Report/Shopcart/Product.php | 2 +- .../Block/Report/Shopcart/Product/Grid.php | 2 +- .../Adminhtml/Block/Report/Tag/Customer.php | 2 +- .../Block/Report/Tag/Customer/Detail.php | 2 +- .../Block/Report/Tag/Customer/Detail/Grid.php | 2 +- .../Block/Report/Tag/Customer/Grid.php | 2 +- .../Adminhtml/Block/Report/Tag/Popular.php | 2 +- .../Block/Report/Tag/Popular/Detail.php | 2 +- .../Block/Report/Tag/Popular/Detail/Grid.php | 2 +- .../Block/Report/Tag/Popular/Grid.php | 2 +- .../Adminhtml/Block/Report/Tag/Product.php | 2 +- .../Block/Report/Tag/Product/Detail.php | 2 +- .../Block/Report/Tag/Product/Detail/Grid.php | 2 +- .../Block/Report/Tag/Product/Grid.php | 2 +- .../Mage/Adminhtml/Block/Report/Wishlist.php | 2 +- .../Adminhtml/Block/Report/Wishlist/Grid.php | 2 +- .../core/Mage/Adminhtml/Block/Review/Add.php | 2 +- .../Mage/Adminhtml/Block/Review/Add/Form.php | 8 +- .../core/Mage/Adminhtml/Block/Review/Edit.php | 2 +- .../Mage/Adminhtml/Block/Review/Edit/Form.php | 15 +- .../core/Mage/Adminhtml/Block/Review/Grid.php | 38 +- .../Block/Review/Grid/Filter/Type.php | 2 +- .../Block/Review/Grid/Renderer/Type.php | 2 +- .../core/Mage/Adminhtml/Block/Review/Main.php | 2 +- .../Adminhtml/Block/Review/Product/Grid.php | 2 +- .../Block/Review/Rating/Detailed.php | 2 +- .../Adminhtml/Block/Review/Rating/Summary.php | 2 +- .../Mage/Adminhtml/Block/Sales/Creditmemo.php | 2 +- .../Adminhtml/Block/Sales/Creditmemo/Grid.php | 2 +- .../Mage/Adminhtml/Block/Sales/Invoice.php | 2 +- .../Adminhtml/Block/Sales/Invoice/Grid.php | 2 +- .../Adminhtml/Block/Sales/Items/Abstract.php | 2 +- .../Block/Sales/Items/Column/Default.php | 2 +- .../Block/Sales/Items/Column/Name.php | 2 +- .../Block/Sales/Items/Column/Name/Grouped.php | 2 +- .../Block/Sales/Items/Column/Qty.php | 2 +- .../Sales/Items/Renderer/Configurable.php | 2 +- .../Block/Sales/Items/Renderer/Default.php | 2 +- .../core/Mage/Adminhtml/Block/Sales/Order.php | 2 +- .../Adminhtml/Block/Sales/Order/Abstract.php | 2 +- .../Adminhtml/Block/Sales/Order/Address.php | 2 +- .../Block/Sales/Order/Address/Form.php | 2 +- .../Block/Sales/Order/Comments/View.php | 2 +- .../Adminhtml/Block/Sales/Order/Create.php | 14 +- .../Block/Sales/Order/Create/Abstract.php | 2 +- .../Sales/Order/Create/Billing/Address.php | 3 +- .../Sales/Order/Create/Billing/Method.php | 2 +- .../Order/Create/Billing/Method/Form.php | 2 +- .../Block/Sales/Order/Create/Comment.php | 2 +- .../Block/Sales/Order/Create/Coupons.php | 2 +- .../Block/Sales/Order/Create/Coupons/Form.php | 2 +- .../Block/Sales/Order/Create/Customer.php | 2 +- .../Sales/Order/Create/Customer/Grid.php | 2 +- .../Block/Sales/Order/Create/Data.php | 2 +- .../Block/Sales/Order/Create/Form.php | 2 +- .../Sales/Order/Create/Form/Abstract.php | 4 +- .../Block/Sales/Order/Create/Form/Account.php | 2 +- .../Block/Sales/Order/Create/Form/Address.php | 18 +- .../Block/Sales/Order/Create/Giftmessage.php | 2 +- .../Sales/Order/Create/Giftmessage/Form.php | 2 +- .../Block/Sales/Order/Create/Header.php | 2 +- .../Block/Sales/Order/Create/Items.php | 58 +- .../Block/Sales/Order/Create/Items/Grid.php | 2 +- .../Block/Sales/Order/Create/Load.php | 2 +- .../Block/Sales/Order/Create/Messages.php | 2 +- .../Block/Sales/Order/Create/Newsletter.php | 2 +- .../Sales/Order/Create/Newsletter/Form.php | 2 +- .../Block/Sales/Order/Create/Search.php | 2 +- .../Block/Sales/Order/Create/Search/Grid.php | 2 +- .../Create/Search/Grid/Renderer/Price.php | 7 +- .../Create/Search/Grid/Renderer/Product.php | 2 +- .../Order/Create/Search/Grid/Renderer/Qty.php | 2 +- .../Sales/Order/Create/Shipping/Address.php | 3 +- .../Sales/Order/Create/Shipping/Method.php | 2 +- .../Order/Create/Shipping/Method/Form.php | 2 +- .../Block/Sales/Order/Create/Sidebar.php | 2 +- .../Sales/Order/Create/Sidebar/Abstract.php | 2 +- .../Block/Sales/Order/Create/Sidebar/Cart.php | 25 +- .../Sales/Order/Create/Sidebar/Compared.php | 2 +- .../Sales/Order/Create/Sidebar/Pcompared.php | 2 +- .../Sales/Order/Create/Sidebar/Pviewed.php | 2 +- .../Sales/Order/Create/Sidebar/Reorder.php | 2 +- .../Sales/Order/Create/Sidebar/Viewed.php | 2 +- .../Sales/Order/Create/Sidebar/Wishlist.php | 2 +- .../Block/Sales/Order/Create/Store.php | 2 +- .../Block/Sales/Order/Create/Store/Select.php | 2 +- .../Block/Sales/Order/Create/Totals.php | 9 +- .../Sales/Order/Create/Totals/Default.php | 2 +- .../Sales/Order/Create/Totals/Discount.php | 2 +- .../Sales/Order/Create/Totals/Grandtotal.php | 2 +- .../Sales/Order/Create/Totals/Shipping.php | 2 +- .../Sales/Order/Create/Totals/Subtotal.php | 2 +- .../Block/Sales/Order/Create/Totals/Table.php | 2 +- .../Block/Sales/Order/Create/Totals/Tax.php | 2 +- .../Block/Sales/Order/Creditmemo/Create.php | 18 +- .../Order/Creditmemo/Create/Adjustments.php | 2 +- .../Sales/Order/Creditmemo/Create/Form.php | 2 +- .../Sales/Order/Creditmemo/Create/Items.php | 2 +- .../Block/Sales/Order/Creditmemo/Totals.php | 2 +- .../Block/Sales/Order/Creditmemo/View.php | 2 +- .../Sales/Order/Creditmemo/View/Comments.php | 2 +- .../Sales/Order/Creditmemo/View/Form.php | 2 +- .../Sales/Order/Creditmemo/View/Items.php | 2 +- .../Mage/Adminhtml/Block/Sales/Order/Grid.php | 2 +- .../Block/Sales/Order/Invoice/Create.php | 2 +- .../Block/Sales/Order/Invoice/Create/Form.php | 2 +- .../Sales/Order/Invoice/Create/Items.php | 2 +- .../Sales/Order/Invoice/Create/Tracking.php | 2 +- .../Block/Sales/Order/Invoice/Totals.php | 2 +- .../Block/Sales/Order/Invoice/View.php | 2 +- .../Sales/Order/Invoice/View/Comments.php | 2 +- .../Block/Sales/Order/Invoice/View/Form.php | 2 +- .../Block/Sales/Order/Invoice/View/Items.php | 2 +- .../Adminhtml/Block/Sales/Order/Payment.php | 2 +- .../Block/Sales/Order/Shipment/Create.php | 2 +- .../Sales/Order/Shipment/Create/Form.php | 2 +- .../Sales/Order/Shipment/Create/Items.php | 5 +- .../Sales/Order/Shipment/Create/Tracking.php | 2 +- .../Block/Sales/Order/Shipment/Packaging.php | 2 +- .../Sales/Order/Shipment/Packaging/Grid.php | 2 +- .../Sales/Order/Shipment/Tracking/Info.php | 2 +- .../Block/Sales/Order/Shipment/View.php | 2 +- .../Sales/Order/Shipment/View/Comments.php | 2 +- .../Block/Sales/Order/Shipment/View/Form.php | 7 +- .../Block/Sales/Order/Shipment/View/Items.php | 2 +- .../Sales/Order/Shipment/View/Tracking.php | 2 +- .../Adminhtml/Block/Sales/Order/Status.php | 2 +- .../Block/Sales/Order/Status/Assign.php | 2 +- .../Block/Sales/Order/Status/Assign/Form.php | 2 +- .../Block/Sales/Order/Status/Edit.php | 2 +- .../Block/Sales/Order/Status/Edit/Form.php | 2 +- .../Block/Sales/Order/Status/Grid.php | 2 +- .../Block/Sales/Order/Status/New.php | 2 +- .../Block/Sales/Order/Status/New/Form.php | 2 +- .../Adminhtml/Block/Sales/Order/Totalbar.php | 2 +- .../Adminhtml/Block/Sales/Order/Totals.php | 2 +- .../Block/Sales/Order/Totals/Item.php | 2 +- .../Block/Sales/Order/Totals/Tax.php | 2 +- .../Mage/Adminhtml/Block/Sales/Order/View.php | 2 +- .../Adminhtml/Block/Sales/Order/View/Form.php | 2 +- .../Block/Sales/Order/View/Giftmessage.php | 2 +- .../Block/Sales/Order/View/History.php | 2 +- .../Adminhtml/Block/Sales/Order/View/Info.php | 2 +- .../Block/Sales/Order/View/Items.php | 2 +- .../Order/View/Items/Renderer/Default.php | 2 +- .../Block/Sales/Order/View/Messages.php | 2 +- .../Sales/Order/View/Tab/Creditmemos.php | 2 +- .../Block/Sales/Order/View/Tab/History.php | 2 +- .../Block/Sales/Order/View/Tab/Info.php | 2 +- .../Block/Sales/Order/View/Tab/Invoices.php | 2 +- .../Block/Sales/Order/View/Tab/Shipments.php | 2 +- .../Sales/Order/View/Tab/Transactions.php | 2 +- .../Adminhtml/Block/Sales/Order/View/Tabs.php | 2 +- .../Block/Sales/Reorder/Renderer/Action.php | 2 +- .../Mage/Adminhtml/Block/Sales/Shipment.php | 2 +- .../Adminhtml/Block/Sales/Shipment/Grid.php | 2 +- .../Mage/Adminhtml/Block/Sales/Totals.php | 2 +- .../Adminhtml/Block/Sales/Transactions.php | 2 +- .../Block/Sales/Transactions/Child/Grid.php | 2 +- .../Block/Sales/Transactions/Detail.php | 7 +- .../Block/Sales/Transactions/Detail/Grid.php | 2 +- .../Block/Sales/Transactions/Grid.php | 2 +- .../Block/Shipping/Carrier/Tablerate/Grid.php | 2 +- .../core/Mage/Adminhtml/Block/Sitemap.php | 2 +- .../Mage/Adminhtml/Block/Sitemap/Edit.php | 2 +- .../Adminhtml/Block/Sitemap/Edit/Form.php | 2 +- .../Mage/Adminhtml/Block/Sitemap/Grid.php | 2 +- .../Block/Sitemap/Grid/Renderer/Action.php | 2 +- .../Block/Sitemap/Grid/Renderer/Link.php | 2 +- .../Block/Sitemap/Grid/Renderer/Time.php | 2 +- .../Mage/Adminhtml/Block/Store/Switcher.php | 55 +- .../Store/Switcher/Form/Renderer/Fieldset.php | 83 + .../Adminhtml/Block/System/Account/Edit.php | 2 +- .../Block/System/Account/Edit/Form.php | 2 +- .../Adminhtml/Block/System/Cache/Edit.php | 2 +- .../Adminhtml/Block/System/Cache/Form.php | 2 +- .../Adminhtml/Block/System/Config/Dwstree.php | 2 +- .../Adminhtml/Block/System/Config/Edit.php | 2 +- .../Adminhtml/Block/System/Config/Form.php | 16 +- .../Block/System/Config/Form/Field.php | 2 +- .../Config/Form/Field/Array/Abstract.php | 2 +- .../System/Config/Form/Field/Datetime.php | 2 +- .../Block/System/Config/Form/Field/Export.php | 2 +- .../Block/System/Config/Form/Field/File.php | 2 +- .../System/Config/Form/Field/Heading.php | 2 +- .../Block/System/Config/Form/Field/Image.php | 2 +- .../Block/System/Config/Form/Field/Import.php | 2 +- .../System/Config/Form/Field/Notification.php | 2 +- .../Config/Form/Field/Regexceptions.php | 2 +- .../Form/Field/Select/Allowspecific.php | 2 +- .../Config/Form/Field/Select/Flatcatalog.php | 2 +- .../Config/Form/Field/Select/Flatproduct.php | 2 +- .../Block/System/Config/Form/Fieldset.php | 2 +- .../Form/Fieldset/Modules/DisableOutput.php | 9 +- .../Config/Form/Fieldset/Order/Statuses.php | 2 +- .../Block/System/Config/Switcher.php | 11 +- .../System/Storage/Media/Synchronize.php | 2 +- .../Adminhtml/Block/System/Config/Tabs.php | 6 +- .../Adminhtml/Block/System/Convert/Gui.php | 2 +- .../Block/System/Convert/Gui/Edit.php | 2 +- .../Block/System/Convert/Gui/Edit/Form.php | 2 +- .../System/Convert/Gui/Edit/Tab/Upload.php | 2 +- .../System/Convert/Gui/Edit/Tab/View.php | 2 +- .../System/Convert/Gui/Edit/Tab/Wizard.php | 2 +- .../Block/System/Convert/Gui/Edit/Tabs.php | 2 +- .../Block/System/Convert/Gui/Grid.php | 2 +- .../Block/System/Convert/Profile.php | 2 +- .../Block/System/Convert/Profile/Edit.php | 2 +- .../Convert/Profile/Edit/Filter/Action.php | 2 +- .../System/Convert/Profile/Edit/Form.php | 2 +- .../Convert/Profile/Edit/Renderer/Action.php | 2 +- .../System/Convert/Profile/Edit/Tab/Edit.php | 2 +- .../Convert/Profile/Edit/Tab/History.php | 2 +- .../System/Convert/Profile/Edit/Tab/Run.php | 2 +- .../System/Convert/Profile/Edit/Tabs.php | 2 +- .../Block/System/Convert/Profile/Grid.php | 2 +- .../Block/System/Convert/Profile/Run.php | 2 +- .../Mage/Adminhtml/Block/System/Currency.php | 2 +- .../Block/System/Currency/Edit/Form.php | 2 +- .../Block/System/Currency/Edit/Tab/Main.php | 2 +- .../Block/System/Currency/Edit/Tab/Rates.php | 2 +- .../Block/System/Currency/Edit/Tabs.php | 2 +- .../Block/System/Currency/Rate/Matrix.php | 2 +- .../Block/System/Currency/Rate/Services.php | 2 +- .../Mage/Adminhtml/Block/System/Design.php | 2 +- .../Adminhtml/Block/System/Design/Edit.php | 2 +- .../Block/System/Design/Edit/Tab/General.php | 2 +- .../Block/System/Design/Edit/Tabs.php | 2 +- .../Adminhtml/Block/System/Design/Grid.php | 2 +- .../Adminhtml/Block/System/Email/Template.php | 2 +- .../Block/System/Email/Template/Edit.php | 2 +- .../Block/System/Email/Template/Edit/Form.php | 2 +- .../Block/System/Email/Template/Grid.php | 2 +- .../Email/Template/Grid/Filter/Type.php | 19 +- .../Email/Template/Grid/Renderer/Action.php | 2 +- .../Email/Template/Grid/Renderer/Sender.php | 2 +- .../Email/Template/Grid/Renderer/Type.php | 9 +- .../Block/System/Email/Template/Preview.php | 17 +- .../Adminhtml/Block/System/Store/Delete.php | 2 +- .../Block/System/Store/Delete/Form.php | 2 +- .../Block/System/Store/Delete/Group.php | 2 +- .../Block/System/Store/Delete/Website.php | 2 +- .../Adminhtml/Block/System/Store/Edit.php | 2 +- .../Block/System/Store/Edit/Form.php | 10 +- .../Adminhtml/Block/System/Store/Grid.php | 2 +- .../Block/System/Store/Grid/Render/Group.php | 2 +- .../Block/System/Store/Grid/Render/Store.php | 2 +- .../System/Store/Grid/Render/Website.php | 2 +- .../Adminhtml/Block/System/Store/Store.php | 2 +- .../Mage/Adminhtml/Block/System/Variable.php | 2 +- .../Adminhtml/Block/System/Variable/Edit.php | 2 +- .../Block/System/Variable/Edit/Form.php | 2 +- .../Adminhtml/Block/System/Variable/Grid.php | 2 +- .../Adminhtml/Block/Tag/Assigned/Grid.php | 2 +- .../Mage/Adminhtml/Block/Tag/Customer.php | 2 +- .../Adminhtml/Block/Tag/Customer/Grid.php | 2 +- .../core/Mage/Adminhtml/Block/Tag/Edit.php | 2 +- .../Adminhtml/Block/Tag/Edit/Accordion.php | 2 +- .../Adminhtml/Block/Tag/Edit/Assigned.php | 2 +- .../Mage/Adminhtml/Block/Tag/Edit/Form.php | 2 +- .../Mage/Adminhtml/Block/Tag/Grid/All.php | 2 +- .../Mage/Adminhtml/Block/Tag/Grid/Pending.php | 2 +- .../core/Mage/Adminhtml/Block/Tag/Pending.php | 2 +- .../core/Mage/Adminhtml/Block/Tag/Product.php | 2 +- .../Mage/Adminhtml/Block/Tag/Product/Grid.php | 2 +- .../Adminhtml/Block/Tag/Store/Switcher.php | 2 +- .../core/Mage/Adminhtml/Block/Tag/Tag.php | 2 +- .../Mage/Adminhtml/Block/Tag/Tag/Grid.php | 2 +- .../core/Mage/Adminhtml/Block/Tax/Class.php | 2 +- .../Mage/Adminhtml/Block/Tax/Class/Edit.php | 2 +- .../Adminhtml/Block/Tax/Class/Edit/Form.php | 2 +- .../Mage/Adminhtml/Block/Tax/Class/Grid.php | 2 +- .../Mage/Adminhtml/Block/Tax/Rate/Form.php | 4 +- .../Mage/Adminhtml/Block/Tax/Rate/Grid.php | 2 +- .../Block/Tax/Rate/Grid/Renderer/Country.php | 2 +- .../Block/Tax/Rate/Grid/Renderer/Data.php | 2 +- .../Adminhtml/Block/Tax/Rate/ImportExport.php | 2 +- .../Mage/Adminhtml/Block/Tax/Rate/Title.php | 2 +- .../Block/Tax/Rate/Title/Fieldset.php | 2 +- .../Adminhtml/Block/Tax/Rate/Toolbar/Add.php | 2 +- .../Adminhtml/Block/Tax/Rate/Toolbar/Save.php | 2 +- .../core/Mage/Adminhtml/Block/Tax/Rule.php | 2 +- .../Mage/Adminhtml/Block/Tax/Rule/Edit.php | 2 +- .../Adminhtml/Block/Tax/Rule/Edit/Form.php | 2 +- .../Mage/Adminhtml/Block/Tax/Rule/Grid.php | 2 +- .../core/Mage/Adminhtml/Block/Template.php | 2 +- .../core/Mage/Adminhtml/Block/Text/List.php | 2 +- .../core/Mage/Adminhtml/Block/Urlrewrite.php | 2 +- .../Block/Urlrewrite/Category/Tree.php | 2 +- .../Mage/Adminhtml/Block/Urlrewrite/Edit.php | 2 +- .../Adminhtml/Block/Urlrewrite/Edit/Form.php | 2 +- .../Mage/Adminhtml/Block/Urlrewrite/Grid.php | 2 +- .../Mage/Adminhtml/Block/Urlrewrite/Link.php | 2 +- .../Block/Urlrewrite/Product/Grid.php | 2 +- .../Adminhtml/Block/Urlrewrite/Selector.php | 2 +- app/code/core/Mage/Adminhtml/Block/Widget.php | 2 +- .../Mage/Adminhtml/Block/Widget/Accordion.php | 2 +- .../Adminhtml/Block/Widget/Accordion/Item.php | 2 +- .../Adminhtml/Block/Widget/Breadcrumbs.php | 2 +- .../Mage/Adminhtml/Block/Widget/Button.php | 4 +- .../Mage/Adminhtml/Block/Widget/Container.php | 2 +- .../core/Mage/Adminhtml/Block/Widget/Form.php | 7 +- .../Adminhtml/Block/Widget/Form/Container.php | 2 +- .../Adminhtml/Block/Widget/Form/Element.php | 2 +- .../Block/Widget/Form/Element/Dependence.php | 7 +- .../Block/Widget/Form/Element/Gallery.php | 2 +- .../Block/Widget/Form/Renderer/Element.php | 2 +- .../Block/Widget/Form/Renderer/Fieldset.php | 2 +- .../Widget/Form/Renderer/Fieldset/Element.php | 7 +- .../core/Mage/Adminhtml/Block/Widget/Grid.php | 48 +- .../Adminhtml/Block/Widget/Grid/Column.php | 2 +- .../Widget/Grid/Column/Filter/Abstract.php | 2 +- .../Widget/Grid/Column/Filter/Checkbox.php | 2 +- .../Widget/Grid/Column/Filter/Country.php | 2 +- .../Block/Widget/Grid/Column/Filter/Date.php | 2 +- .../Widget/Grid/Column/Filter/Datetime.php | 2 +- .../Widget/Grid/Column/Filter/Interface.php | 2 +- .../Widget/Grid/Column/Filter/Massaction.php | 2 +- .../Block/Widget/Grid/Column/Filter/Price.php | 2 +- .../Block/Widget/Grid/Column/Filter/Radio.php | 2 +- .../Block/Widget/Grid/Column/Filter/Range.php | 2 +- .../Widget/Grid/Column/Filter/Select.php | 2 +- .../Block/Widget/Grid/Column/Filter/Store.php | 2 +- .../Block/Widget/Grid/Column/Filter/Text.php | 2 +- .../Block/Widget/Grid/Column/Filter/Theme.php | 2 +- .../Widget/Grid/Column/Renderer/Abstract.php | 2 +- .../Widget/Grid/Column/Renderer/Action.php | 2 +- .../Widget/Grid/Column/Renderer/Checkbox.php | 2 +- .../Widget/Grid/Column/Renderer/Concat.php | 2 +- .../Widget/Grid/Column/Renderer/Country.php | 2 +- .../Widget/Grid/Column/Renderer/Currency.php | 2 +- .../Widget/Grid/Column/Renderer/Date.php | 2 +- .../Widget/Grid/Column/Renderer/Datetime.php | 2 +- .../Widget/Grid/Column/Renderer/Input.php | 2 +- .../Widget/Grid/Column/Renderer/Interface.php | 2 +- .../Block/Widget/Grid/Column/Renderer/Ip.php | 2 +- .../Widget/Grid/Column/Renderer/Longtext.php | 2 +- .../Grid/Column/Renderer/Massaction.php | 2 +- .../Widget/Grid/Column/Renderer/Number.php | 2 +- .../Widget/Grid/Column/Renderer/Options.php | 2 +- .../Widget/Grid/Column/Renderer/Price.php | 2 +- .../Widget/Grid/Column/Renderer/Radio.php | 2 +- .../Widget/Grid/Column/Renderer/Select.php | 2 +- .../Widget/Grid/Column/Renderer/Store.php | 2 +- .../Widget/Grid/Column/Renderer/Text.php | 2 +- .../Widget/Grid/Column/Renderer/Wrapline.php | 2 +- .../Adminhtml/Block/Widget/Grid/Container.php | 2 +- .../Block/Widget/Grid/Massaction.php | 2 +- .../Block/Widget/Grid/Massaction/Abstract.php | 27 +- .../Block/Widget/Grid/Massaction/Item.php | 2 +- .../Massaction/Item/Additional/Default.php | 2 +- .../Massaction/Item/Additional/Interface.php | 2 +- .../Block/Widget/Grid/Serializer.php | 2 +- .../Adminhtml/Block/Widget/Tab/Interface.php | 2 +- .../core/Mage/Adminhtml/Block/Widget/Tabs.php | 2 +- .../Adminhtml/Block/Widget/View/Container.php | 2 +- .../core/Mage/Adminhtml/Controller/Action.php | 2 +- .../Adminhtml/Controller/Report/Abstract.php | 124 + .../Adminhtml/Controller/Sales/Creditmemo.php | 2 +- .../Adminhtml/Controller/Sales/Invoice.php | 2 +- .../Adminhtml/Controller/Sales/Shipment.php | 2 +- app/code/core/Mage/Adminhtml/Exception.php | 2 +- .../core/Mage/Adminhtml/Helper/Addresses.php | 2 +- .../core/Mage/Adminhtml/Helper/Catalog.php | 2 +- .../Helper/Catalog/Product/Composite.php | 2 +- .../Catalog/Product/Edit/Action/Attribute.php | 2 +- .../Adminhtml/Helper/Dashboard/Abstract.php | 2 +- .../Mage/Adminhtml/Helper/Dashboard/Data.php | 2 +- .../Mage/Adminhtml/Helper/Dashboard/Order.php | 2 +- app/code/core/Mage/Adminhtml/Helper/Data.php | 2 +- app/code/core/Mage/Adminhtml/Helper/Js.php | 2 +- .../core/Mage/Adminhtml/Helper/Media/Js.php | 5 +- app/code/core/Mage/Adminhtml/Helper/Rss.php | 2 +- app/code/core/Mage/Adminhtml/Helper/Sales.php | 2 +- app/code/core/Mage/Adminhtml/Model/Config.php | 2 +- .../core/Mage/Adminhtml/Model/Config/Data.php | 4 +- .../Model/Customer/Renderer/Region.php | 2 +- .../Mage/Adminhtml/Model/Email/Template.php | 2 +- .../core/Mage/Adminhtml/Model/Extension.php | 2 +- .../Mage/Adminhtml/Model/Giftmessage/Save.php | 2 +- .../Model/LayoutUpdate/Validator.php | 2 +- .../Model/Newsletter/Renderer/Text.php | 2 +- .../core/Mage/Adminhtml/Model/Observer.php | 2 +- .../core/Mage/Adminhtml/Model/Report/Item.php | 2 +- .../core/Mage/Adminhtml/Model/Sales/Order.php | 7 +- .../Adminhtml/Model/Sales/Order/Create.php | 31 +- .../Adminhtml/Model/Sales/Order/Random.php | 2 +- .../Mage/Adminhtml/Model/Search/Catalog.php | 2 +- .../Mage/Adminhtml/Model/Search/Customer.php | 2 +- .../Mage/Adminhtml/Model/Search/Order.php | 2 +- .../core/Mage/Adminhtml/Model/Session.php | 2 +- .../Mage/Adminhtml/Model/Session/Quote.php | 2 +- .../System/Config/Backend/Admin/Custom.php | 2 +- .../Config/Backend/Admin/Custompath.php | 2 +- .../System/Config/Backend/Admin/Observer.php | 2 +- .../Admin/Password/Link/Expirationperiod.php | 2 +- .../System/Config/Backend/Admin/Usecustom.php | 2 +- .../Config/Backend/Admin/Usecustompath.php | 2 +- .../Config/Backend/Admin/Usesecretkey.php | 2 +- .../Model/System/Config/Backend/Baseurl.php | 2 +- .../Model/System/Config/Backend/Cache.php | 2 +- .../Backend/Catalog/Inventory/Managestock.php | 2 +- .../Config/Backend/Catalog/Search/Type.php | 2 +- .../Model/System/Config/Backend/Category.php | 2 +- .../Config/Backend/Currency/Abstract.php | 2 +- .../System/Config/Backend/Currency/Allow.php | 2 +- .../System/Config/Backend/Currency/Base.php | 2 +- .../System/Config/Backend/Currency/Cron.php | 2 +- .../Config/Backend/Currency/Default.php | 2 +- .../Backend/Customer/Address/Street.php | 2 +- .../Backend/Customer/GroupAutoAssign.php | 57 + .../Password/Link/Expirationperiod.php | 2 +- .../Config/Backend/Customer/Show/Address.php | 2 +- .../Config/Backend/Customer/Show/Customer.php | 2 +- .../Model/System/Config/Backend/Datashare.php | 2 +- .../Config/Backend/Design/Exception.php | 2 +- .../System/Config/Backend/Email/Address.php | 2 +- .../System/Config/Backend/Email/Sender.php | 2 +- .../Model/System/Config/Backend/Encrypted.php | 2 +- .../Model/System/Config/Backend/File.php | 2 +- .../Model/System/Config/Backend/Filename.php | 2 +- .../Model/System/Config/Backend/Image.php | 2 +- .../System/Config/Backend/Image/Favicon.php | 2 +- .../Model/System/Config/Backend/Image/Pdf.php | 2 +- .../Model/System/Config/Backend/Locale.php | 11 +- .../System/Config/Backend/Locale/Timezone.php | 2 +- .../Model/System/Config/Backend/Log/Cron.php | 2 +- .../System/Config/Backend/Price/Scope.php | 2 +- .../Config/Backend/Product/Alert/Cron.php | 2 +- .../Model/System/Config/Backend/Secure.php | 2 +- .../System/Config/Backend/Seo/Product.php | 2 +- .../System/Config/Backend/Serialized.php | 2 +- .../Config/Backend/Serialized/Array.php | 2 +- .../Config/Backend/Shipping/Tablerate.php | 2 +- .../Model/System/Config/Backend/Sitemap.php | 2 +- .../System/Config/Backend/Sitemap/Cron.php | 2 +- .../Config/Backend/Storage/Media/Database.php | 2 +- .../Model/System/Config/Backend/Store.php | 2 +- .../Model/System/Config/Backend/Translate.php | 2 +- .../Model/System/Config/Clone/Media/Image.php | 2 +- .../Model/System/Config/Source/Admin/Page.php | 2 +- .../Model/System/Config/Source/Allregion.php | 2 +- .../Config/Source/Catalog/GridPerPage.php | 2 +- .../System/Config/Source/Catalog/ListMode.php | 2 +- .../Config/Source/Catalog/ListPerPage.php | 2 +- .../System/Config/Source/Catalog/ListSort.php | 2 +- .../Config/Source/Catalog/Search/Type.php | 2 +- .../Config/Source/Catalog/TimeFormat.php | 2 +- .../Model/System/Config/Source/Category.php | 2 +- .../Model/System/Config/Source/Checktype.php | 2 +- .../Model/System/Config/Source/Cms/Page.php | 2 +- .../Config/Source/Cms/Wysiwyg/Enabled.php | 2 +- .../Model/System/Config/Source/Country.php | 2 +- .../System/Config/Source/Country/Full.php | 2 +- .../System/Config/Source/Cron/Frequency.php | 2 +- .../Model/System/Config/Source/Currency.php | 2 +- .../System/Config/Source/Currency/Service.php | 2 +- .../Config/Source/Customer/Address/Type.php | 48 + .../System/Config/Source/Customer/Group.php | 2 +- .../Source/Customer/Group/Multiselect.php | 50 + .../Model/System/Config/Source/Date/Short.php | 2 +- .../System/Config/Source/Design/Package.php | 2 +- .../System/Config/Source/Design/Robots.php | 2 +- .../System/Config/Source/Dev/Dbautoup.php | 9 +- .../System/Config/Source/Email/Identity.php | 2 +- .../System/Config/Source/Email/Method.php | 2 +- .../System/Config/Source/Email/Smtpauth.php | 2 +- .../System/Config/Source/Email/Template.php | 2 +- .../System/Config/Source/Enabledisable.php | 2 +- .../Model/System/Config/Source/Frequency.php | 2 +- .../Model/System/Config/Source/Locale.php | 2 +- .../System/Config/Source/Locale/Country.php | 2 +- .../System/Config/Source/Locale/Currency.php | 2 +- .../Config/Source/Locale/Currency/All.php | 2 +- .../System/Config/Source/Locale/Timezone.php | 2 +- .../System/Config/Source/Locale/Weekdays.php | 2 +- .../Model/System/Config/Source/Nooptreq.php | 2 +- .../Config/Source/Notification/Frequency.php | 2 +- .../System/Config/Source/Order/Status.php | 2 +- .../System/Config/Source/Order/Status/New.php | 2 +- .../Source/Order/Status/Newprocessing.php | 2 +- .../Config/Source/Order/Status/Processing.php | 2 +- .../Config/Source/Payment/Allmethods.php | 2 +- .../Config/Source/Payment/Allowedmethods.php | 2 +- .../Source/Payment/Allspecificcountries.php | 2 +- .../System/Config/Source/Payment/Cctype.php | 2 +- .../System/Config/Source/Price/Scope.php | 2 +- .../Model/System/Config/Source/Price/Step.php | 2 +- .../Config/Source/Product/Options/Price.php | 2 +- .../Config/Source/Product/Options/Type.php | 11 +- .../Config/Source/Product/Thumbnail.php | 2 +- .../System/Config/Source/Reports/Scope.php | 2 +- .../Config/Source/Shipping/Allmethods.php | 2 +- .../Source/Shipping/Allspecificcountries.php | 2 +- .../Config/Source/Shipping/Flatrate.php | 2 +- .../Config/Source/Shipping/Tablerate.php | 2 +- .../Config/Source/Shipping/Taxclass.php | 2 +- .../Config/Source/Storage/Media/Database.php | 2 +- .../Config/Source/Storage/Media/Storage.php | 2 +- .../Model/System/Config/Source/Store.php | 2 +- .../System/Config/Source/Tax/Apply/On.php | 2 +- .../System/Config/Source/Tax/Basedon.php | 2 +- .../System/Config/Source/Tax/Catalog.php | 2 +- .../Config/Source/Watermark/Position.php | 2 +- .../System/Config/Source/Web/Protocol.php | 2 +- .../System/Config/Source/Web/Redirect.php | 2 +- .../Model/System/Config/Source/Website.php | 2 +- .../Model/System/Config/Source/Yesno.php | 2 +- .../System/Config/Source/Yesnocustom.php | 2 +- .../Mage/Adminhtml/Model/System/Store.php | 4 +- app/code/core/Mage/Adminhtml/Model/Url.php | 2 +- .../Adminhtml/controllers/AjaxController.php | 2 +- .../controllers/Api/RoleController.php | 2 +- .../controllers/Api/UserController.php | 2 +- .../Adminhtml/controllers/CacheController.php | 2 +- .../Catalog/Category/WidgetController.php | 2 +- .../Catalog/CategoryController.php | 24 +- .../Product/Action/AttributeController.php | 5 +- .../Catalog/Product/AttributeController.php | 5 +- .../Catalog/Product/DatafeedsController.php | 2 +- .../Catalog/Product/GalleryController.php | 7 +- .../Catalog/Product/GroupController.php | 2 +- .../Catalog/Product/ReviewController.php | 2 +- .../Catalog/Product/SetController.php | 2 +- .../Catalog/Product/WidgetController.php | 2 +- .../controllers/Catalog/ProductController.php | 2 +- .../controllers/Catalog/SearchController.php | 6 +- .../Checkout/AgreementController.php | 15 +- .../Cms/Block/WidgetController.php | 2 +- .../controllers/Cms/BlockController.php | 2 +- .../controllers/Cms/Page/WidgetController.php | 2 +- .../controllers/Cms/PageController.php | 2 +- .../Cms/Wysiwyg/ImagesController.php | 2 +- .../controllers/Cms/WysiwygController.php | 2 +- .../Cart/Product/Composite/CartController.php | 2 +- .../controllers/Customer/GroupController.php | 2 +- .../controllers/Customer/OnlineController.php | 2 +- .../System/Config/ValidatevatController.php | 91 + .../Product/Composite/WishlistController.php | 2 +- .../controllers/CustomerController.php | 89 +- .../controllers/DashboardController.php | 2 +- .../Adminhtml/controllers/IndexController.php | 64 +- .../Adminhtml/controllers/JsonController.php | 2 +- .../controllers/Media/EditorController.php | 2 +- .../controllers/Media/UploaderController.php | 2 +- .../Newsletter/ProblemController.php | 2 +- .../Newsletter/QueueController.php | 2 +- .../Newsletter/SubscriberController.php | 10 +- .../Newsletter/TemplateController.php | 2 +- .../controllers/NotificationController.php | 2 +- .../Permissions/RoleController.php | 2 +- .../Permissions/UserController.php | 2 +- .../controllers/Poll/AnswerController.php | 2 +- .../Adminhtml/controllers/PollController.php | 2 +- .../controllers/Promo/CatalogController.php | 17 +- .../controllers/Promo/QuoteController.php | 163 +- .../controllers/Promo/WidgetController.php | 2 +- .../Adminhtml/controllers/PromoController.php | 2 +- .../controllers/RatingController.php | 2 +- .../controllers/Report/CustomerController.php | 2 +- .../controllers/Report/ProductController.php | 50 +- .../controllers/Report/ReviewController.php | 2 +- .../controllers/Report/SalesController.php | 75 +- .../controllers/Report/ShopcartController.php | 2 +- .../Report/StatisticsController.php | 15 +- .../controllers/Report/TagController.php | 2 +- .../controllers/ReportController.php | 2 +- .../controllers/Rss/CatalogController.php | 2 +- .../controllers/Rss/OrderController.php | 2 +- .../Sales/Billing/AgreementController.php | 2 +- .../Sales/CreditmemoController.php | 2 +- .../controllers/Sales/InvoiceController.php | 2 +- .../Sales/Order/CreateController.php | 23 +- .../Sales/Order/CreditmemoController.php | 2 +- .../Sales/Order/EditController.php | 28 +- .../Sales/Order/InvoiceController.php | 2 +- .../Sales/Order/ShipmentController.php | 13 +- .../Sales/Order/StatusController.php | 2 +- .../Order/View/GiftmessageController.php | 2 +- .../controllers/Sales/OrderController.php | 9 +- .../Sales/Recurring/ProfileController.php | 2 +- .../controllers/Sales/ShipmentController.php | 2 +- .../Sales/TransactionsController.php | 12 +- .../controllers/SitemapController.php | 2 +- .../controllers/SurveyController.php | 2 +- .../controllers/System/AccountController.php | 2 +- .../controllers/System/BackupController.php | 280 +- .../Config/System/StorageController.php | 2 +- .../controllers/System/ConfigController.php | 7 +- .../System/Convert/GuiController.php | 2 +- .../System/Convert/ProfileController.php | 2 +- .../controllers/System/CurrencyController.php | 2 +- .../controllers/System/DesignController.php | 2 +- .../System/Email/TemplateController.php | 2 +- .../controllers/System/StoreController.php | 6 +- .../controllers/System/VariableController.php | 10 +- .../controllers/SystemController.php | 2 +- .../Adminhtml/controllers/TagController.php | 24 +- .../Tax/Class/CustomerController.php | 2 +- .../Tax/Class/ProductController.php | 2 +- .../controllers/Tax/ClassController.php | 5 +- .../controllers/Tax/RateController.php | 25 +- .../controllers/Tax/RuleController.php | 7 +- .../controllers/UrlrewriteController.php | 2 +- .../core/Mage/Adminhtml/etc/adminhtml.xml | 2 +- app/code/core/Mage/Adminhtml/etc/config.xml | 8 +- .../core/Mage/Adminhtml/etc/translater.xml | 65 + .../Mage/Adminhtml/view/adminhtml/admin.xml | 2 +- .../view/adminhtml/admin/access_denied.phtml | 2 +- .../view/adminhtml/admin/forgotpassword.phtml | 7 +- .../view/adminhtml/admin/formkey.phtml | 2 +- .../view/adminhtml/admin/login.phtml | 5 +- .../view/adminhtml/admin/overlay_popup.phtml | 2 +- .../Adminhtml/view/adminhtml/admin/page.phtml | 4 +- .../view/adminhtml/admin/popup.phtml | 2 +- .../view/adminhtml/adminnotification.xml | 2 +- .../adminhtml/api/role_users_grid_js.phtml | 2 +- .../view/adminhtml/api/roleinfo.phtml | 2 +- .../Adminhtml/view/adminhtml/api/roles.phtml | 4 +- .../view/adminhtml/api/rolesedit.phtml | 2 +- .../view/adminhtml/api/rolesusers.phtml | 2 +- .../adminhtml/api/user_roles_grid_js.phtml | 2 +- .../view/adminhtml/api/userinfo.phtml | 2 +- .../view/adminhtml/api/usernroles.phtml | 2 +- .../view/adminhtml/backup/dialogs.phtml | 190 + .../view/adminhtml/backup/left.phtml | 2 +- .../view/adminhtml/backup/list.phtml | 9 +- .../Mage/Adminhtml/view/adminhtml/catalog.xml | 2 +- .../catalog/category/checkboxes/tree.phtml | 2 +- .../adminhtml/catalog/category/edit.phtml | 2 +- .../catalog/category/edit/form.phtml | 2 +- .../adminhtml/catalog/category/tree.phtml | 2 +- .../catalog/category/widget/tree.phtml | 2 +- .../form/renderer/fieldset/element.phtml | 2 +- .../view/adminhtml/catalog/product.js | 2 +- .../view/adminhtml/catalog/product.phtml | 2 +- .../catalog/product/attribute/js.phtml | 2 +- .../product/attribute/new/created.phtml | 2 +- .../catalog/product/attribute/options.phtml | 4 +- .../catalog/product/attribute/set/main.phtml | 2 +- .../attribute/set/main/tree/attribute.phtml | 2 +- .../attribute/set/main/tree/group.phtml | 2 +- .../product/attribute/set/toolbar/add.phtml | 2 +- .../product/attribute/set/toolbar/main.phtml | 2 +- .../catalog/product/composite/configure.js | 10 +- .../catalog/product/composite/configure.phtml | 6 +- .../composite/fieldset/configurable.phtml | 2 +- .../product/composite/fieldset/grouped.phtml | 2 +- .../product/composite/fieldset/options.phtml | 2 +- .../composite/fieldset/options/js.phtml | 2 +- .../fieldset/options/type/date.phtml | 2 +- .../fieldset/options/type/default.phtml | 2 +- .../fieldset/options/type/file.phtml | 2 +- .../fieldset/options/type/select.phtml | 2 +- .../fieldset/options/type/text.phtml | 2 +- .../product/composite/fieldset/qty.phtml | 2 +- .../adminhtml/catalog/product/created.phtml | 2 +- .../view/adminhtml/catalog/product/edit.phtml | 2 +- .../product/edit/action/attribute.phtml | 2 +- .../product/edit/action/inventory.phtml | 2 +- .../product/edit/action/websites.phtml | 2 +- .../catalog/product/edit/categories.phtml | 2 +- .../catalog/product/edit/options.phtml | 2 +- .../catalog/product/edit/options/option.phtml | 4 +- .../product/edit/options/type/date.phtml | 4 +- .../product/edit/options/type/file.phtml | 28 +- .../product/edit/options/type/select.phtml | 4 +- .../product/edit/options/type/text.phtml | 2 +- .../catalog/product/edit/price/group.phtml | 169 + .../catalog/product/edit/price/tier.phtml | 8 +- .../catalog/product/edit/serializer.phtml | 2 +- .../catalog/product/edit/super/config.phtml | 10 +- .../catalog/product/edit/websites.phtml | 3 +- .../catalog/product/helper/gallery.phtml | 2 +- .../view/adminhtml/catalog/product/js.phtml | 2 +- .../adminhtml/catalog/product/price.phtml | 16 +- .../adminhtml/catalog/product/tab/alert.phtml | 2 +- .../catalog/product/tab/inventory.phtml | 2 +- .../product/widget/chooser/container.phtml | 2 +- .../view/adminhtml/catalog/wysiwyg/js.phtml | 2 +- .../view/adminhtml/catalogsearch.xml | 2 +- .../Mage/Adminhtml/view/adminhtml/cms.xml | 2 +- .../view/adminhtml/cms/browser/content.phtml | 2 +- .../adminhtml/cms/browser/content/files.phtml | 2 +- .../cms/browser/content/newfolder.phtml | 2 +- .../cms/browser/content/uploader.phtml | 5 +- .../view/adminhtml/cms/browser/js.phtml | 2 +- .../view/adminhtml/cms/browser/tree.phtml | 2 +- .../cms/page/edit/form/renderer/content.phtml | 2 +- .../Adminhtml/view/adminhtml/customer.xml | 41 +- .../view/adminhtml/customer/edit/js.phtml | 2 +- .../tab/account/form/renderer/group.phtml | 52 + .../customer/edit/tab/view/grid/item.phtml | 2 +- .../view/adminhtml/customer/online.phtml | 2 +- .../create/address/form/renderer/vat.phtml | 52 + .../customer/system/config/validatevat.phtml | 65 + .../adminhtml/customer/tab/addresses.phtml | 8 +- .../view/adminhtml/customer/tab/cart.phtml | 2 +- .../adminhtml/customer/tab/newsletter.phtml | 2 +- .../view/adminhtml/customer/tab/view.phtml | 2 +- .../adminhtml/customer/tab/view/sales.phtml | 2 +- .../adminhtml/customer/tab/wishlist.phtml | 2 +- .../view/adminhtml/dashboard/graph.phtml | 2 +- .../adminhtml/dashboard/graph/disabled.phtml | 2 +- .../view/adminhtml/dashboard/grid.phtml | 2 +- .../view/adminhtml/dashboard/index.phtml | 2 +- .../view/adminhtml/dashboard/salebar.phtml | 2 +- .../view/adminhtml/dashboard/searches.phtml | 2 +- .../adminhtml/dashboard/store/switcher.phtml | 5 +- .../view/adminhtml/dashboard/totalbar.phtml | 2 +- .../Adminhtml/view/adminhtml/dataflow.xml | 2 +- .../view/adminhtml/email/order/items.phtml | 2 +- .../Mage/Adminhtml/view/adminhtml/main.xml | 22 +- .../view/adminhtml/media/editor.phtml | 3 +- .../view/adminhtml/media/uploader.phtml | 4 +- .../Adminhtml/view/adminhtml/newsletter.xml | 2 +- .../newsletter/preview/iframeswitcher.phtml | 4 +- .../adminhtml/newsletter/preview/store.phtml | 5 +- .../adminhtml/newsletter/problem/list.phtml | 2 +- .../adminhtml/newsletter/queue/edit.phtml | 2 +- .../adminhtml/newsletter/queue/list.phtml | 2 +- .../adminhtml/newsletter/queue/preview.phtml | 2 +- .../newsletter/subscriber/list.phtml | 4 +- .../adminhtml/newsletter/template/edit.phtml | 2 +- .../adminhtml/newsletter/template/list.phtml | 4 +- .../newsletter/template/preview.phtml | 2 +- .../view/adminhtml/notification/baseurl.phtml | 2 +- .../adminhtml/notification/security.phtml | 2 +- .../view/adminhtml/notification/survey.phtml | 2 +- .../view/adminhtml/notification/toolbar.phtml | 14 +- .../view/adminhtml/notification/window.phtml | 2 +- .../view/adminhtml/page/footer.phtml | 2 +- .../Adminhtml/view/adminhtml/page/head.phtml | 4 +- .../view/adminhtml/page/header.phtml | 2 +- .../view/adminhtml/page/js/calendar.phtml | 2 +- .../view/adminhtml/page/js/translate.phtml | 16 +- .../Adminhtml/view/adminhtml/page/menu.phtml | 4 +- .../view/adminhtml/page/notices.phtml | 4 +- .../permissions/role_users_grid_js.phtml | 2 +- .../view/adminhtml/permissions/roleinfo.phtml | 2 +- .../view/adminhtml/permissions/roles.phtml | 4 +- .../adminhtml/permissions/rolesedit.phtml | 2 +- .../adminhtml/permissions/rolesusers.phtml | 2 +- .../permissions/user_roles_grid_js.phtml | 2 +- .../view/adminhtml/permissions/userinfo.phtml | 2 +- .../view/adminhtml/permissions/users.phtml | 4 +- .../view/adminhtml/poll/answers/list.phtml | 2 +- .../Mage/Adminhtml/view/adminhtml/promo.xml | 13 +- .../view/adminhtml/promo/fieldset.phtml | 2 +- .../Adminhtml/view/adminhtml/promo/form.phtml | 2 +- .../Adminhtml/view/adminhtml/promo/js.phtml | 2 +- .../Adminhtml/view/adminhtml/promo/rules.js | 2 +- .../view/adminhtml/promo/salesrulejs.phtml | 113 + .../view/adminhtml/rating/detailed.phtml | 2 +- .../view/adminhtml/rating/options.phtml | 2 +- .../adminhtml/rating/stars/detailed.phtml | 2 +- .../view/adminhtml/rating/stars/summary.phtml | 2 +- .../Mage/Adminhtml/view/adminhtml/report.xml | 22 +- .../view/adminhtml/report/grid.phtml | 2 +- .../adminhtml/report/grid/container.phtml | 4 +- .../adminhtml/report/refresh/statistics.phtml | 2 +- .../adminhtml/report/store/switcher.phtml | 5 +- .../report/store/switcher/enhanced.phtml | 5 +- .../view/adminhtml/report/wishlist.phtml | 2 +- .../Adminhtml/view/adminhtml/review/add.phtml | 2 +- .../Mage/Adminhtml/view/adminhtml/sales.xml | 4 +- .../adminhtml/sales/items/column/name.phtml | 2 +- .../adminhtml/sales/items/column/qty.phtml | 2 +- .../sales/items/renderer/default.phtml | 2 +- .../adminhtml/sales/order/address/form.phtml | 2 +- .../adminhtml/sales/order/comments/view.phtml | 2 +- .../sales/order/create/abstract.phtml | 2 +- .../order/create/billing/method/form.phtml | 4 +- .../sales/order/create/comment.phtml | 2 +- .../sales/order/create/coupons/form.phtml | 2 +- .../adminhtml/sales/order/create/data.phtml | 4 +- .../adminhtml/sales/order/create/form.phtml | 2 +- .../sales/order/create/form/account.phtml | 2 +- .../sales/order/create/form/address.phtml | 2 +- .../sales/order/create/giftmessage.js | 2 +- .../sales/order/create/giftmessage.phtml | 2 +- .../adminhtml/sales/order/create/items.phtml | 2 +- .../sales/order/create/items/grid.phtml | 2 +- .../adminhtml/sales/order/create/js.phtml | 2 +- .../sales/order/create/newsletter/form.phtml | 2 +- .../adminhtml/sales/order/create/scripts.js | 216 +- .../order/create/shipping/method/form.phtml | 4 +- .../sales/order/create/sidebar.phtml | 2 +- .../sales/order/create/sidebar/items.phtml | 5 +- .../sales/order/create/store/select.phtml | 3 +- .../adminhtml/sales/order/create/totals.phtml | 2 +- .../sales/order/create/totals/default.phtml | 4 +- .../order/create/totals/grandtotal.phtml | 2 +- .../sales/order/create/totals/shipping.phtml | 2 +- .../sales/order/create/totals/subtotal.phtml | 2 +- .../sales/order/create/totals/tax.phtml | 2 +- .../sales/order/creditmemo/create/form.phtml | 2 +- .../sales/order/creditmemo/create/items.phtml | 2 +- .../create/items/renderer/configurable.phtml | 5 +- .../create/items/renderer/default.phtml | 3 +- .../create/totals/adjustments.phtml | 2 +- .../sales/order/creditmemo/view/form.phtml | 2 +- .../sales/order/creditmemo/view/items.phtml | 2 +- .../view/items/renderer/configurable.phtml | 5 +- .../view/items/renderer/default.phtml | 3 +- .../adminhtml/sales/order/giftoptions.phtml | 2 +- .../sales/order/giftoptions_tooltip.js | 2 +- .../sales/order/invoice/create/form.phtml | 2 +- .../sales/order/invoice/create/items.phtml | 2 +- .../create/items/renderer/configurable.phtml | 3 +- .../create/items/renderer/default.phtml | 3 +- .../sales/order/invoice/create/tracking.phtml | 4 +- .../sales/order/invoice/view/form.phtml | 2 +- .../sales/order/invoice/view/items.phtml | 2 +- .../view/items/renderer/configurable.phtml | 6 +- .../invoice/view/items/renderer/default.phtml | 3 +- .../sales/order/shipment/create/form.phtml | 2 +- .../sales/order/shipment/create/items.phtml | 2 +- .../create/items/renderer/configurable.phtml | 2 +- .../create/items/renderer/default.phtml | 2 +- .../order/shipment/create/tracking.phtml | 2 +- .../sales/order/shipment/packaging.js | 15 +- .../sales/order/shipment/packaging/grid.phtml | 4 +- .../order/shipment/packaging/packed.phtml | 4 +- .../order/shipment/packaging/popup.phtml | 14 +- .../sales/order/shipment/tracking/info.phtml | 2 +- .../sales/order/shipment/view/form.phtml | 2 +- .../sales/order/shipment/view/items.phtml | 2 +- .../view/items/renderer/configurable.phtml | 2 +- .../view/items/renderer/default.phtml | 2 +- .../sales/order/shipment/view/tracking.phtml | 4 +- .../view/adminhtml/sales/order/totalbar.phtml | 2 +- .../view/adminhtml/sales/order/totals.phtml | 40 +- .../sales/order/totals/discount.phtml | 2 +- .../adminhtml/sales/order/totals/due.phtml | 2 +- .../adminhtml/sales/order/totals/footer.phtml | 2 +- .../adminhtml/sales/order/totals/grand.phtml | 2 +- .../adminhtml/sales/order/totals/item.phtml | 2 +- .../adminhtml/sales/order/totals/main.phtml | 2 +- .../adminhtml/sales/order/totals/paid.phtml | 2 +- .../sales/order/totals/refunded.phtml | 2 +- .../sales/order/totals/shipping.phtml | 2 +- .../adminhtml/sales/order/totals/tax.phtml | 2 +- .../adminhtml/sales/order/view/form.phtml | 2 +- .../sales/order/view/giftmessage.phtml | 2 +- .../adminhtml/sales/order/view/history.phtml | 2 +- .../adminhtml/sales/order/view/info.phtml | 2 +- .../adminhtml/sales/order/view/items.phtml | 2 +- .../order/view/items/renderer/default.phtml | 2 +- .../sales/order/view/tab/history.phtml | 2 +- .../adminhtml/sales/order/view/tab/info.phtml | 2 +- .../adminhtml/sales/order/view/tracking.phtml | 23 +- .../adminhtml/sales/transactions/detail.phtml | 2 +- .../view/adminhtml/store/switcher.phtml | 5 +- .../adminhtml/store/switcher/enhanced.phtml | 5 +- .../switcher/form/renderer/fieldset.phtml | 61 + .../view/adminhtml/system/autocomplete.phtml | 2 +- .../adminhtml/system/cache/additional.phtml | 6 +- .../view/adminhtml/system/cache/edit.phtml | 6 +- .../system/cache/notifications.phtml | 2 +- .../view/adminhtml/system/config/edit.phtml | 2 +- .../system/config/form/field/array.phtml | 10 +- .../view/adminhtml/system/config/js.phtml | 7 +- .../adminhtml/system/config/switcher.phtml | 3 +- .../system/storage/media/synchronize.phtml | 2 +- .../view/adminhtml/system/config/tabs.phtml | 2 +- .../system/convert/profile/process.phtml | 2 +- .../system/convert/profile/run.phtml | 2 +- .../system/convert/profile/upload.phtml | 2 +- .../system/convert/profile/wizard.phtml | 2 +- .../system/currency/rate/matrix.phtml | 2 +- .../system/currency/rate/services.phtml | 2 +- .../adminhtml/system/currency/rates.phtml | 2 +- .../view/adminhtml/system/design/edit.phtml | 2 +- .../view/adminhtml/system/design/index.phtml | 2 +- .../system/email/template/edit.phtml | 2 +- .../system/email/template/list.phtml | 2 +- .../system/email/template/preview.phtml | 2 +- .../view/adminhtml/system/info.phtml | 2 +- .../system/shipping/applicable_country.phtml | 2 +- .../view/adminhtml/system/shipping/ups.phtml | 223 +- .../view/adminhtml/system/variable/js.phtml | 2 +- .../Mage/Adminhtml/view/adminhtml/tag.xml | 38 +- .../view/adminhtml/tag/edit/container.phtml | 2 +- .../Adminhtml/view/adminhtml/tag/index.phtml | 2 +- .../view/adminhtml/tax/class/page/edit.phtml | 2 +- .../view/adminhtml/tax/importExport.phtml | 2 +- .../view/adminhtml/tax/rate/form.phtml | 2 +- .../view/adminhtml/tax/rate/title.phtml | 2 +- .../adminhtml/tax/toolbar/class/add.phtml | 4 +- .../adminhtml/tax/toolbar/class/save.phtml | 2 +- .../view/adminhtml/tax/toolbar/rate/add.phtml | 2 +- .../adminhtml/tax/toolbar/rate/save.phtml | 2 +- .../view/adminhtml/tax/toolbar/rule/add.phtml | 4 +- .../adminhtml/tax/toolbar/rule/save.phtml | 2 +- .../adminhtml/urlrewrite/categories.phtml | 2 +- .../view/adminhtml/urlrewrite/edit.phtml | 2 +- .../view/adminhtml/urlrewrite/selector.phtml | 2 +- .../Adminhtml/view/adminhtml/variables.js | 2 +- .../view/adminhtml/widget/accordion.phtml | 6 +- .../view/adminhtml/widget/breadcrumbs.phtml | 2 +- .../view/adminhtml/widget/form.phtml | 2 +- .../adminhtml/widget/form/container.phtml | 2 +- .../view/adminhtml/widget/form/element.phtml | 2 +- .../widget/form/element/gallery.phtml | 2 +- .../widget/form/renderer/element.phtml | 2 +- .../widget/form/renderer/fieldset.phtml | 2 +- .../form/renderer/fieldset/element.phtml | 2 +- .../view/adminhtml/widget/grid.phtml | 2 +- .../adminhtml/widget/grid/container.phtml | 2 +- .../adminhtml/widget/grid/massaction.phtml | 6 +- .../adminhtml/widget/grid/serializer.phtml | 2 +- .../view/adminhtml/widget/tabs.phtml | 2 +- .../view/adminhtml/widget/tabshoriz.phtml | 2 +- .../view/adminhtml/widget/tabsleft.phtml | 2 +- .../adminhtml/widget/view/container.phtml | 2 +- app/code/core/Mage/Api/Controller/Action.php | 2 +- app/code/core/Mage/Api/Exception.php | 2 +- app/code/core/Mage/Api/Helper/Data.php | 2 +- app/code/core/Mage/Api/Model/Acl.php | 2 +- app/code/core/Mage/Api/Model/Acl/Resource.php | 2 +- app/code/core/Mage/Api/Model/Acl/Role.php | 2 +- .../core/Mage/Api/Model/Acl/Role/Generic.php | 2 +- .../core/Mage/Api/Model/Acl/Role/Group.php | 2 +- .../core/Mage/Api/Model/Acl/Role/Registry.php | 2 +- .../core/Mage/Api/Model/Acl/Role/User.php | 2 +- app/code/core/Mage/Api/Model/Config.php | 2 +- .../core/Mage/Api/Model/Resource/Abstract.php | 2 +- app/code/core/Mage/Api/Model/Resource/Acl.php | 2 +- .../core/Mage/Api/Model/Resource/Acl/Role.php | 2 +- .../Model/Resource/Acl/Role/Collection.php | 2 +- .../Model/Resource/Permissions/Collection.php | 2 +- .../core/Mage/Api/Model/Resource/Role.php | 2 +- .../Api/Model/Resource/Role/Collection.php | 2 +- .../core/Mage/Api/Model/Resource/Roles.php | 2 +- .../Api/Model/Resource/Roles/Collection.php | 2 +- .../Model/Resource/Roles/User/Collection.php | 2 +- .../core/Mage/Api/Model/Resource/Rules.php | 2 +- .../Api/Model/Resource/Rules/Collection.php | 2 +- .../core/Mage/Api/Model/Resource/User.php | 2 +- .../Api/Model/Resource/User/Collection.php | 2 +- app/code/core/Mage/Api/Model/Role.php | 2 +- app/code/core/Mage/Api/Model/Roles.php | 2 +- app/code/core/Mage/Api/Model/Rules.php | 2 +- app/code/core/Mage/Api/Model/Server.php | 2 +- .../Api/Model/Server/Adapter/Interface.php | 2 +- .../Mage/Api/Model/Server/Adapter/Soap.php | 2 +- .../Mage/Api/Model/Server/Adapter/Xmlrpc.php | 2 +- .../core/Mage/Api/Model/Server/Handler.php | 2 +- .../Api/Model/Server/Handler/Abstract.php | 2 +- .../Mage/Api/Model/Server/V2/Adapter/Soap.php | 2 +- .../core/Mage/Api/Model/Server/V2/Handler.php | 2 +- .../Api/Model/Server/Wsi/Adapter/Soap.php | 2 +- .../Mage/Api/Model/Server/Wsi/Handler.php | 2 +- app/code/core/Mage/Api/Model/Session.php | 2 +- app/code/core/Mage/Api/Model/User.php | 9 +- app/code/core/Mage/Api/Model/Wsdl/Config.php | 2 +- .../core/Mage/Api/Model/Wsdl/Config/Base.php | 2 +- .../Mage/Api/Model/Wsdl/Config/Element.php | 2 +- .../Mage/Api/controllers/IndexController.php | 2 +- .../Mage/Api/controllers/SoapController.php | 2 +- .../Api/controllers/V2/SoapController.php | 2 +- .../Mage/Api/controllers/XmlrpcController.php | 2 +- app/code/core/Mage/Api/etc/adminhtml.xml | 2 +- app/code/core/Mage/Api/etc/api.xml | 2 +- app/code/core/Mage/Api/etc/config.xml | 2 +- app/code/core/Mage/Api/etc/system.xml | 2 +- .../Api/sql/api_setup/install-1.6.0.0.php | 2 +- .../Authorizenet/Block/Directpost/Form.php | 2 +- .../Authorizenet/Block/Directpost/Iframe.php | 2 +- .../core/Mage/Authorizenet/Helper/Data.php | 2 +- .../Mage/Authorizenet/Model/Directpost.php | 2 +- .../Model/Directpost/Observer.php | 2 +- .../Authorizenet/Model/Directpost/Request.php | 2 +- .../Model/Directpost/Response.php | 2 +- .../Authorizenet/Model/Directpost/Session.php | 2 +- .../Directpost/PaymentController.php | 2 +- .../Directpost/PaymentController.php | 2 +- .../core/Mage/Authorizenet/etc/config.xml | 2 +- .../core/Mage/Authorizenet/etc/system.xml | 3 +- .../view/adminhtml/directpost/iframe.phtml | 2 +- .../view/adminhtml/directpost/info.phtml | 2 +- .../Authorizenet/view/adminhtml/layout.xml | 2 +- .../view/frontend/directpost/form.phtml | 2 +- .../view/frontend/directpost/iframe.phtml | 2 +- .../view/frontend/directpost/info.phtml | 2 +- .../Authorizenet/view/frontend/layout.xml | 2 +- app/code/core/Mage/Backup/Exception.php | 2 +- app/code/core/Mage/Backup/Helper/Data.php | 302 +- app/code/core/Mage/Backup/Model/Backup.php | 96 +- .../Mage/Backup/Model/Config/Backend/Cron.php | 89 + .../Mage/Backup/Model/Config/Source/Type.php | 52 + app/code/core/Mage/Backup/Model/Db.php | 6 +- .../core/Mage/Backup/Model/Fs/Collection.php | 12 +- app/code/core/Mage/Backup/Model/Observer.php | 95 + .../core/Mage/Backup/Model/Resource/Db.php | 43 +- .../Backup/Model/Resource/Helper/Mysql4.php | 53 +- app/code/core/Mage/Backup/etc/adminhtml.xml | 7 +- app/code/core/Mage/Backup/etc/config.xml | 11 +- app/code/core/Mage/Backup/etc/system.xml | 95 + .../Product/Composite/Fieldset/Bundle.php | 2 +- .../Fieldset/Options/Type/Checkbox.php | 2 +- .../Composite/Fieldset/Options/Type/Multi.php | 2 +- .../Composite/Fieldset/Options/Type/Radio.php | 2 +- .../Fieldset/Options/Type/Select.php | 2 +- .../Catalog/Product/Edit/Tab/Attributes.php | 11 +- .../Product/Edit/Tab/Attributes/Extend.php | 2 +- .../Product/Edit/Tab/Attributes/Special.php | 2 +- .../Catalog/Product/Edit/Tab/Bundle.php | 2 +- .../Product/Edit/Tab/Bundle/Option.php | 2 +- .../Product/Edit/Tab/Bundle/Option/Search.php | 2 +- .../Edit/Tab/Bundle/Option/Search/Grid.php | 2 +- .../Edit/Tab/Bundle/Option/Selection.php | 2 +- .../Adminhtml/Catalog/Product/Edit/Tabs.php | 2 +- .../Adminhtml/Sales/Order/Items/Renderer.php | 2 +- .../Sales/Order/View/Items/Renderer.php | 2 +- .../Bundle/Block/Catalog/Product/Price.php | 2 +- .../Bundle/Block/Catalog/Product/View.php | 2 +- .../Catalog/Product/View/Type/Bundle.php | 5 +- .../Product/View/Type/Bundle/Option.php | 7 +- .../View/Type/Bundle/Option/Checkbox.php | 2 +- .../Product/View/Type/Bundle/Option/Multi.php | 2 +- .../Product/View/Type/Bundle/Option/Radio.php | 2 +- .../View/Type/Bundle/Option/Select.php | 2 +- .../Block/Checkout/Cart/Item/Renderer.php | 2 +- .../Block/Sales/Order/Items/Renderer.php | 2 +- .../Helper/Catalog/Product/Configuration.php | 21 +- app/code/core/Mage/Bundle/Helper/Data.php | 2 +- app/code/core/Mage/Bundle/Model/Observer.php | 2 +- app/code/core/Mage/Bundle/Model/Option.php | 2 +- .../core/Mage/Bundle/Model/Price/Index.php | 2 +- .../Product/Attribute/Source/Price/View.php | 2 +- .../core/Mage/Bundle/Model/Product/Price.php | 207 +- .../core/Mage/Bundle/Model/Product/Type.php | 8 +- .../Mage/Bundle/Model/Resource/Bundle.php | 2 +- .../Bundle/Model/Resource/Indexer/Price.php | 173 +- .../Bundle/Model/Resource/Indexer/Stock.php | 2 +- .../Mage/Bundle/Model/Resource/Option.php | 2 +- .../Model/Resource/Option/Collection.php | 2 +- .../Bundle/Model/Resource/Price/Index.php | 2 +- .../Mage/Bundle/Model/Resource/Selection.php | 2 +- .../Model/Resource/Selection/Collection.php | 2 +- .../Model/Sales/Order/Pdf/Items/Abstract.php | 2 +- .../Sales/Order/Pdf/Items/Creditmemo.php | 2 +- .../Model/Sales/Order/Pdf/Items/Invoice.php | 2 +- .../Model/Sales/Order/Pdf/Items/Shipment.php | 2 +- app/code/core/Mage/Bundle/Model/Selection.php | 2 +- .../Source/Option/Selection/Price/Type.php | 2 +- .../Mage/Bundle/Model/Source/Option/Type.php | 2 +- .../Bundle/Product/EditController.php | 2 +- .../Adminhtml/Bundle/SelectionController.php | 2 +- .../bundle_setup/data-install-1.6.0.0.php | 2 +- app/code/core/Mage/Bundle/etc/config.xml | 4 +- app/code/core/Mage/Bundle/etc/fieldset.xml | 2 +- .../sql/bundle_setup/install-1.6.0.0.php | 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 + .../Mage/Bundle/view/adminhtml/layout.xml | 2 +- .../composite/fieldset/options/bundle.phtml | 2 +- .../fieldset/options/type/checkbox.phtml | 2 +- .../fieldset/options/type/multi.phtml | 2 +- .../fieldset/options/type/radio.phtml | 2 +- .../fieldset/options/type/select.phtml | 2 +- .../view/adminhtml/product/edit/bundle.phtml | 2 +- .../product/edit/bundle/option.phtml | 2 +- .../product/edit/bundle/option/search.phtml | 2 +- .../edit/bundle/option/selection.phtml | 2 +- .../creditmemo/create/items/renderer.phtml | 2 +- .../creditmemo/view/items/renderer.phtml | 2 +- .../sales/invoice/create/items/renderer.phtml | 2 +- .../sales/invoice/view/items/renderer.phtml | 2 +- .../sales/order/view/items/renderer.phtml | 2 +- .../shipment/create/items/renderer.phtml | 2 +- .../sales/shipment/view/items/renderer.phtml | 2 +- .../core/Mage/Bundle/view/frontend/bundle.js | 2 +- .../view/frontend/catalog/product/price.phtml | 15 +- .../catalog/product/view/options/notice.phtml | 2 +- .../frontend/catalog/product/view/price.phtml | 2 +- .../catalog/product/view/tierprices.phtml | 2 +- .../catalog/product/view/type/bundle.phtml | 2 +- .../view/type/bundle/option/checkbox.phtml | 2 +- .../view/type/bundle/option/multi.phtml | 2 +- .../view/type/bundle/option/radio.phtml | 2 +- .../view/type/bundle/option/select.phtml | 2 +- .../product/view/type/bundle/options.phtml | 2 +- .../order/items/creditmemo/default.phtml | 2 +- .../email/order/items/invoice/default.phtml | 2 +- .../email/order/items/order/default.phtml | 2 +- .../email/order/items/shipment/default.phtml | 2 +- .../core/Mage/Bundle/view/frontend/layout.xml | 2 +- .../frontend/rss/catalog/product/price.phtml | 2 +- .../order/creditmemo/items/renderer.phtml | 2 +- .../sales/order/invoice/items/renderer.phtml | 2 +- .../frontend/sales/order/items/renderer.phtml | 2 +- .../sales/order/shipment/items/renderer.phtml | 2 +- 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 + .../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 | 292 + .../core/Mage/Captcha/Model/Resource/Log.php | 156 + app/code/core/Mage/Captcha/Model/Zend.php | 504 ++ .../Adminhtml/RefreshController.php | 50 + .../Captcha/controllers/RefreshController.php | 50 + app/code/core/Mage/Captcha/etc/config.xml | 250 + app/code/core/Mage/Captcha/etc/system.xml | 250 + .../sql/captcha_setup/install-1.7.0.0.0.php | 52 + .../Mage/Captcha/view/adminhtml/layout.xml | 47 + .../Mage/Captcha/view/adminhtml/reload.png | Bin 0 -> 1538 bytes .../Mage/Captcha/view/adminhtml/zend.phtml | 57 + .../Mage/Captcha/view/frontend/layout.xml | 105 + .../Mage/Captcha/view/frontend/reload.png | Bin 0 -> 1538 bytes .../Mage/Captcha/view/frontend/zend.phtml | 52 + .../core/Mage/Catalog/Block/Breadcrumbs.php | 2 +- .../core/Mage/Catalog/Block/Category/View.php | 2 +- .../Catalog/Block/Category/Widget/Link.php | 2 +- .../Catalog/Block/Layer/Filter/Abstract.php | 2 +- .../Catalog/Block/Layer/Filter/Attribute.php | 2 +- .../Catalog/Block/Layer/Filter/Category.php | 2 +- .../Catalog/Block/Layer/Filter/Decimal.php | 2 +- .../Mage/Catalog/Block/Layer/Filter/Price.php | 2 +- .../core/Mage/Catalog/Block/Layer/State.php | 2 +- .../core/Mage/Catalog/Block/Layer/View.php | 12 +- .../core/Mage/Catalog/Block/Navigation.php | 2 +- app/code/core/Mage/Catalog/Block/Product.php | 2 +- .../Mage/Catalog/Block/Product/Abstract.php | 17 +- .../Block/Product/Compare/Abstract.php | 2 +- .../Catalog/Block/Product/Compare/List.php | 2 +- .../Catalog/Block/Product/Compare/Sidebar.php | 2 +- .../Mage/Catalog/Block/Product/Gallery.php | 2 +- .../core/Mage/Catalog/Block/Product/List.php | 2 +- .../Catalog/Block/Product/List/Crosssell.php | 2 +- .../Catalog/Block/Product/List/Promotion.php | 2 +- .../Catalog/Block/Product/List/Random.php | 2 +- .../Catalog/Block/Product/List/Related.php | 2 +- .../Catalog/Block/Product/List/Toolbar.php | 2 +- .../Catalog/Block/Product/List/Upsell.php | 2 +- .../core/Mage/Catalog/Block/Product/New.php | 15 +- .../core/Mage/Catalog/Block/Product/Price.php | 19 +- .../Catalog/Block/Product/Price/Template.php | 2 +- .../core/Mage/Catalog/Block/Product/Send.php | 2 +- .../core/Mage/Catalog/Block/Product/View.php | 6 +- .../Catalog/Block/Product/View/Abstract.php | 2 +- .../Catalog/Block/Product/View/Additional.php | 2 +- .../Catalog/Block/Product/View/Attributes.php | 2 +- .../Block/Product/View/Description.php | 2 +- .../Mage/Catalog/Block/Product/View/Media.php | 2 +- .../Catalog/Block/Product/View/Options.php | 30 +- .../Block/Product/View/Options/Abstract.php | 6 +- .../Block/Product/View/Options/Type/Date.php | 2 +- .../Product/View/Options/Type/Default.php | 2 +- .../Block/Product/View/Options/Type/File.php | 2 +- .../Product/View/Options/Type/Select.php | 37 +- .../Block/Product/View/Options/Type/Text.php | 2 +- .../Mage/Catalog/Block/Product/View/Price.php | 2 +- .../Mage/Catalog/Block/Product/View/Tabs.php | 2 +- .../Block/Product/View/Type/Configurable.php | 111 +- .../Block/Product/View/Type/Grouped.php | 2 +- .../Block/Product/View/Type/Simple.php | 2 +- .../Block/Product/View/Type/Virtual.php | 2 +- .../Catalog/Block/Product/Widget/Link.php | 2 +- .../Mage/Catalog/Block/Product/Widget/New.php | 2 +- .../Catalog/Block/Seo/Sitemap/Abstract.php | 2 +- .../Catalog/Block/Seo/Sitemap/Category.php | 2 +- .../Catalog/Block/Seo/Sitemap/Product.php | 2 +- .../Block/Seo/Sitemap/Tree/Category.php | 2 +- .../Catalog/Block/Seo/Sitemap/Tree/Pager.php | 2 +- .../core/Mage/Catalog/Block/Widget/Link.php | 2 +- .../Controller/Product/View/Interface.php | 2 +- app/code/core/Mage/Catalog/Exception.php | 2 +- .../core/Mage/Catalog/Helper/Category.php | 2 +- .../Mage/Catalog/Helper/Category/Flat.php | 2 +- app/code/core/Mage/Catalog/Helper/Data.php | 2 +- app/code/core/Mage/Catalog/Helper/Image.php | 201 +- app/code/core/Mage/Catalog/Helper/Map.php | 2 +- app/code/core/Mage/Catalog/Helper/Output.php | 2 +- app/code/core/Mage/Catalog/Helper/Product.php | 2 +- .../Mage/Catalog/Helper/Product/Compare.php | 2 +- .../Catalog/Helper/Product/Configuration.php | 2 +- .../Product/Configuration/Interface.php | 2 +- .../core/Mage/Catalog/Helper/Product/Flat.php | 2 +- .../Mage/Catalog/Helper/Product/Options.php | 2 +- .../core/Mage/Catalog/Helper/Product/Url.php | 2 +- .../core/Mage/Catalog/Helper/Product/View.php | 2 +- app/code/core/Mage/Catalog/Model/Abstract.php | 2 +- .../core/Mage/Catalog/Model/Api/Resource.php | 2 +- .../Attribute/Backend/Customlayoutupdate.php | 2 +- app/code/core/Mage/Catalog/Model/Category.php | 2 +- .../core/Mage/Catalog/Model/Category/Api.php | 2 +- .../Mage/Catalog/Model/Category/Api/V2.php | 2 +- .../Catalog/Model/Category/Attribute/Api.php | 2 +- .../Model/Category/Attribute/Api/V2.php | 2 +- .../Category/Attribute/Backend/Image.php | 2 +- .../Category/Attribute/Backend/Sortby.php | 2 +- .../Category/Attribute/Backend/Urlkey.php | 2 +- .../Category/Attribute/Source/Layout.php | 2 +- .../Model/Category/Attribute/Source/Mode.php | 2 +- .../Model/Category/Attribute/Source/Page.php | 2 +- .../Category/Attribute/Source/Sortby.php | 2 +- .../Catalog/Model/Category/Indexer/Flat.php | 2 +- .../Model/Category/Indexer/Product.php | 2 +- app/code/core/Mage/Catalog/Model/Config.php | 2 +- app/code/core/Mage/Catalog/Model/Convert.php | 2 +- .../Catalog/Model/Convert/Adapter/Catalog.php | 2 +- .../Catalog/Model/Convert/Adapter/Product.php | 34 +- .../Catalog/Model/Convert/Parser/Product.php | 2 +- app/code/core/Mage/Catalog/Model/Design.php | 2 +- .../Mage/Catalog/Model/Entity/Attribute.php | 2 +- .../Attribute/Design/Options/Container.php | 2 +- app/code/core/Mage/Catalog/Model/Index.php | 2 +- .../core/Mage/Catalog/Model/Indexer/Url.php | 2 +- app/code/core/Mage/Catalog/Model/Layer.php | 2 +- .../Catalog/Model/Layer/Filter/Abstract.php | 12 +- .../Catalog/Model/Layer/Filter/Attribute.php | 6 +- .../Catalog/Model/Layer/Filter/Category.php | 2 +- .../Catalog/Model/Layer/Filter/Decimal.php | 2 +- .../Mage/Catalog/Model/Layer/Filter/Item.php | 23 +- .../Mage/Catalog/Model/Layer/Filter/Price.php | 159 +- .../Model/Layer/Filter/Price/Algorithm.php | 387 +- .../core/Mage/Catalog/Model/Layer/State.php | 2 +- app/code/core/Mage/Catalog/Model/Observer.php | 2 +- app/code/core/Mage/Catalog/Model/Product.php | 24 +- .../Mage/Catalog/Model/Product/Action.php | 2 +- .../core/Mage/Catalog/Model/Product/Api.php | 19 +- .../Mage/Catalog/Model/Product/Api/V2.php | 23 +- .../Catalog/Model/Product/Attribute/Api.php | 2 +- .../Model/Product/Attribute/Api/V2.php | 2 +- .../Product/Attribute/Backend/Boolean.php | 2 +- .../Product/Attribute/Backend/Groupprice.php | 57 + .../Attribute/Backend/Groupprice/Abstract.php | 369 ++ .../Model/Product/Attribute/Backend/Media.php | 7 +- .../Model/Product/Attribute/Backend/Msrp.php | 2 +- .../Model/Product/Attribute/Backend/Price.php | 2 +- .../Product/Attribute/Backend/Recurring.php | 2 +- .../Model/Product/Attribute/Backend/Sku.php | 2 +- .../Product/Attribute/Backend/Startdate.php | 2 +- .../Product/Attribute/Backend/Tierprice.php | 279 +- .../Product/Attribute/Backend/Urlkey.php | 2 +- .../Product/Attribute/Frontend/Image.php | 2 +- .../Catalog/Model/Product/Attribute/Group.php | 2 +- .../Model/Product/Attribute/Media/Api.php | 2 +- .../Model/Product/Attribute/Media/Api/V2.php | 2 +- .../Model/Product/Attribute/Set/Api.php | 2 +- .../Model/Product/Attribute/Set/Api/V2.php | 2 +- .../Product/Attribute/Source/Boolean.php | 2 +- .../Attribute/Source/Countryofmanufacture.php | 2 +- .../Product/Attribute/Source/Inputtype.php | 2 +- .../Model/Product/Attribute/Source/Layout.php | 2 +- .../Product/Attribute/Source/Msrp/Type.php | 2 +- .../Attribute/Source/Msrp/Type/Enabled.php | 2 +- .../Attribute/Source/Msrp/Type/Price.php | 2 +- .../Model/Product/Attribute/Tierprice/Api.php | 2 +- .../Product/Attribute/Tierprice/Api/V2.php | 2 +- .../Catalog/Model/Product/Compare/Item.php | 2 +- .../Catalog/Model/Product/Compare/List.php | 2 +- .../Mage/Catalog/Model/Product/Condition.php | 2 +- .../Model/Product/Condition/Interface.php | 2 +- .../Product/Configuration/Item/Interface.php | 2 +- .../Product/Configuration/Item/Option.php | 2 +- .../Configuration/Item/Option/Interface.php | 2 +- .../Mage/Catalog/Model/Product/Flat/Flag.php | 2 +- .../Catalog/Model/Product/Flat/Indexer.php | 12 +- .../Catalog/Model/Product/Flat/Observer.php | 2 +- .../core/Mage/Catalog/Model/Product/Image.php | 2 +- .../Catalog/Model/Product/Indexer/Eav.php | 2 +- .../Catalog/Model/Product/Indexer/Flat.php | 23 +- .../Catalog/Model/Product/Indexer/Price.php | 2 +- .../core/Mage/Catalog/Model/Product/Link.php | 2 +- .../Mage/Catalog/Model/Product/Link/Api.php | 2 +- .../Catalog/Model/Product/Link/Api/V2.php | 2 +- .../Catalog/Model/Product/Media/Config.php | 2 +- .../Mage/Catalog/Model/Product/Option.php | 2 +- .../Mage/Catalog/Model/Product/Option/Api.php | 2 +- .../Catalog/Model/Product/Option/Api/V2.php | 2 +- .../Catalog/Model/Product/Option/Observer.php | 2 +- .../Model/Product/Option/Type/Date.php | 2 +- .../Model/Product/Option/Type/Default.php | 2 +- .../Model/Product/Option/Type/File.php | 18 +- .../Model/Product/Option/Type/Select.php | 2 +- .../Model/Product/Option/Type/Text.php | 2 +- .../Catalog/Model/Product/Option/Value.php | 2 +- .../Model/Product/Option/Value/Api.php | 2 +- .../Model/Product/Option/Value/Api/V2.php | 2 +- .../Mage/Catalog/Model/Product/Status.php | 2 +- .../core/Mage/Catalog/Model/Product/Type.php | 2 +- .../Catalog/Model/Product/Type/Abstract.php | 2 +- .../Mage/Catalog/Model/Product/Type/Api.php | 2 +- .../Catalog/Model/Product/Type/Api/V2.php | 2 +- .../Model/Product/Type/Configurable.php | 20 +- .../Product/Type/Configurable/Attribute.php | 2 +- .../Model/Product/Type/Configurable/Price.php | 43 +- .../Catalog/Model/Product/Type/Grouped.php | 2 +- .../Model/Product/Type/Grouped/Price.php | 2 +- .../Mage/Catalog/Model/Product/Type/Price.php | 128 +- .../Catalog/Model/Product/Type/Simple.php | 2 +- .../Catalog/Model/Product/Type/Virtual.php | 2 +- .../core/Mage/Catalog/Model/Product/Url.php | 2 +- .../Mage/Catalog/Model/Product/Visibility.php | 2 +- .../Mage/Catalog/Model/Product/Website.php | 2 +- .../Mage/Catalog/Model/Resource/Abstract.php | 4 +- .../Mage/Catalog/Model/Resource/Attribute.php | 2 +- .../Mage/Catalog/Model/Resource/Category.php | 2 +- .../Category/Attribute/Collection.php | 2 +- .../Category/Attribute/Frontend/Image.php | 2 +- .../Category/Attribute/Source/Layout.php | 2 +- .../Category/Attribute/Source/Mode.php | 2 +- .../Category/Attribute/Source/Page.php | 2 +- .../Model/Resource/Category/Collection.php | 2 +- .../Catalog/Model/Resource/Category/Flat.php | 2 +- .../Resource/Category/Flat/Collection.php | 2 +- .../Resource/Category/Indexer/Product.php | 2 +- .../Catalog/Model/Resource/Category/Tree.php | 2 +- .../Model/Resource/Collection/Abstract.php | 2 +- .../Mage/Catalog/Model/Resource/Config.php | 2 +- .../Catalog/Model/Resource/Eav/Attribute.php | 2 +- .../Catalog/Model/Resource/Helper/Mysql4.php | 2 +- .../Model/Resource/Layer/Filter/Attribute.php | 2 +- .../Model/Resource/Layer/Filter/Decimal.php | 7 +- .../Model/Resource/Layer/Filter/Price.php | 16 +- .../Mage/Catalog/Model/Resource/Product.php | 13 +- .../Catalog/Model/Resource/Product/Action.php | 2 +- .../Product/Attribute/Backend/Groupprice.php | 46 + .../Attribute/Backend/Groupprice/Abstract.php | 147 + .../Product/Attribute/Backend/Image.php | 2 +- .../Product/Attribute/Backend/Media.php | 2 +- .../Product/Attribute/Backend/Tierprice.php | 92 +- .../Product/Attribute/Backend/Urlkey.php | 2 +- .../Resource/Product/Attribute/Collection.php | 13 +- .../Model/Resource/Product/Collection.php | 24 +- .../Model/Resource/Product/Compare/Item.php | 2 +- .../Product/Compare/Item/Collection.php | 2 +- .../Catalog/Model/Resource/Product/Flat.php | 2 +- .../Model/Resource/Product/Flat/Indexer.php | 2630 +++++---- .../Resource/Product/Indexer/Abstract.php | 2 +- .../Model/Resource/Product/Indexer/Eav.php | 2 +- .../Resource/Product/Indexer/Eav/Abstract.php | 2 +- .../Resource/Product/Indexer/Eav/Decimal.php | 2 +- .../Resource/Product/Indexer/Eav/Source.php | 12 +- .../Model/Resource/Product/Indexer/Price.php | 59 +- .../Product/Indexer/Price/Configurable.php | 33 +- .../Product/Indexer/Price/Default.php | 75 +- .../Product/Indexer/Price/Grouped.php | 15 +- .../Product/Indexer/Price/Interface.php | 2 +- .../Catalog/Model/Resource/Product/Link.php | 2 +- .../Resource/Product/Link/Collection.php | 2 +- .../Product/Link/Product/Collection.php | 2 +- .../Catalog/Model/Resource/Product/Option.php | 2 +- .../Resource/Product/Option/Collection.php | 2 +- .../Model/Resource/Product/Option/Value.php | 2 +- .../Product/Option/Value/Collection.php | 2 +- .../Model/Resource/Product/Relation.php | 2 +- .../Catalog/Model/Resource/Product/Status.php | 2 +- .../Resource/Product/Type/Configurable.php | 2 +- .../Product/Type/Configurable/Attribute.php | 2 +- .../Configurable/Attribute/Collection.php | 2 +- .../Type/Configurable/Product/Collection.php | 2 +- .../Model/Resource/Product/Website.php | 2 +- .../Mage/Catalog/Model/Resource/Setup.php | 15 +- .../core/Mage/Catalog/Model/Resource/Url.php | 62 +- app/code/core/Mage/Catalog/Model/Session.php | 2 +- .../Config/Backend/Catalog/Category/Flat.php | 2 +- .../Config/Backend/Catalog/Product/Flat.php | 2 +- .../Backend/Catalog/Url/Rewrite/Suffix.php | 2 +- .../Mage/Catalog/Model/Template/Filter.php | 2 +- app/code/core/Mage/Catalog/Model/Url.php | 38 +- .../controllers/CategoryController.php | 2 +- .../Catalog/controllers/IndexController.php | 2 +- .../controllers/Product/CompareController.php | 2 +- .../Catalog/controllers/ProductController.php | 2 +- .../controllers/Seo/SitemapController.php | 2 +- .../catalog_setup/data-install-1.6.0.0.php | 2 +- .../data-upgrade-1.6.0.0.4-1.6.0.0.5.php | 2 +- .../data-upgrade-1.6.0.0.8-1.6.0.0.9.php | 36 + app/code/core/Mage/Catalog/etc/adminhtml.xml | 2 +- app/code/core/Mage/Catalog/etc/api.xml | 2 +- app/code/core/Mage/Catalog/etc/config.xml | 7 +- app/code/core/Mage/Catalog/etc/convert.xml | 32 +- app/code/core/Mage/Catalog/etc/fieldset.xml | 2 +- app/code/core/Mage/Catalog/etc/system.xml | 40 +- app/code/core/Mage/Catalog/etc/view.xml | 2 +- app/code/core/Mage/Catalog/etc/widget.xml | 2 +- .../sql/catalog_setup/install-1.6.0.0.php | 2 +- .../mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php | 53 + .../upgrade-1.6.0.0-1.6.0.0.1.php | 2 +- .../upgrade-1.6.0.0.1-1.6.0.0.2.php | 2 +- .../upgrade-1.6.0.0.10-1.6.0.0.11.php | 31 + .../upgrade-1.6.0.0.2-1.6.0.0.3.php | 2 +- .../upgrade-1.6.0.0.3-1.6.0.0.4.php | 2 +- .../upgrade-1.6.0.0.4-1.6.0.0.5.php | 2 +- .../upgrade-1.6.0.0.5-1.6.0.0.6.php | 2 +- .../upgrade-1.6.0.0.6-1.6.0.0.7.php | 2 +- .../upgrade-1.6.0.0.7-1.6.0.0.8.php | 2 +- .../upgrade-1.6.0.0.9-1.6.0.0.10.php | 214 + .../Catalog/view/frontend/category/view.phtml | 2 +- .../category/widget/link/link_block.phtml | 2 +- .../category/widget/link/link_inline.phtml | 2 +- .../Catalog/view/frontend/layer/filter.phtml | 2 +- .../Catalog/view/frontend/layer/state.phtml | 9 +- .../Catalog/view/frontend/layer/view.phtml | 5 +- .../Mage/Catalog/view/frontend/layout.xml | 2 +- .../core/Mage/Catalog/view/frontend/msrp.js | 2 +- .../core/Mage/Catalog/view/frontend/msrp.xml | 2 +- .../Catalog/view/frontend/msrp/popup.phtml | 2 +- .../view/frontend/navigation/left.phtml | 2 +- .../view/frontend/navigation/top.phtml | 2 +- .../view/frontend/product/compare/list.phtml | 6 +- .../frontend/product/compare/sidebar.phtml | 2 +- .../view/frontend/product/gallery.phtml | 2 +- .../Catalog/view/frontend/product/list.phtml | 2 +- .../view/frontend/product/list/related.phtml | 2 +- .../view/frontend/product/list/toolbar.phtml | 2 +- .../view/frontend/product/list/upsell.phtml | 2 +- .../Catalog/view/frontend/product/new.phtml | 2 +- .../Catalog/view/frontend/product/price.phtml | 21 +- .../view/frontend/product/price_msrp.phtml | 2 +- .../frontend/product/price_msrp_item.phtml | 2 +- .../frontend/product/price_msrp_noform.phtml | 2 +- .../frontend/product/price_msrp_rss.phtml | 2 +- .../Catalog/view/frontend/product/view.phtml | 2 +- .../frontend/product/view/additional.phtml | 2 +- .../view/frontend/product/view/addto.phtml | 2 +- .../frontend/product/view/addtocart.phtml | 2 +- .../frontend/product/view/attributes.phtml | 2 +- .../frontend/product/view/description.phtml | 2 +- .../view/frontend/product/view/media.phtml | 2 +- .../view/frontend/product/view/options.phtml | 60 +- .../frontend/product/view/options/js.phtml | 2 +- .../product/view/options/type/date.phtml | 2 +- .../product/view/options/type/default.phtml | 2 +- .../product/view/options/type/file.phtml | 2 +- .../product/view/options/type/select.phtml | 2 +- .../product/view/options/type/text.phtml | 2 +- .../product/view/options/wrapper.phtml | 2 +- .../product/view/options/wrapper/bottom.phtml | 2 +- .../frontend/product/view/price_clone.phtml | 2 +- .../frontend/product/view/tierprices.phtml | 2 +- .../frontend/product/view/type/default.phtml | 2 +- .../frontend/product/view/type/grouped.phtml | 2 +- .../view/type/options/configurable.phtml | 2 +- .../product/widget/link/link_block.phtml | 2 +- .../product/widget/link/link_inline.phtml | 2 +- .../widget/new/column/new_default_list.phtml | 2 +- .../widget/new/column/new_images_list.phtml | 2 +- .../widget/new/column/new_names_list.phtml | 2 +- .../product/widget/new/content/new_grid.phtml | 2 +- .../product/widget/new/content/new_list.phtml | 2 +- .../view/frontend/rss/product/price.phtml | 2 +- .../Catalog/view/frontend/seo/sitemap.phtml | 4 +- .../view/frontend/seo/sitemap/container.phtml | 2 +- .../Mage/Catalog/view/frontend/seo/tree.phtml | 2 +- .../Mage/Catalog/view/frontend/widgets.css | 2 +- .../Adminhtml/Form/Field/Customergroup.php | 2 +- .../Block/Adminhtml/Form/Field/Minsaleqty.php | 2 +- .../CatalogInventory/Block/Qtyincrements.php | 2 +- .../Block/Stockqty/Abstract.php | 2 +- .../Block/Stockqty/Composite.php | 2 +- .../Block/Stockqty/Default.php | 2 +- .../Block/Stockqty/Type/Configurable.php | 2 +- .../Block/Stockqty/Type/Grouped.php | 2 +- .../Mage/CatalogInventory/Helper/Data.php | 2 +- .../CatalogInventory/Helper/Minsaleqty.php | 2 +- .../CatalogInventory/Model/Indexer/Stock.php | 2 +- .../Mage/CatalogInventory/Model/Observer.php | 2 +- .../Model/Resource/Indexer/Stock.php | 2 +- .../Resource/Indexer/Stock/Configurable.php | 2 +- .../Model/Resource/Indexer/Stock/Default.php | 2 +- .../Model/Resource/Indexer/Stock/Grouped.php | 2 +- .../Resource/Indexer/Stock/Interface.php | 2 +- .../CatalogInventory/Model/Resource/Stock.php | 2 +- .../Model/Resource/Stock/Item.php | 2 +- .../Model/Resource/Stock/Item/Collection.php | 2 +- .../Model/Resource/Stock/Status.php | 2 +- .../Model/Source/Backorders.php | 2 +- .../CatalogInventory/Model/Source/Stock.php | 2 +- .../Mage/CatalogInventory/Model/Stock.php | 2 +- .../CatalogInventory/Model/Stock/Item.php | 125 +- .../CatalogInventory/Model/Stock/Item/Api.php | 2 +- .../Model/Stock/Item/Api/V2.php | 2 +- .../CatalogInventory/Model/Stock/Status.php | 2 +- .../Model/System/Config/Backend/Minqty.php | 2 +- .../System/Config/Backend/Minsaleqty.php | 2 +- .../System/Config/Backend/Qtyincrements.php | 2 +- .../Mage/CatalogInventory/etc/adminhtml.xml | 2 +- .../core/Mage/CatalogInventory/etc/api.xml | 2 +- .../core/Mage/CatalogInventory/etc/config.xml | 14 +- .../core/Mage/CatalogInventory/etc/system.xml | 2 +- .../install-1.6.0.0.php | 2 +- .../mysql4-upgrade-1.6.0.0-1.6.0.0.1.php | 34 + .../CatalogInventory/view/frontend/layout.xml | 2 +- .../view/frontend/qtyincrements.phtml | 2 +- .../view/frontend/stockqty/composite.phtml | 2 +- .../view/frontend/stockqty/default.phtml | 2 +- .../core/Mage/CatalogRule/Helper/Data.php | 2 +- .../core/Mage/CatalogRule/Model/Observer.php | 36 +- .../Mage/CatalogRule/Model/Resource/Rule.php | 207 +- .../Model/Resource/Rule/Collection.php | 46 +- .../Model/Resource/Rule/Product/Price.php | 2 +- .../Rule/Product/Price/Collection.php | 2 +- app/code/core/Mage/CatalogRule/Model/Rule.php | 223 +- .../Model/Rule/Action/Collection.php | 2 +- .../CatalogRule/Model/Rule/Action/Product.php | 2 +- .../Model/Rule/Condition/Combine.php | 6 +- .../Model/Rule/Condition/Product.php | 483 +- .../CatalogRule/Model/Rule/Product/Price.php | 2 +- .../core/Mage/CatalogRule/etc/adminhtml.xml | 2 +- app/code/core/Mage/CatalogRule/etc/config.xml | 4 +- .../sql/catalogrule_setup/install-1.6.0.0.php | 2 +- .../upgrade-1.6.0.0-1.6.0.1.php | 2 +- .../upgrade-1.6.0.1-1.6.0.2.php | 163 + .../CatalogSearch/Block/Advanced/Form.php | 49 +- .../CatalogSearch/Block/Advanced/Result.php | 2 +- .../Mage/CatalogSearch/Block/Autocomplete.php | 2 +- .../core/Mage/CatalogSearch/Block/Layer.php | 2 +- .../Block/Layer/Filter/Attribute.php | 2 +- .../core/Mage/CatalogSearch/Block/Result.php | 2 +- .../core/Mage/CatalogSearch/Block/Term.php | 2 +- .../core/Mage/CatalogSearch/Helper/Data.php | 22 +- .../Mage/CatalogSearch/Model/Advanced.php | 2 +- .../Mage/CatalogSearch/Model/Fulltext.php | 32 +- .../CatalogSearch/Model/Fulltext/Observer.php | 2 +- .../CatalogSearch/Model/Indexer/Fulltext.php | 2 +- .../core/Mage/CatalogSearch/Model/Layer.php | 2 +- .../Model/Layer/Filter/Attribute.php | 2 +- .../core/Mage/CatalogSearch/Model/Query.php | 2 +- .../CatalogSearch/Model/Resource/Advanced.php | 2 +- .../Model/Resource/Advanced/Collection.php | 2 +- .../CatalogSearch/Model/Resource/Fulltext.php | 230 +- .../Model/Resource/Fulltext/Collection.php | 2 +- .../Model/Resource/Fulltext/Engine.php | 15 +- .../Model/Resource/Helper/Mysql4.php | 2 +- .../Model/Resource/Indexer/Fulltext.php | 2 +- .../CatalogSearch/Model/Resource/Query.php | 2 +- .../Model/Resource/Query/Collection.php | 2 +- .../Model/Resource/Search/Collection.php | 2 +- .../core/Mage/CatalogSearch/Model/Session.php | 2 +- .../Model/System/Config/Backend/Sitemap.php | 2 +- .../controllers/AdvancedController.php | 2 +- .../controllers/AjaxController.php | 2 +- .../controllers/ResultController.php | 4 +- .../controllers/TermController.php | 2 +- .../core/Mage/CatalogSearch/etc/adminhtml.xml | 2 +- .../core/Mage/CatalogSearch/etc/config.xml | 2 +- .../core/Mage/CatalogSearch/etc/system.xml | 2 +- .../catalogsearch_setup/install-1.6.0.0.php | 2 +- .../view/frontend/advanced/form.phtml | 13 +- .../view/frontend/advanced/result.phtml | 2 +- .../view/frontend/form.mini.phtml | 2 +- .../CatalogSearch/view/frontend/layout.xml | 2 +- .../CatalogSearch/view/frontend/result.phtml | 2 +- .../CatalogSearch/view/frontend/term.phtml | 2 +- .../Centinel/Block/Adminhtml/Validation.php | 2 +- .../Block/Adminhtml/Validation/Form.php | 2 +- .../Mage/Centinel/Block/Authentication.php | 2 +- .../Block/Authentication/Complete.php | 2 +- .../Centinel/Block/Authentication/Start.php | 2 +- app/code/core/Mage/Centinel/Block/Logo.php | 2 +- app/code/core/Mage/Centinel/Helper/Data.php | 2 +- app/code/core/Mage/Centinel/Model/Api.php | 2 +- app/code/core/Mage/Centinel/Model/Config.php | 2 +- .../core/Mage/Centinel/Model/Observer.php | 2 +- app/code/core/Mage/Centinel/Model/Service.php | 2 +- app/code/core/Mage/Centinel/Model/Session.php | 2 +- .../core/Mage/Centinel/Model/State/Jcb.php | 2 +- .../Mage/Centinel/Model/State/Mastercard.php | 2 +- .../core/Mage/Centinel/Model/State/Visa.php | 2 +- .../Mage/Centinel/Model/StateAbstract.php | 2 +- .../Adminhtml/Centinel/IndexController.php | 2 +- .../Centinel/controllers/IndexController.php | 2 +- app/code/core/Mage/Centinel/etc/config.xml | 2 +- app/code/core/Mage/Centinel/etc/system.xml | 2 +- .../adminhtml/authentication/complete.phtml | 2 +- .../view/adminhtml/authentication/start.phtml | 2 +- .../Mage/Centinel/view/adminhtml/layout.xml | 2 +- .../Centinel/view/adminhtml/order_create.js | 2 +- .../view/adminhtml/validation/form.phtml | 4 +- .../view/frontend/authentication.phtml | 2 +- .../frontend/authentication/complete.phtml | 2 +- .../view/frontend/authentication/start.phtml | 2 +- .../Mage/Centinel/view/frontend/checkout.js | 2 +- .../Mage/Centinel/view/frontend/layout.xml | 2 +- .../Mage/Centinel/view/frontend/logo.phtml | 2 +- .../core/Mage/Checkout/Block/Agreements.php | 2 +- app/code/core/Mage/Checkout/Block/Cart.php | 2 +- .../Mage/Checkout/Block/Cart/Abstract.php | 2 +- .../core/Mage/Checkout/Block/Cart/Coupon.php | 2 +- .../Mage/Checkout/Block/Cart/Crosssell.php | 2 +- .../Checkout/Block/Cart/Item/Configure.php | 2 +- .../Checkout/Block/Cart/Item/Renderer.php | 13 +- .../Block/Cart/Item/Renderer/Configurable.php | 2 +- .../Block/Cart/Item/Renderer/Grouped.php | 2 +- .../Mage/Checkout/Block/Cart/Shipping.php | 90 +- .../core/Mage/Checkout/Block/Cart/Sidebar.php | 2 +- .../core/Mage/Checkout/Block/Cart/Totals.php | 2 +- app/code/core/Mage/Checkout/Block/Links.php | 2 +- .../Checkout/Block/Multishipping/Abstract.php | 2 +- .../Block/Multishipping/Address/Select.php | 2 +- .../Block/Multishipping/Addresses.php | 2 +- .../Checkout/Block/Multishipping/Billing.php | 2 +- .../Block/Multishipping/Billing/Items.php | 2 +- .../Checkout/Block/Multishipping/Link.php | 2 +- .../Checkout/Block/Multishipping/Overview.php | 2 +- .../Block/Multishipping/Payment/Info.php | 2 +- .../Checkout/Block/Multishipping/Shipping.php | 2 +- .../Checkout/Block/Multishipping/State.php | 2 +- .../Checkout/Block/Multishipping/Success.php | 2 +- app/code/core/Mage/Checkout/Block/Onepage.php | 15 +- .../Mage/Checkout/Block/Onepage/Abstract.php | 13 +- .../Mage/Checkout/Block/Onepage/Billing.php | 2 +- .../Mage/Checkout/Block/Onepage/Failure.php | 2 +- .../core/Mage/Checkout/Block/Onepage/Link.php | 2 +- .../Mage/Checkout/Block/Onepage/Login.php | 2 +- .../Mage/Checkout/Block/Onepage/Payment.php | 2 +- .../Checkout/Block/Onepage/Payment/Info.php | 2 +- .../Block/Onepage/Payment/Methods.php | 2 +- .../Mage/Checkout/Block/Onepage/Progress.php | 26 +- .../Mage/Checkout/Block/Onepage/Review.php | 2 +- .../Checkout/Block/Onepage/Review/Info.php | 2 +- .../Mage/Checkout/Block/Onepage/Shipping.php | 2 +- .../Block/Onepage/Shipping/Method.php | 2 +- .../Onepage/Shipping/Method/Additional.php | 2 +- .../Onepage/Shipping/Method/Available.php | 2 +- .../Mage/Checkout/Block/Onepage/Success.php | 2 +- app/code/core/Mage/Checkout/Block/Success.php | 2 +- .../Mage/Checkout/Block/Total/Default.php | 2 +- .../Mage/Checkout/Block/Total/Nominal.php | 2 +- .../core/Mage/Checkout/Block/Total/Tax.php | 2 +- .../core/Mage/Checkout/Controller/Action.php | 2 +- app/code/core/Mage/Checkout/Exception.php | 2 +- app/code/core/Mage/Checkout/Helper/Cart.php | 2 +- app/code/core/Mage/Checkout/Helper/Data.php | 2 +- app/code/core/Mage/Checkout/Helper/Url.php | 2 +- .../core/Mage/Checkout/Model/Agreement.php | 2 +- .../core/Mage/Checkout/Model/Api/Resource.php | 2 +- .../Checkout/Model/Api/Resource/Customer.php | 2 +- .../Checkout/Model/Api/Resource/Product.php | 2 +- app/code/core/Mage/Checkout/Model/Cart.php | 38 +- .../core/Mage/Checkout/Model/Cart/Api.php | 2 +- .../core/Mage/Checkout/Model/Cart/Api/V2.php | 2 +- .../Mage/Checkout/Model/Cart/Coupon/Api.php | 2 +- .../Checkout/Model/Cart/Coupon/Api/V2.php | 2 +- .../Mage/Checkout/Model/Cart/Customer/Api.php | 2 +- .../Checkout/Model/Cart/Customer/Api/V2.php | 2 +- .../Mage/Checkout/Model/Cart/Interface.php | 69 + .../Mage/Checkout/Model/Cart/Payment/Api.php | 2 +- .../Checkout/Model/Cart/Payment/Api/V2.php | 2 +- .../Mage/Checkout/Model/Cart/Product/Api.php | 2 +- .../Checkout/Model/Cart/Product/Api/V2.php | 2 +- .../Mage/Checkout/Model/Cart/Shipping/Api.php | 2 +- .../Checkout/Model/Cart/Shipping/Api/V2.php | 2 +- .../Model/Config/Source/Cart/Summary.php | 2 +- .../core/Mage/Checkout/Model/Observer.php | 2 +- .../Checkout/Model/Resource/Agreement.php | 2 +- .../Model/Resource/Agreement/Collection.php | 2 +- .../Mage/Checkout/Model/Resource/Cart.php | 2 +- .../Mage/Checkout/Model/Resource/Setup.php | 2 +- app/code/core/Mage/Checkout/Model/Session.php | 20 +- .../Mage/Checkout/Model/Type/Abstract.php | 2 +- .../Checkout/Model/Type/Multishipping.php | 13 +- .../Model/Type/Multishipping/State.php | 2 +- .../core/Mage/Checkout/Model/Type/Onepage.php | 53 +- .../Checkout/controllers/CartController.php | 57 +- .../Checkout/controllers/IndexController.php | 2 +- .../Multishipping/AddressController.php | 4 +- .../controllers/MultishippingController.php | 2 +- .../controllers/OnepageController.php | 29 +- app/code/core/Mage/Checkout/etc/adminhtml.xml | 2 +- app/code/core/Mage/Checkout/etc/api.xml | 2 +- app/code/core/Mage/Checkout/etc/config.xml | 2 +- app/code/core/Mage/Checkout/etc/fieldset.xml | 2 +- app/code/core/Mage/Checkout/etc/system.xml | 2 +- .../core/Mage/Checkout/etc/translater.xml | 46 + .../sql/checkout_setup/install-1.6.0.0.php | 2 +- .../Mage/Checkout/view/frontend/cart.phtml | 5 +- .../Checkout/view/frontend/cart/coupon.phtml | 2 +- .../view/frontend/cart/crosssell.phtml | 2 +- .../cart/item/configure/updatecart.phtml | 2 +- .../view/frontend/cart/item/default.phtml | 5 +- .../Checkout/view/frontend/cart/noItems.phtml | 4 +- .../view/frontend/cart/shipping.phtml | 2 +- .../Checkout/view/frontend/cart/sidebar.phtml | 2 +- .../view/frontend/cart/sidebar/default.phtml | 2 +- .../Checkout/view/frontend/cart/totals.phtml | 2 +- .../Mage/Checkout/view/frontend/layout.xml | 2 +- .../multishipping/address/select.phtml | 2 +- .../frontend/multishipping/addresses.phtml | 2 +- .../frontend/multishipping/agreements.phtml | 2 +- .../view/frontend/multishipping/billing.phtml | 2 +- .../multishipping/billing/items.phtml | 2 +- .../frontend/multishipping/item/default.phtml | 2 +- .../view/frontend/multishipping/link.phtml | 2 +- .../frontend/multishipping/overview.phtml | 2 +- .../multishipping/overview/item.phtml | 2 +- .../view/frontend/multishipping/payment.js | 2 +- .../frontend/multishipping/shipping.phtml | 2 +- .../view/frontend/multishipping/state.phtml | 2 +- .../view/frontend/multishipping/success.phtml | 2 +- .../Mage/Checkout/view/frontend/onepage.phtml | 2 +- .../view/frontend/onepage/accordion.js | 2 +- .../view/frontend/onepage/agreements.phtml | 2 +- .../view/frontend/onepage/billing.phtml | 9 +- .../view/frontend/onepage/failure.phtml | 2 +- .../Checkout/view/frontend/onepage/link.phtml | 2 +- .../view/frontend/onepage/login.phtml | 3 +- .../view/frontend/onepage/payment.phtml | 2 +- .../frontend/onepage/payment/methods.phtml | 2 +- .../view/frontend/onepage/progress.phtml | 23 +- .../view/frontend/onepage/review.phtml | 2 +- .../view/frontend/onepage/review/button.phtml | 2 +- .../view/frontend/onepage/review/info.phtml | 2 +- .../view/frontend/onepage/review/item.phtml | 2 +- .../view/frontend/onepage/review/totals.phtml | 2 +- .../view/frontend/onepage/shipping.phtml | 8 +- .../frontend/onepage/shipping_method.phtml | 2 +- .../onepage/shipping_method/additional.phtml | 2 +- .../onepage/shipping_method/available.phtml | 2 +- .../Mage/Checkout/view/frontend/opcheckout.js | 43 +- .../Mage/Checkout/view/frontend/success.phtml | 2 +- .../view/frontend/total/default.phtml | 4 +- .../view/frontend/total/nominal.phtml | 2 +- .../Checkout/view/frontend/total/tax.phtml | 2 +- app/code/core/Mage/Cms/Block/Block.php | 2 +- app/code/core/Mage/Cms/Block/Page.php | 4 +- app/code/core/Mage/Cms/Block/Widget/Block.php | 2 +- .../core/Mage/Cms/Block/Widget/Page/Link.php | 2 +- app/code/core/Mage/Cms/Controller/Router.php | 2 +- app/code/core/Mage/Cms/Helper/Data.php | 2 +- app/code/core/Mage/Cms/Helper/Page.php | 11 +- .../core/Mage/Cms/Helper/Wysiwyg/Images.php | 2 +- app/code/core/Mage/Cms/Model/Block.php | 2 +- app/code/core/Mage/Cms/Model/Observer.php | 2 +- app/code/core/Mage/Cms/Model/Page.php | 2 +- .../core/Mage/Cms/Model/Resource/Block.php | 2 +- .../Cms/Model/Resource/Block/Collection.php | 2 +- .../core/Mage/Cms/Model/Resource/Page.php | 2 +- .../Cms/Model/Resource/Page/Collection.php | 2 +- .../Mage/Cms/Model/Resource/Page/Service.php | 2 +- .../core/Mage/Cms/Model/Template/Filter.php | 2 +- .../core/Mage/Cms/Model/Wysiwyg/Config.php | 2 +- .../Mage/Cms/Model/Wysiwyg/Images/Storage.php | 2 +- .../Wysiwyg/Images/Storage/Collection.php | 2 +- .../Mage/Cms/controllers/IndexController.php | 2 +- .../Mage/Cms/controllers/PageController.php | 2 +- .../data/cms_setup/data-install-1.6.0.0.php | 2 +- app/code/core/Mage/Cms/etc/adminhtml.xml | 2 +- app/code/core/Mage/Cms/etc/config.xml | 2 +- app/code/core/Mage/Cms/etc/system.xml | 2 +- app/code/core/Mage/Cms/etc/widget.xml | 2 +- .../Cms/sql/cms_setup/install-1.6.0.0.php | 2 +- .../core/Mage/Cms/view/frontend/content.phtml | 2 +- .../Cms/view/frontend/content_heading.phtml | 2 +- .../Mage/Cms/view/frontend/default/home.phtml | 2 +- .../Cms/view/frontend/default/no-route.phtml | 2 +- .../core/Mage/Cms/view/frontend/layout.xml | 2 +- .../core/Mage/Cms/view/frontend/meta.phtml | 2 +- .../frontend/widget/link/link_block.phtml | 2 +- .../frontend/widget/link/link_inline.phtml | 2 +- .../widget/static_block/default.phtml | 2 +- .../core/Mage/Cms/view/frontend/widgets.css | 2 +- .../Block/Adminhtml/Extension/Custom/Edit.php | 2 +- .../Adminhtml/Extension/Custom/Edit/Form.php | 2 +- .../Extension/Custom/Edit/Tab/Abstract.php | 8 +- .../Extension/Custom/Edit/Tab/Authors.php | 2 +- .../Extension/Custom/Edit/Tab/Contents.php | 2 +- .../Extension/Custom/Edit/Tab/Depends.php | 2 +- .../Extension/Custom/Edit/Tab/Grid.php | 2 +- .../Extension/Custom/Edit/Tab/Load.php | 2 +- .../Extension/Custom/Edit/Tab/Local.php | 2 +- .../Extension/Custom/Edit/Tab/Package.php | 2 +- .../Extension/Custom/Edit/Tab/Release.php | 2 +- .../Adminhtml/Extension/Custom/Edit/Tabs.php | 2 +- app/code/core/Mage/Connect/Helper/Data.php | 2 +- .../core/Mage/Connect/Model/Extension.php | 2 +- .../Connect/Model/Extension/Collection.php | 2 +- app/code/core/Mage/Connect/Model/Session.php | 2 +- .../Adminhtml/Extension/CustomController.php | 2 +- .../Adminhtml/Extension/LocalController.php | 2 +- app/code/core/Mage/Connect/etc/adminhtml.xml | 2 +- app/code/core/Mage/Connect/etc/config.xml | 2 +- .../adminhtml/extension/custom/authors.phtml | 2 +- .../adminhtml/extension/custom/contents.phtml | 2 +- .../adminhtml/extension/custom/depends.phtml | 2 +- .../adminhtml/extension/custom/load.phtml | 2 +- .../adminhtml/extension/custom/package.phtml | 2 +- .../adminhtml/extension/custom/release.phtml | 2 +- .../Mage/Connect/view/adminhtml/layout.xml | 2 +- app/code/core/Mage/Contacts/Helper/Data.php | 2 +- .../Model/System/Config/Backend/Links.php | 2 +- .../Contacts/controllers/IndexController.php | 2 +- app/code/core/Mage/Contacts/etc/adminhtml.xml | 2 +- app/code/core/Mage/Contacts/etc/config.xml | 2 +- app/code/core/Mage/Contacts/etc/system.xml | 2 +- .../sql/contacts_setup/install-1.6.0.0.php | 2 +- .../Mage/Contacts/view/frontend/form.phtml | 2 +- .../Mage/Contacts/view/frontend/layout.xml | 2 +- app/code/core/Mage/Core/Block/Abstract.php | 2 +- app/code/core/Mage/Core/Block/Flush.php | 2 +- .../core/Mage/Core/Block/Html/Calendar.php | 2 +- app/code/core/Mage/Core/Block/Html/Date.php | 2 +- app/code/core/Mage/Core/Block/Html/Link.php | 2 +- app/code/core/Mage/Core/Block/Html/Select.php | 2 +- app/code/core/Mage/Core/Block/Messages.php | 2 +- .../core/Mage/Core/Block/Store/Switcher.php | 2 +- app/code/core/Mage/Core/Block/Template.php | 2 +- .../core/Mage/Core/Block/Template/Facade.php | 2 +- .../core/Mage/Core/Block/Template/Smarty.php | 2 +- .../core/Mage/Core/Block/Template/Zend.php | 2 +- app/code/core/Mage/Core/Block/Text.php | 2 +- app/code/core/Mage/Core/Block/Text/List.php | 2 +- .../core/Mage/Core/Block/Text/List/Item.php | 2 +- .../core/Mage/Core/Block/Text/List/Link.php | 2 +- .../Mage/Core/Controller/Front/Action.php | 4 +- .../Mage/Core/Controller/Front/Router.php | 2 +- .../Mage/Core/Controller/Request/Http.php | 2 +- .../Mage/Core/Controller/Response/Http.php | 2 +- .../Mage/Core/Controller/Varien/Action.php | 8 +- .../Mage/Core/Controller/Varien/Exception.php | 2 +- .../Mage/Core/Controller/Varien/Front.php | 2 +- .../Controller/Varien/Router/Abstract.php | 2 +- .../Core/Controller/Varien/Router/Admin.php | 2 +- .../Core/Controller/Varien/Router/Default.php | 2 +- .../Controller/Varien/Router/Standard.php | 2 +- app/code/core/Mage/Core/Exception.php | 2 +- app/code/core/Mage/Core/Helper/Abstract.php | 37 +- app/code/core/Mage/Core/Helper/Data.php | 56 +- .../core/Mage/Core/Helper/File/Storage.php | 2 +- .../Core/Helper/File/Storage/Database.php | 2 +- app/code/core/Mage/Core/Helper/Hint.php | 80 + app/code/core/Mage/Core/Helper/Http.php | 2 +- app/code/core/Mage/Core/Helper/Js.php | 151 +- app/code/core/Mage/Core/Helper/String.php | 12 +- app/code/core/Mage/Core/Helper/Translate.php | 26 +- app/code/core/Mage/Core/Helper/Url.php | 2 +- .../core/Mage/Core/Helper/Url/Rewrite.php | 2 +- app/code/core/Mage/Core/Model/Abstract.php | 2 +- app/code/core/Mage/Core/Model/App.php | 10 +- app/code/core/Mage/Core/Model/App/Area.php | 2 +- .../core/Mage/Core/Model/App/Emulation.php | 2 +- app/code/core/Mage/Core/Model/Cache.php | 12 +- app/code/core/Mage/Core/Model/Calculator.php | 87 + app/code/core/Mage/Core/Model/Config.php | 6 +- app/code/core/Mage/Core/Model/Config/Base.php | 2 +- app/code/core/Mage/Core/Model/Config/Data.php | 2 +- .../core/Mage/Core/Model/Config/Element.php | 2 +- .../core/Mage/Core/Model/Config/Fieldset.php | 2 +- .../core/Mage/Core/Model/Config/Options.php | 2 +- .../core/Mage/Core/Model/Config/System.php | 2 +- app/code/core/Mage/Core/Model/Convert.php | 2 +- app/code/core/Mage/Core/Model/Cookie.php | 3 +- app/code/core/Mage/Core/Model/Date.php | 2 +- app/code/core/Mage/Core/Model/Design.php | 2 +- .../Core/Model/Design/Backend/Exceptions.php | 2 +- .../Mage/Core/Model/Design/Backend/Theme.php | 2 +- .../core/Mage/Core/Model/Design/Package.php | 42 +- .../Mage/Core/Model/Design/Source/Design.php | 2 +- app/code/core/Mage/Core/Model/Email.php | 2 +- app/code/core/Mage/Core/Model/Email/Info.php | 2 +- .../core/Mage/Core/Model/Email/Template.php | 2 +- .../Mage/Core/Model/Email/Template/Filter.php | 2 +- .../Mage/Core/Model/Email/Template/Mailer.php | 2 +- .../core/Mage/Core/Model/Email/Transport.php | 2 +- app/code/core/Mage/Core/Model/Encryption.php | 2 +- .../core/Mage/Core/Model/File/Storage.php | 2 +- .../Mage/Core/Model/File/Storage/Abstract.php | 2 +- .../Mage/Core/Model/File/Storage/Database.php | 2 +- .../Model/File/Storage/Database/Abstract.php | 2 +- .../Model/File/Storage/Directory/Database.php | 2 +- .../Mage/Core/Model/File/Storage/File.php | 2 +- .../Mage/Core/Model/File/Storage/Flag.php | 2 +- .../core/Mage/Core/Model/File/Uploader.php | 2 +- .../Model/File/Validator/AvailablePath.php | 2 +- .../File/Validator/NotProtectedExtension.php | 7 +- app/code/core/Mage/Core/Model/Flag.php | 2 +- .../Core/Model/Input/Filter/MaliciousCode.php | 2 +- app/code/core/Mage/Core/Model/Layout.php | 4 +- app/code/core/Mage/Core/Model/Layout/Data.php | 2 +- .../core/Mage/Core/Model/Layout/Element.php | 2 +- .../core/Mage/Core/Model/Layout/Update.php | 39 +- app/code/core/Mage/Core/Model/Locale.php | 14 +- .../core/Mage/Core/Model/Locale/Config.php | 2 +- app/code/core/Mage/Core/Model/Log/Adapter.php | 2 +- app/code/core/Mage/Core/Model/Message.php | 2 +- .../core/Mage/Core/Model/Message/Abstract.php | 2 +- .../Mage/Core/Model/Message/Collection.php | 2 +- .../core/Mage/Core/Model/Message/Error.php | 2 +- .../core/Mage/Core/Model/Message/Notice.php | 2 +- .../core/Mage/Core/Model/Message/Success.php | 2 +- .../core/Mage/Core/Model/Message/Warning.php | 2 +- app/code/core/Mage/Core/Model/Observer.php | 2 +- app/code/core/Mage/Core/Model/Resource.php | 2 +- .../Mage/Core/Model/Resource/Abstract.php | 2 +- .../core/Mage/Core/Model/Resource/Cache.php | 2 +- .../core/Mage/Core/Model/Resource/Config.php | 2 +- .../Mage/Core/Model/Resource/Config/Data.php | 2 +- .../Model/Resource/Config/Data/Collection.php | 2 +- .../Mage/Core/Model/Resource/Db/Abstract.php | 2 +- .../Model/Resource/Db/Collection/Abstract.php | 2 +- .../core/Mage/Core/Model/Resource/Design.php | 2 +- .../Core/Model/Resource/Design/Collection.php | 2 +- .../Core/Model/Resource/Email/Template.php | 2 +- .../Resource/Email/Template/Collection.php | 2 +- .../Core/Model/Resource/Entity/Abstract.php | 2 +- .../Mage/Core/Model/Resource/Entity/Table.php | 2 +- .../Model/Resource/File/Storage/Abstract.php | 2 +- .../Model/Resource/File/Storage/Database.php | 2 +- .../File/Storage/Directory/Database.php | 2 +- .../Core/Model/Resource/File/Storage/File.php | 2 +- .../core/Mage/Core/Model/Resource/Flag.php | 2 +- .../Core/Model/Resource/Helper/Abstract.php | 2 +- .../Core/Model/Resource/Helper/Mysql4.php | 2 +- .../Mage/Core/Model/Resource/Iterator.php | 2 +- .../core/Mage/Core/Model/Resource/Layout.php | 2 +- .../Mage/Core/Model/Resource/Resource.php | 2 +- .../core/Mage/Core/Model/Resource/Session.php | 2 +- .../core/Mage/Core/Model/Resource/Setup.php | 2 +- .../Model/Resource/Setup/Query/Modifier.php | 2 +- .../core/Mage/Core/Model/Resource/Store.php | 2 +- .../Core/Model/Resource/Store/Collection.php | 2 +- .../Mage/Core/Model/Resource/Store/Group.php | 2 +- .../Model/Resource/Store/Group/Collection.php | 2 +- .../Mage/Core/Model/Resource/Transaction.php | 2 +- .../Mage/Core/Model/Resource/Translate.php | 2 +- .../Core/Model/Resource/Translate/String.php | 2 +- .../Core/Model/Resource/Type/Abstract.php | 2 +- .../core/Mage/Core/Model/Resource/Type/Db.php | 2 +- .../Core/Model/Resource/Type/Db/Mysqli.php | 2 +- .../Model/Resource/Type/Db/Mysqli/Setup.php | 2 +- .../Core/Model/Resource/Type/Db/Pdo/Mysql.php | 2 +- .../Mage/Core/Model/Resource/Url/Rewrite.php | 5 +- .../Model/Resource/Url/Rewrite/Collection.php | 2 +- .../Mage/Core/Model/Resource/Variable.php | 13 +- .../Model/Resource/Variable/Collection.php | 2 +- .../core/Mage/Core/Model/Resource/Website.php | 2 +- .../Model/Resource/Website/Collection.php | 2 +- app/code/core/Mage/Core/Model/Session.php | 2 +- .../core/Mage/Core/Model/Session/Abstract.php | 4 +- .../Core/Model/Session/Abstract/Varien.php | 6 +- .../Mage/Core/Model/Session/Abstract/Zend.php | 2 +- .../Mage/Core/Model/Session/Exception.php | 2 +- .../core/Mage/Core/Model/ShellAbstract.php | 2 +- .../Core/Model/Source/Email/Variables.php | 29 +- app/code/core/Mage/Core/Model/Store.php | 16 +- app/code/core/Mage/Core/Model/Store/Api.php | 2 +- .../core/Mage/Core/Model/Store/Api/V2.php | 2 +- .../core/Mage/Core/Model/Store/Exception.php | 2 +- app/code/core/Mage/Core/Model/Store/Group.php | 42 +- app/code/core/Mage/Core/Model/Template.php | 4 +- app/code/core/Mage/Core/Model/Translate.php | 2 +- .../core/Mage/Core/Model/Translate/Expr.php | 2 +- .../core/Mage/Core/Model/Translate/Inline.php | 347 +- .../core/Mage/Core/Model/Translate/String.php | 2 +- app/code/core/Mage/Core/Model/Url.php | 2 +- app/code/core/Mage/Core/Model/Url/Rewrite.php | 2 +- app/code/core/Mage/Core/Model/Variable.php | 2 +- .../core/Mage/Core/Model/Variable/Config.php | 2 +- .../Mage/Core/Model/Variable/Observer.php | 2 +- app/code/core/Mage/Core/Model/Website.php | 2 +- .../Mage/Core/controllers/AjaxController.php | 2 +- .../Mage/Core/controllers/IndexController.php | 2 +- app/code/core/Mage/Core/etc/api.xml | 2 +- app/code/core/Mage/Core/etc/config.xml | 5 +- app/code/core/Mage/Core/etc/system.xml | 30 +- app/code/core/Mage/Core/etc/translater.xml | 205 + app/code/core/Mage/Core/functions.php | 2 +- .../Core/sql/core_setup/install-1.6.0.0.php | 2 +- .../core_setup/upgrade-1.6.0.1-1.6.0.2.php | 2 +- .../Mage/Core/view/frontend/formkey.phtml | 2 +- .../core/Mage/Core/view/frontend/layout.xml | 2 +- .../core/Mage/Core/view/frontend/link.phtml | 2 +- .../Mage/Core/view/frontend/messages.phtml | 2 +- app/code/core/Mage/Cron/Exception.php | 2 +- app/code/core/Mage/Cron/Helper/Data.php | 2 +- app/code/core/Mage/Cron/Model/Observer.php | 2 +- .../Mage/Cron/Model/Resource/Schedule.php | 2 +- .../Model/Resource/Schedule/Collection.php | 2 +- app/code/core/Mage/Cron/Model/Schedule.php | 2 +- app/code/core/Mage/Cron/etc/config.xml | 2 +- app/code/core/Mage/Cron/etc/system.xml | 2 +- .../Cron/sql/cron_setup/install-1.6.0.0.php | 2 +- .../Mage/Customer/Block/Account/Dashboard.php | 2 +- .../Block/Account/Dashboard/Address.php | 2 +- .../Block/Account/Dashboard/Block.php | 2 +- .../Block/Account/Dashboard/Hello.php | 2 +- .../Customer/Block/Account/Dashboard/Info.php | 2 +- .../Block/Account/Dashboard/Newsletter.php | 2 +- .../Block/Account/Dashboard/Sidebar.php | 2 +- .../Customer/Block/Account/Forgotpassword.php | 2 +- .../Customer/Block/Account/Navigation.php | 2 +- .../Customer/Block/Account/Resetpassword.php | 2 +- .../core/Mage/Customer/Block/Address/Book.php | 2 +- .../core/Mage/Customer/Block/Address/Edit.php | 2 +- .../Block/Address/Renderer/Default.php | 2 +- .../Block/Address/Renderer/Interface.php | 2 +- .../core/Mage/Customer/Block/Form/Edit.php | 2 +- .../core/Mage/Customer/Block/Form/Login.php | 2 +- .../Mage/Customer/Block/Form/Register.php | 2 +- .../core/Mage/Customer/Block/Newsletter.php | 2 +- .../Mage/Customer/Block/Widget/Abstract.php | 2 +- .../core/Mage/Customer/Block/Widget/Dob.php | 2 +- .../Mage/Customer/Block/Widget/Gender.php | 2 +- .../core/Mage/Customer/Block/Widget/Name.php | 12 +- .../Mage/Customer/Block/Widget/Taxvat.php | 2 +- app/code/core/Mage/Customer/Exception.php | 2 +- .../core/Mage/Customer/Helper/Address.php | 53 +- app/code/core/Mage/Customer/Helper/Data.php | 258 +- app/code/core/Mage/Customer/Model/Address.php | 6 +- .../Mage/Customer/Model/Address/Abstract.php | 54 +- .../core/Mage/Customer/Model/Address/Api.php | 2 +- .../Mage/Customer/Model/Address/Api/V2.php | 2 +- .../Mage/Customer/Model/Address/Config.php | 2 +- .../core/Mage/Customer/Model/Api/Resource.php | 2 +- .../core/Mage/Customer/Model/Attribute.php | 2 +- .../Model/Attribute/Backend/Data/Boolean.php | 52 + .../Mage/Customer/Model/Attribute/Data.php | 2 +- .../Model/Attribute/Data/Abstract.php | 2 +- .../Customer/Model/Attribute/Data/Boolean.php | 2 +- .../Customer/Model/Attribute/Data/Date.php | 2 +- .../Customer/Model/Attribute/Data/File.php | 2 +- .../Customer/Model/Attribute/Data/Hidden.php | 2 +- .../Customer/Model/Attribute/Data/Image.php | 2 +- .../Model/Attribute/Data/Multiline.php | 2 +- .../Model/Attribute/Data/Multiselect.php | 2 +- .../Model/Attribute/Data/Postcode.php | 2 +- .../Customer/Model/Attribute/Data/Select.php | 2 +- .../Customer/Model/Attribute/Data/Text.php | 2 +- .../Model/Attribute/Data/Textarea.php | 2 +- .../core/Mage/Customer/Model/Config/Share.php | 2 +- .../Model/Convert/Adapter/Customer.php | 2 +- .../Model/Convert/Parser/Customer.php | 2 +- .../core/Mage/Customer/Model/Customer.php | 42 +- .../core/Mage/Customer/Model/Customer/Api.php | 2 +- .../Mage/Customer/Model/Customer/Api/V2.php | 2 +- .../Customer/Attribute/Backend/Billing.php | 2 +- .../Customer/Attribute/Backend/Password.php | 2 +- .../Customer/Attribute/Backend/Shipping.php | 2 +- .../Customer/Attribute/Backend/Store.php | 2 +- .../Customer/Attribute/Backend/Website.php | 2 +- .../Model/Customer/Attribute/Source/Group.php | 2 +- .../Model/Customer/Attribute/Source/Store.php | 2 +- .../Customer/Attribute/Source/Website.php | 2 +- app/code/core/Mage/Customer/Model/Form.php | 2 +- app/code/core/Mage/Customer/Model/Group.php | 2 +- .../core/Mage/Customer/Model/Group/Api.php | 2 +- .../core/Mage/Customer/Model/Group/Api/V2.php | 2 +- .../core/Mage/Customer/Model/Observer.php | 184 +- .../Mage/Customer/Model/Resource/Address.php | 2 +- .../Address/Attribute/Backend/Region.php | 2 +- .../Address/Attribute/Backend/Street.php | 2 +- .../Resource/Address/Attribute/Collection.php | 2 +- .../Address/Attribute/Source/Country.php | 2 +- .../Address/Attribute/Source/Region.php | 2 +- .../Model/Resource/Address/Collection.php | 2 +- .../Customer/Model/Resource/Attribute.php | 2 +- .../Model/Resource/Attribute/Collection.php | 2 +- .../Mage/Customer/Model/Resource/Customer.php | 4 +- .../Model/Resource/Customer/Collection.php | 15 +- .../Model/Resource/Form/Attribute.php | 2 +- .../Resource/Form/Attribute/Collection.php | 2 +- .../Mage/Customer/Model/Resource/Group.php | 5 +- .../Model/Resource/Group/Collection.php | 2 +- .../Mage/Customer/Model/Resource/Setup.php | 2 +- app/code/core/Mage/Customer/Model/Session.php | 13 +- .../controllers/AccountController.php | 26 +- .../controllers/AddressController.php | 2 +- .../Customer/controllers/ReviewController.php | 2 +- .../data-upgrade-1.6.1.0-1.6.2.0.php | 43 + app/code/core/Mage/Customer/etc/adminhtml.xml | 2 +- app/code/core/Mage/Customer/etc/api.xml | 2 +- app/code/core/Mage/Customer/etc/config.xml | 42 +- app/code/core/Mage/Customer/etc/fieldset.xml | 75 +- app/code/core/Mage/Customer/etc/system.xml | 123 +- .../sql/customer_setup/install-1.6.0.0.php | 2 +- .../mysql4-upgrade-1.6.0.0-1.6.1.0.php | 2 +- .../upgrade-1.6.0.0-1.6.1.0.php | 2 +- .../upgrade-1.6.1.0-1.6.2.0.php | 78 + .../upgrade-1.6.2.0-1.6.2.0.1.php | 36 + .../view/frontend/account/dashboard.phtml | 2 +- .../frontend/account/dashboard/address.phtml | 2 +- .../frontend/account/dashboard/hello.phtml | 2 +- .../frontend/account/dashboard/info.phtml | 2 +- .../account/dashboard/newsletter.phtml | 2 +- .../view/frontend/account/link/back.phtml | 2 +- .../view/frontend/account/navigation.phtml | 2 +- .../Mage/Customer/view/frontend/address.phtml | 2 +- .../Customer/view/frontend/address/book.phtml | 2 +- .../Customer/view/frontend/address/edit.phtml | 8 +- .../Mage/Customer/view/frontend/balance.phtml | 2 +- .../Customer/view/frontend/form/address.phtml | 2 +- .../view/frontend/form/changepassword.phtml | 2 +- .../view/frontend/form/confirmation.phtml | 2 +- .../Customer/view/frontend/form/edit.phtml | 2 +- .../view/frontend/form/forgotpassword.phtml | 3 +- .../Customer/view/frontend/form/login.phtml | 3 +- .../view/frontend/form/mini.login.phtml | 2 +- .../view/frontend/form/newsletter.phtml | 2 +- .../view/frontend/form/register.phtml | 3 +- .../form/resetforgottenpassword.phtml | 2 +- .../Mage/Customer/view/frontend/layout.xml | 8 +- .../Mage/Customer/view/frontend/logout.phtml | 2 +- .../Customer/view/frontend/widget/dob.phtml | 2 +- .../view/frontend/widget/gender.phtml | 2 +- .../Customer/view/frontend/widget/name.phtml | 9 +- .../view/frontend/widget/taxvat.phtml | 2 +- app/code/core/Mage/Dataflow/Helper/Data.php | 2 +- app/code/core/Mage/Dataflow/Model/Batch.php | 2 +- .../Mage/Dataflow/Model/Batch/Abstract.php | 2 +- .../core/Mage/Dataflow/Model/Batch/Export.php | 2 +- .../core/Mage/Dataflow/Model/Batch/Import.php | 2 +- .../core/Mage/Dataflow/Model/Batch/Io.php | 2 +- app/code/core/Mage/Dataflow/Model/Convert.php | 2 +- .../Mage/Dataflow/Model/Convert/Action.php | 2 +- .../Model/Convert/Action/Abstract.php | 2 +- .../Model/Convert/Action/Interface.php | 2 +- .../Model/Convert/Adapter/Abstract.php | 2 +- .../Model/Convert/Adapter/Db/Table.php | 2 +- .../Dataflow/Model/Convert/Adapter/Http.php | 2 +- .../Model/Convert/Adapter/Http/Curl.php | 2 +- .../Model/Convert/Adapter/Interface.php | 2 +- .../Dataflow/Model/Convert/Adapter/Io.php | 2 +- .../Dataflow/Model/Convert/Adapter/Soap.php | 2 +- .../Dataflow/Model/Convert/Adapter/Std.php | 2 +- .../Model/Convert/Adapter/Zend/Cache.php | 2 +- .../Model/Convert/Adapter/Zend/Db.php | 2 +- .../Model/Convert/Container/Abstract.php | 2 +- .../Model/Convert/Container/Collection.php | 2 +- .../Model/Convert/Container/Generic.php | 2 +- .../Model/Convert/Container/Interface.php | 2 +- .../Mage/Dataflow/Model/Convert/Exception.php | 2 +- .../Model/Convert/Iterator/Interface.php | 2 +- .../Model/Convert/Mapper/Abstract.php | 2 +- .../Dataflow/Model/Convert/Mapper/Column.php | 2 +- .../Model/Convert/Mapper/Interface.php | 2 +- .../Model/Convert/Parser/Abstract.php | 2 +- .../Dataflow/Model/Convert/Parser/Csv.php | 2 +- .../Model/Convert/Parser/Interface.php | 2 +- .../Model/Convert/Parser/Serialize.php | 2 +- .../Model/Convert/Parser/Xml/Excel.php | 2 +- .../Mage/Dataflow/Model/Convert/Profile.php | 2 +- .../Model/Convert/Profile/Abstract.php | 2 +- .../Model/Convert/Profile/Collection.php | 2 +- .../Model/Convert/Profile/Interface.php | 2 +- .../Model/Convert/Validator/Abstract.php | 2 +- .../Model/Convert/Validator/Column.php | 2 +- .../Model/Convert/Validator/Dryrun.php | 2 +- .../Model/Convert/Validator/Interface.php | 2 +- app/code/core/Mage/Dataflow/Model/Import.php | 2 +- app/code/core/Mage/Dataflow/Model/Profile.php | 8 +- .../Mage/Dataflow/Model/Profile/History.php | 2 +- .../Mage/Dataflow/Model/Resource/Batch.php | 2 +- .../Model/Resource/Batch/Abstract.php | 2 +- .../Model/Resource/Batch/Collection.php | 2 +- .../Dataflow/Model/Resource/Batch/Export.php | 2 +- .../Dataflow/Model/Resource/Batch/Import.php | 2 +- .../Mage/Dataflow/Model/Resource/Import.php | 2 +- .../Model/Resource/Import/Collection.php | 2 +- .../Mage/Dataflow/Model/Resource/Profile.php | 2 +- .../Model/Resource/Profile/Collection.php | 2 +- .../Model/Resource/Profile/History.php | 2 +- .../Resource/Profile/History/Collection.php | 2 +- .../Mage/Dataflow/Model/Resource/Session.php | 2 +- app/code/core/Mage/Dataflow/Model/Session.php | 2 +- .../Dataflow/Model/Session/Parser/Csv.php | 2 +- .../dataflow_setup/data-install-1.6.0.0.php | 2 +- app/code/core/Mage/Dataflow/etc/config.xml | 2 +- .../sql/dataflow_setup/install-1.6.0.0.php | 2 +- .../Adminhtml/Frontend/Currency/Base.php | 2 +- .../Adminhtml/Frontend/Region/Updater.php | 2 +- .../core/Mage/Directory/Block/Currency.php | 2 +- app/code/core/Mage/Directory/Block/Data.php | 2 +- app/code/core/Mage/Directory/Exception.php | 2 +- app/code/core/Mage/Directory/Helper/Data.php | 2 +- app/code/core/Mage/Directory/Helper/Url.php | 2 +- .../core/Mage/Directory/Model/Country.php | 2 +- .../core/Mage/Directory/Model/Country/Api.php | 2 +- .../Mage/Directory/Model/Country/Api/V2.php | 2 +- .../Mage/Directory/Model/Country/Format.php | 2 +- .../core/Mage/Directory/Model/Currency.php | 2 +- .../Mage/Directory/Model/Currency/Filter.php | 2 +- .../Model/Currency/Import/Abstract.php | 2 +- .../Model/Currency/Import/Webservicex.php | 2 +- .../core/Mage/Directory/Model/Observer.php | 2 +- app/code/core/Mage/Directory/Model/Region.php | 2 +- .../core/Mage/Directory/Model/Region/Api.php | 2 +- .../Mage/Directory/Model/Region/Api/V2.php | 2 +- .../Mage/Directory/Model/Resource/Country.php | 2 +- .../Model/Resource/Country/Collection.php | 2 +- .../Model/Resource/Country/Format.php | 2 +- .../Resource/Country/Format/Collection.php | 2 +- .../Directory/Model/Resource/Currency.php | 2 +- .../Mage/Directory/Model/Resource/Region.php | 2 +- .../Model/Resource/Region/Collection.php | 5 +- .../controllers/CurrencyController.php | 2 +- .../directory_setup/data-install-1.6.0.0.php | 2 +- app/code/core/Mage/Directory/etc/api.xml | 2 +- app/code/core/Mage/Directory/etc/config.xml | 2 +- app/code/core/Mage/Directory/etc/system.xml | 2 +- .../sql/directory_setup/install-1.6.0.0.php | 2 +- .../adminhtml/js/optional_zip_countries.phtml | 2 +- .../Directory/view/frontend/currency.phtml | 2 +- .../view/frontend/currency/switch.phtml | 2 +- .../frontend/js/optional_zip_countries.phtml | 2 +- .../Mage/Directory/view/frontend/layout.xml | 2 +- .../Composite/Fieldset/Downloadable.php | 2 +- .../Catalog/Product/Edit/Tab/Downloadable.php | 2 +- .../Product/Edit/Tab/Downloadable/Links.php | 2 +- .../Product/Edit/Tab/Downloadable/Samples.php | 2 +- .../Sales/Items/Column/Downloadable/Name.php | 2 +- .../Block/Catalog/Product/Links.php | 2 +- .../Block/Catalog/Product/Samples.php | 2 +- .../Block/Catalog/Product/View/Type.php | 2 +- .../Block/Checkout/Cart/Item/Renderer.php | 2 +- .../Downloadable/Block/Checkout/Success.php | 2 +- .../Block/Customer/Products/List.php | 2 +- .../Sales/Order/Email/Items/Downloadable.php | 2 +- .../Order/Email/Items/Order/Downloadable.php | 2 +- .../Order/Item/Renderer/Downloadable.php | 2 +- .../Helper/Catalog/Product/Configuration.php | 2 +- .../core/Mage/Downloadable/Helper/Data.php | 2 +- .../Mage/Downloadable/Helper/Download.php | 2 +- .../core/Mage/Downloadable/Helper/File.php | 2 +- .../core/Mage/Downloadable/Model/Link.php | 2 +- .../core/Mage/Downloadable/Model/Link/Api.php | 2 +- .../Downloadable/Model/Link/Api/Uploader.php | 2 +- .../Mage/Downloadable/Model/Link/Api/V2.php | 2 +- .../Downloadable/Model/Link/Api/Validator.php | 2 +- .../Downloadable/Model/Link/Purchased.php | 2 +- .../Model/Link/Purchased/Item.php | 2 +- .../core/Mage/Downloadable/Model/Observer.php | 8 +- .../Mage/Downloadable/Model/Product/Price.php | 2 +- .../Mage/Downloadable/Model/Product/Type.php | 7 +- .../Model/Resource/Indexer/Price.php | 10 +- .../Mage/Downloadable/Model/Resource/Link.php | 2 +- .../Model/Resource/Link/Collection.php | 2 +- .../Model/Resource/Link/Purchased.php | 2 +- .../Resource/Link/Purchased/Collection.php | 2 +- .../Model/Resource/Link/Purchased/Item.php | 2 +- .../Link/Purchased/Item/Collection.php | 2 +- .../Downloadable/Model/Resource/Sample.php | 2 +- .../Model/Resource/Sample/Collection.php | 2 +- .../Model/Sales/Order/Pdf/Items/Abstract.php | 2 +- .../Sales/Order/Pdf/Items/Creditmemo.php | 39 +- .../Model/Sales/Order/Pdf/Items/Invoice.php | 61 +- .../core/Mage/Downloadable/Model/Sample.php | 2 +- .../Config/Source/Contentdisposition.php | 2 +- .../System/Config/Source/Orderitemstatus.php | 2 +- .../Adminhtml/Downloadable/FileController.php | 8 +- .../Downloadable/Product/EditController.php | 2 +- .../controllers/CustomerController.php | 2 +- .../controllers/DownloadController.php | 9 +- .../data-install-1.6.0.0.php | 2 +- .../core/Mage/Downloadable/etc/adminhtml.xml | 16 +- app/code/core/Mage/Downloadable/etc/api.xml | 2 +- .../core/Mage/Downloadable/etc/config.xml | 4 +- .../core/Mage/Downloadable/etc/fieldset.xml | 2 +- .../core/Mage/Downloadable/etc/system.xml | 2 +- .../downloadable_setup/install-1.6.0.0.php | 2 +- .../mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php | 38 + .../upgrade-1.6.0.0-1.6.0.0.1.php | 2 +- .../upgrade-1.6.0.0.1-1.6.0.0.2.php | 34 + .../Downloadable/view/adminhtml/layout.xml | 2 +- .../composite/fieldset/downloadable.phtml | 2 +- .../adminhtml/product/edit/downloadable.phtml | 2 +- .../product/edit/downloadable/links.phtml | 4 +- .../product/edit/downloadable/samples.phtml | 4 +- .../column/downloadable/creditmemo/name.phtml | 2 +- .../column/downloadable/invoice/name.phtml | 2 +- .../items/column/downloadable/name.phtml | 2 +- .../create/items/renderer/downloadable.phtml | 2 +- .../view/items/renderer/downloadable.phtml | 2 +- .../create/items/renderer/downloadable.phtml | 2 +- .../view/items/renderer/downloadable.phtml | 2 +- .../view/items/renderer/downloadable.phtml | 2 +- .../view/frontend/catalog/product/links.phtml | 2 +- .../frontend/catalog/product/samples.phtml | 2 +- .../view/frontend/catalog/product/type.phtml | 2 +- .../frontend/checkout/cart/item/default.phtml | 2 +- .../multishipping/item/downloadable.phtml | 2 +- .../checkout/onepage/review/item.phtml | 2 +- .../view/frontend/checkout/success.phtml | 2 +- .../frontend/customer/products/list.phtml | 2 +- .../order/items/creditmemo/downloadable.phtml | 2 +- .../order/items/invoice/downloadable.phtml | 2 +- .../order/items/order/downloadable.phtml | 2 +- .../Downloadable/view/frontend/layout.xml | 2 +- .../items/renderer/downloadable.phtml | 2 +- .../invoice/items/renderer/downloadable.phtml | 2 +- .../order/items/renderer/downloadable.phtml | 2 +- .../Eav/Block/Adminhtml/Attribute/Edit/Js.php | 2 +- .../Attribute/Edit/Main/Abstract.php | 7 +- .../Attribute/Edit/Options/Abstract.php | 2 +- .../Adminhtml/Attribute/Grid/Abstract.php | 2 +- app/code/core/Mage/Eav/Exception.php | 2 +- app/code/core/Mage/Eav/Helper/Data.php | 2 +- .../System/Config/Source/Inputtype.php | 2 +- .../Config/Source/Inputtype/Validator.php | 2 +- app/code/core/Mage/Eav/Model/Attribute.php | 2 +- .../core/Mage/Eav/Model/Attribute/Data.php | 2 +- .../Eav/Model/Attribute/Data/Abstract.php | 2 +- .../Mage/Eav/Model/Attribute/Data/Boolean.php | 2 +- .../Mage/Eav/Model/Attribute/Data/Date.php | 18 +- .../Mage/Eav/Model/Attribute/Data/File.php | 2 +- .../Mage/Eav/Model/Attribute/Data/Hidden.php | 2 +- .../Mage/Eav/Model/Attribute/Data/Image.php | 2 +- .../Eav/Model/Attribute/Data/Multiline.php | 2 +- .../Eav/Model/Attribute/Data/Multiselect.php | 2 +- .../Mage/Eav/Model/Attribute/Data/Select.php | 2 +- .../Mage/Eav/Model/Attribute/Data/Text.php | 2 +- .../Eav/Model/Attribute/Data/Textarea.php | 2 +- app/code/core/Mage/Eav/Model/Config.php | 2 +- .../Mage/Eav/Model/Convert/Adapter/Entity.php | 2 +- .../Mage/Eav/Model/Convert/Adapter/Grid.php | 2 +- .../Eav/Model/Convert/Parser/Abstract.php | 2 +- app/code/core/Mage/Eav/Model/Entity.php | 2 +- .../core/Mage/Eav/Model/Entity/Abstract.php | 8 +- .../core/Mage/Eav/Model/Entity/Attribute.php | 2 +- .../Eav/Model/Entity/Attribute/Abstract.php | 2 +- .../Entity/Attribute/Backend/Abstract.php | 48 +- .../Model/Entity/Attribute/Backend/Array.php | 2 +- .../Entity/Attribute/Backend/Datetime.php | 2 +- .../Entity/Attribute/Backend/Default.php | 2 +- .../Entity/Attribute/Backend/Increment.php | 2 +- .../Entity/Attribute/Backend/Interface.php | 17 +- .../Entity/Attribute/Backend/Serialized.php | 2 +- .../Model/Entity/Attribute/Backend/Store.php | 2 +- .../Entity/Attribute/Backend/Time/Created.php | 2 +- .../Entity/Attribute/Backend/Time/Updated.php | 2 +- .../Eav/Model/Entity/Attribute/Exception.php | 2 +- .../Entity/Attribute/Frontend/Abstract.php | 2 +- .../Entity/Attribute/Frontend/Datetime.php | 2 +- .../Entity/Attribute/Frontend/Default.php | 2 +- .../Entity/Attribute/Frontend/Interface.php | 2 +- .../Mage/Eav/Model/Entity/Attribute/Group.php | 2 +- .../Eav/Model/Entity/Attribute/Interface.php | 2 +- .../Eav/Model/Entity/Attribute/Option.php | 2 +- .../Mage/Eav/Model/Entity/Attribute/Set.php | 8 +- .../Entity/Attribute/Source/Abstract.php | 6 +- .../Model/Entity/Attribute/Source/Boolean.php | 2 +- .../Model/Entity/Attribute/Source/Config.php | 2 +- .../Entity/Attribute/Source/Interface.php | 2 +- .../Model/Entity/Attribute/Source/Store.php | 2 +- .../Model/Entity/Attribute/Source/Table.php | 2 +- .../core/Mage/Eav/Model/Entity/Collection.php | 2 +- .../Eav/Model/Entity/Collection/Abstract.php | 2 +- .../Eav/Model/Entity/Increment/Abstract.php | 2 +- .../Eav/Model/Entity/Increment/Alphanum.php | 2 +- .../Eav/Model/Entity/Increment/Interface.php | 2 +- .../Eav/Model/Entity/Increment/Numeric.php | 2 +- .../core/Mage/Eav/Model/Entity/Interface.php | 2 +- app/code/core/Mage/Eav/Model/Entity/Setup.php | 20 +- app/code/core/Mage/Eav/Model/Entity/Store.php | 2 +- app/code/core/Mage/Eav/Model/Entity/Type.php | 2 +- app/code/core/Mage/Eav/Model/Form.php | 2 +- app/code/core/Mage/Eav/Model/Form/Element.php | 2 +- .../core/Mage/Eav/Model/Form/Fieldset.php | 2 +- app/code/core/Mage/Eav/Model/Form/Type.php | 2 +- .../Mage/Eav/Model/Resource/Attribute.php | 2 +- .../Model/Resource/Attribute/Collection.php | 8 +- .../core/Mage/Eav/Model/Resource/Config.php | 2 +- .../Eav/Model/Resource/Entity/Attribute.php | 2 +- .../Resource/Entity/Attribute/Collection.php | 2 +- .../Model/Resource/Entity/Attribute/Group.php | 2 +- .../Entity/Attribute/Group/Collection.php | 2 +- .../Resource/Entity/Attribute/Option.php | 2 +- .../Entity/Attribute/Option/Collection.php | 2 +- .../Model/Resource/Entity/Attribute/Set.php | 2 +- .../Entity/Attribute/Set/Collection.php | 2 +- .../Mage/Eav/Model/Resource/Entity/Store.php | 2 +- .../Mage/Eav/Model/Resource/Entity/Type.php | 2 +- .../Model/Resource/Entity/Type/Collection.php | 2 +- .../Eav/Model/Resource/Form/Attribute.php | 2 +- .../Resource/Form/Attribute/Collection.php | 2 +- .../Mage/Eav/Model/Resource/Form/Element.php | 2 +- .../Resource/Form/Element/Collection.php | 2 +- .../Mage/Eav/Model/Resource/Form/Fieldset.php | 2 +- .../Resource/Form/Fieldset/Collection.php | 2 +- .../Mage/Eav/Model/Resource/Form/Type.php | 2 +- .../Model/Resource/Form/Type/Collection.php | 2 +- .../Mage/Eav/Model/Resource/Helper/Mysql4.php | 2 +- app/code/core/Mage/Eav/etc/config.xml | 2 +- .../Eav/sql/eav_setup/install-1.6.0.0.php | 2 +- .../view/adminhtml/attribute/edit/js.phtml | 2 +- .../Adminhtml/Product/Helper/Form/Config.php | 2 +- .../Adminhtml/Sales/Order/Create/Form.php | 2 +- .../Sales/Order/Create/Giftoptions.php | 2 +- .../Adminhtml/Sales/Order/Create/Items.php | 2 +- .../Block/Adminhtml/Sales/Order/View/Form.php | 2 +- .../Sales/Order/View/Giftoptions.php | 2 +- .../Adminhtml/Sales/Order/View/Items.php | 2 +- .../Mage/GiftMessage/Block/Message/Inline.php | 2 +- .../core/Mage/GiftMessage/Helper/Data.php | 2 +- .../core/Mage/GiftMessage/Helper/Message.php | 2 +- app/code/core/Mage/GiftMessage/Helper/Url.php | 2 +- app/code/core/Mage/GiftMessage/Model/Api.php | 2 +- .../core/Mage/GiftMessage/Model/Api/V2.php | 2 +- .../core/Mage/GiftMessage/Model/Message.php | 2 +- .../core/Mage/GiftMessage/Model/Observer.php | 2 +- .../GiftMessage/Model/Resource/Message.php | 2 +- .../Model/Resource/Message/Collection.php | 2 +- .../Mage/GiftMessage/Model/Resource/Setup.php | 2 +- app/code/core/Mage/GiftMessage/etc/api.xml | 2 +- app/code/core/Mage/GiftMessage/etc/config.xml | 2 +- app/code/core/Mage/GiftMessage/etc/system.xml | 2 +- .../sql/giftmessage_setup/install-1.6.0.0.php | 2 +- .../GiftMessage/view/adminhtml/form.phtml | 2 +- .../view/adminhtml/giftoptionsform.phtml | 2 +- .../GiftMessage/view/adminhtml/helper.phtml | 2 +- .../GiftMessage/view/adminhtml/layout.xml | 2 +- .../GiftMessage/view/adminhtml/popup.phtml | 6 +- .../sales/order/create/giftoptions.phtml | 2 +- .../adminhtml/sales/order/create/items.phtml | 2 +- .../sales/order/view/giftoptions.phtml | 2 +- .../adminhtml/sales/order/view/items.phtml | 2 +- .../GiftMessage/view/frontend/inline.phtml | 2 +- .../core/Mage/GoogleAnalytics/Block/Ga.php | 2 +- .../core/Mage/GoogleAnalytics/Helper/Data.php | 2 +- .../Mage/GoogleAnalytics/Model/Observer.php | 2 +- .../Mage/GoogleAnalytics/etc/adminhtml.xml | 2 +- .../core/Mage/GoogleAnalytics/etc/config.xml | 2 +- .../core/Mage/GoogleAnalytics/etc/system.xml | 2 +- .../GoogleAnalytics/view/frontend/ga.phtml | 2 +- .../GoogleAnalytics/view/frontend/layout.xml | 2 +- .../Shipping/Applicable/Countries.php | 2 +- .../Block/Adminhtml/Shipping/Merchant.php | 2 +- .../core/Mage/GoogleCheckout/Block/Form.php | 2 +- .../core/Mage/GoogleCheckout/Block/Link.php | 2 +- .../Mage/GoogleCheckout/Block/Redirect.php | 2 +- .../core/Mage/GoogleCheckout/Exception.php | 2 +- .../core/Mage/GoogleCheckout/Helper/Data.php | 2 +- .../core/Mage/GoogleCheckout/Model/Api.php | 2 +- .../Mage/GoogleCheckout/Model/Api/Debug.php | 2 +- .../GoogleCheckout/Model/Api/Xml/Abstract.php | 2 +- .../Model/Api/Xml/Calculate.php | 2 +- .../GoogleCheckout/Model/Api/Xml/Callback.php | 7 +- .../GoogleCheckout/Model/Api/Xml/Checkout.php | 7 +- .../GoogleCheckout/Model/Api/Xml/Order.php | 2 +- .../GoogleCheckout/Model/Notification.php | 2 +- .../Mage/GoogleCheckout/Model/Observer.php | 16 +- .../Mage/GoogleCheckout/Model/Payment.php | 38 +- .../Model/Resource/Api/Debug.php | 2 +- .../Model/Resource/Api/Debug/Collection.php | 2 +- .../Model/Resource/Notification.php | 2 +- .../GoogleCheckout/Model/Resource/Setup.php | 2 +- .../Mage/GoogleCheckout/Model/Shipping.php | 2 +- .../Model/Source/Checkout/Image.php | 2 +- .../GoogleCheckout/Model/Source/Locale.php | 2 +- .../Model/Source/Shipping/Carrier.php | 45 +- .../Model/Source/Shipping/Category.php | 7 +- .../Model/Source/Shipping/Units.php | 5 +- .../Model/Source/Shipping/Virtual/Method.php | 9 +- .../Source/Shipping/Virtual/Schedule.php | 7 +- .../controllers/ApiController.php | 2 +- .../controllers/RedirectController.php | 2 +- .../Mage/GoogleCheckout/etc/adminhtml.xml | 2 +- .../core/Mage/GoogleCheckout/etc/config.xml | 2 +- .../core/Mage/GoogleCheckout/etc/system.xml | 2 +- .../googlecheckout_setup/install-1.6.0.0.php | 2 +- .../upgrade-1.6.0.0-1.6.0.1.php | 2 +- .../GoogleCheckout/view/frontend/form.phtml | 2 +- .../GoogleCheckout/view/frontend/layout.xml | 2 +- .../GoogleCheckout/view/frontend/link.phtml | 2 +- .../Category/Edit/Tab/Googleoptimizer.php | 2 +- .../Catalog/Form/Renderer/Import.php | 2 +- .../Product/Edit/Tab/Googleoptimizer.php | 2 +- .../Block/Adminhtml/Cms/Page/Edit/Enable.php | 2 +- .../Cms/Page/Edit/Renderer/Conversion.php | 2 +- .../Cms/Page/Edit/Tab/Googleoptimizer.php | 2 +- .../core/Mage/GoogleOptimizer/Block/Code.php | 2 +- .../GoogleOptimizer/Block/Code/Category.php | 2 +- .../GoogleOptimizer/Block/Code/Conversion.php | 2 +- .../Mage/GoogleOptimizer/Block/Code/Page.php | 2 +- .../GoogleOptimizer/Block/Code/Product.php | 2 +- .../core/Mage/GoogleOptimizer/Block/Js.php | 2 +- .../core/Mage/GoogleOptimizer/Helper/Data.php | 2 +- .../Googleoptimizer/Conversionpages.php | 2 +- .../core/Mage/GoogleOptimizer/Model/Code.php | 2 +- .../GoogleOptimizer/Model/Code/Category.php | 2 +- .../Mage/GoogleOptimizer/Model/Code/Page.php | 2 +- .../GoogleOptimizer/Model/Code/Product.php | 2 +- .../Mage/GoogleOptimizer/Model/Observer.php | 2 +- .../GoogleOptimizer/Model/Resource/Code.php | 2 +- .../Model/Resource/Code/Collection.php | 2 +- .../Googleoptimizer/IndexController.php | 2 +- .../core/Mage/GoogleOptimizer/etc/config.xml | 2 +- .../core/Mage/GoogleOptimizer/etc/system.xml | 2 +- .../googleoptimizer_setup/install-1.6.0.0.php | 2 +- .../catalog/form/renderer/import.phtml | 2 +- .../cms/edit/renderer/conversion.phtml | 2 +- .../GoogleOptimizer/view/adminhtml/js.phtml | 2 +- .../GoogleOptimizer/view/adminhtml/layout.xml | 2 +- .../GoogleOptimizer/view/frontend/layout.xml | 2 +- .../Block/Adminhtml/Captcha.php | 2 +- .../GoogleShopping/Block/Adminhtml/Items.php | 2 +- .../Block/Adminhtml/Items/Item.php | 2 +- .../Block/Adminhtml/Items/Product.php | 2 +- .../Block/Adminhtml/Items/Renderer/Id.php | 2 +- .../Block/Adminhtml/Store/Switcher.php | 2 +- .../GoogleShopping/Block/Adminhtml/Types.php | 2 +- .../Block/Adminhtml/Types/Edit.php | 2 +- .../Block/Adminhtml/Types/Edit/Attributes.php | 2 +- .../Block/Adminhtml/Types/Edit/Form.php | 2 +- .../Block/Adminhtml/Types/Edit/Select.php | 2 +- .../Block/Adminhtml/Types/Grid.php | 2 +- .../Adminhtml/Types/Renderer/Country.php | 2 +- .../Mage/GoogleShopping/Helper/Category.php | 4 +- .../core/Mage/GoogleShopping/Helper/Data.php | 2 +- .../core/Mage/GoogleShopping/Helper/Price.php | 4 +- .../Mage/GoogleShopping/Helper/Product.php | 2 +- .../Mage/GoogleShopping/Model/Attribute.php | 2 +- .../Model/Attribute/Availability.php | 2 +- .../Model/Attribute/Condition.php | 2 +- .../Model/Attribute/Content.php | 2 +- .../Model/Attribute/ContentLanguage.php | 2 +- .../Model/Attribute/Default.php | 9 +- .../Model/Attribute/Destinations.php | 2 +- .../Model/Attribute/GoogleProductCategory.php | 2 +- .../GoogleShopping/Model/Attribute/Id.php | 2 +- .../Model/Attribute/ImageLink.php | 2 +- .../GoogleShopping/Model/Attribute/Link.php | 2 +- .../GoogleShopping/Model/Attribute/Price.php | 10 +- .../Model/Attribute/ProductType.php | 2 +- .../Model/Attribute/Quantity.php | 2 +- .../Attribute/SalePriceEffectiveDate.php | 2 +- .../Model/Attribute/ShippingWeight.php | 2 +- .../Model/Attribute/TargetCountry.php | 2 +- .../GoogleShopping/Model/Attribute/Tax.php | 2 +- .../GoogleShopping/Model/Attribute/Title.php | 2 +- .../core/Mage/GoogleShopping/Model/Config.php | 2 +- .../core/Mage/GoogleShopping/Model/Item.php | 2 +- .../GoogleShopping/Model/MassOperations.php | 7 +- .../Mage/GoogleShopping/Model/Observer.php | 2 +- .../Model/Resource/Attribute.php | 2 +- .../Model/Resource/Attribute/Collection.php | 2 +- .../GoogleShopping/Model/Resource/Item.php | 2 +- .../Model/Resource/Item/Collection.php | 2 +- .../GoogleShopping/Model/Resource/Type.php | 2 +- .../Model/Resource/Type/Collection.php | 14 +- .../Mage/GoogleShopping/Model/Service.php | 2 +- .../GoogleShopping/Model/Service/Item.php | 2 +- .../Model/Source/Accounttype.php | 2 +- .../GoogleShopping/Model/Source/Authtype.php | 2 +- .../GoogleShopping/Model/Source/Country.php | 2 +- .../Model/Source/Destinationstates.php | 2 +- .../GoogleShopping/Model/Source/Statuses.php | 2 +- .../core/Mage/GoogleShopping/Model/Type.php | 2 +- .../Googleshopping/ItemsController.php | 4 +- .../Googleshopping/SelectionController.php | 2 +- .../Googleshopping/TypesController.php | 2 +- .../data-install-1.6.0.0.php | 2 +- .../Mage/GoogleShopping/etc/adminhtml.xml | 2 +- .../core/Mage/GoogleShopping/etc/config.xml | 2 +- .../core/Mage/GoogleShopping/etc/system.xml | 2 +- .../googleshopping_setup/install-1.6.0.0.php | 2 +- .../upgrade-1.6.0.0-1.6.0.0.1.php | 2 +- .../view/adminhtml/captcha.phtml | 2 +- .../GoogleShopping/view/adminhtml/items.phtml | 2 +- .../view/adminhtml/types/edit.phtml | 2 +- .../adminhtml/types/edit/attributes.phtml | 2 +- .../view/adminhtml/types/edit/select.phtml | 2 +- .../Block/Adminhtml/Export/Edit.php | 2 +- .../Block/Adminhtml/Export/Edit/Form.php | 2 +- .../Block/Adminhtml/Export/Filter.php | 19 +- .../Block/Adminhtml/Import/Edit.php | 2 +- .../Block/Adminhtml/Import/Edit/Form.php | 2 +- .../Block/Adminhtml/Import/Frame/Result.php | 4 +- .../core/Mage/ImportExport/Helper/Data.php | 2 +- .../core/Mage/ImportExport/Model/Abstract.php | 2 +- .../core/Mage/ImportExport/Model/Config.php | 2 +- .../core/Mage/ImportExport/Model/Export.php | 2 +- .../Model/Export/Adapter/Abstract.php | 2 +- .../ImportExport/Model/Export/Adapter/Csv.php | 2 +- .../Model/Export/Entity/Abstract.php | 2 +- .../Model/Export/Entity/Customer.php | 2 +- .../Model/Export/Entity/Product.php | 49 +- .../Export/Entity/Product/Type/Abstract.php | 2 +- .../Entity/Product/Type/Configurable.php | 2 +- .../Export/Entity/Product/Type/Grouped.php | 2 +- .../Export/Entity/Product/Type/Simple.php | 11 +- .../core/Mage/ImportExport/Model/Import.php | 2 +- .../ImportExport/Model/Import/Adapter.php | 2 +- .../Model/Import/Adapter/Abstract.php | 2 +- .../ImportExport/Model/Import/Adapter/Csv.php | 2 +- .../Model/Import/Entity/Abstract.php | 6 +- .../Model/Import/Entity/Customer.php | 2 +- .../Model/Import/Entity/Customer/Address.php | 2 +- .../Model/Import/Entity/Product.php | 121 +- .../Import/Entity/Product/Type/Abstract.php | 2 +- .../Entity/Product/Type/Configurable.php | 2 +- .../Import/Entity/Product/Type/Grouped.php | 2 +- .../Import/Entity/Product/Type/Simple.php | 2 +- .../Model/Import/Proxy/Product.php | 2 +- .../Model/Import/Proxy/Product/Resource.php | 2 +- .../ImportExport/Model/Import/Uploader.php | 2 +- .../Model/Resource/Helper/Mysql4.php | 2 +- .../Model/Resource/Import/Data.php | 2 +- .../ImportExport/Model/Resource/Setup.php | 2 +- .../Model/Source/Export/Entity.php | 2 +- .../Model/Source/Export/Format.php | 2 +- .../Model/Source/Import/Behavior.php | 2 +- .../Model/Source/Import/Entity.php | 2 +- .../Adminhtml/ExportController.php | 2 +- .../Adminhtml/ImportController.php | 2 +- .../core/Mage/ImportExport/etc/adminhtml.xml | 2 +- .../core/Mage/ImportExport/etc/config.xml | 2 +- .../importexport_setup/install-1.6.0.0.php | 2 +- .../mysql4-upgrade-1.6.0.1-1.6.0.2.php | 2 +- .../ImportExport/view/adminhtml/busy.phtml | 2 +- .../view/adminhtml/export/form/after.phtml | 4 +- .../view/adminhtml/export/form/before.phtml | 8 +- .../view/adminhtml/import/form/after.phtml | 2 +- .../view/adminhtml/import/form/before.phtml | 2 +- .../view/adminhtml/import/frame/result.phtml | 2 +- .../ImportExport/view/adminhtml/layout.xml | 2 +- .../Index/Block/Adminhtml/Notifications.php | 2 +- .../Mage/Index/Block/Adminhtml/Process.php | 2 +- .../Index/Block/Adminhtml/Process/Edit.php | 2 +- .../Block/Adminhtml/Process/Edit/Form.php | 2 +- .../Block/Adminhtml/Process/Edit/Tab/Main.php | 2 +- .../Block/Adminhtml/Process/Edit/Tabs.php | 2 +- .../Index/Block/Adminhtml/Process/Grid.php | 2 +- .../Adminhtml/Process/Grid/Massaction.php | 2 +- app/code/core/Mage/Index/Helper/Data.php | 2 +- app/code/core/Mage/Index/Model/Event.php | 103 +- app/code/core/Mage/Index/Model/Indexer.php | 25 +- .../Mage/Index/Model/Indexer/Abstract.php | 2 +- app/code/core/Mage/Index/Model/Observer.php | 2 +- app/code/core/Mage/Index/Model/Process.php | 20 +- .../Mage/Index/Model/Resource/Abstract.php | 2 +- .../core/Mage/Index/Model/Resource/Event.php | 5 +- .../Index/Model/Resource/Event/Collection.php | 2 +- .../Mage/Index/Model/Resource/Process.php | 12 +- .../Model/Resource/Process/Collection.php | 2 +- .../core/Mage/Index/Model/Resource/Setup.php | 2 +- app/code/core/Mage/Index/Model/Shell.php | 2 +- .../Adminhtml/ProcessController.php | 2 +- app/code/core/Mage/Index/etc/adminhtml.xml | 2 +- app/code/core/Mage/Index/etc/config.xml | 2 +- .../Index/sql/index_setup/install-1.6.0.0.php | 2 +- .../core/Mage/Index/view/adminhtml/layout.xml | 2 +- .../Index/view/adminhtml/notifications.phtml | 2 +- app/code/core/Mage/Install/Block/Abstract.php | 2 +- app/code/core/Mage/Install/Block/Admin.php | 2 +- app/code/core/Mage/Install/Block/Begin.php | 2 +- app/code/core/Mage/Install/Block/Config.php | 2 +- app/code/core/Mage/Install/Block/Db/Main.php | 2 +- app/code/core/Mage/Install/Block/Db/Type.php | 2 +- .../Mage/Install/Block/Db/Type/Mysql4.php | 2 +- app/code/core/Mage/Install/Block/Download.php | 2 +- app/code/core/Mage/Install/Block/End.php | 2 +- app/code/core/Mage/Install/Block/Locale.php | 2 +- app/code/core/Mage/Install/Block/State.php | 2 +- .../core/Mage/Install/Controller/Action.php | 2 +- app/code/core/Mage/Install/Helper/Data.php | 2 +- app/code/core/Mage/Install/Model/Config.php | 2 +- .../core/Mage/Install/Model/Installer.php | 2 +- .../Mage/Install/Model/Installer/Abstract.php | 2 +- .../Mage/Install/Model/Installer/Config.php | 2 +- .../Mage/Install/Model/Installer/Console.php | 2 +- .../Mage/Install/Model/Installer/Data.php | 2 +- .../core/Mage/Install/Model/Installer/Db.php | 24 +- .../Install/Model/Installer/Db/Abstract.php | 2 +- .../Install/Model/Installer/Db/Mysql4.php | 2 +- .../core/Mage/Install/Model/Installer/Env.php | 2 +- .../Install/Model/Installer/Filesystem.php | 2 +- .../Mage/Install/Model/Installer/Pear.php | 2 +- app/code/core/Mage/Install/Model/Observer.php | 2 +- app/code/core/Mage/Install/Model/Session.php | 2 +- app/code/core/Mage/Install/Model/Wizard.php | 2 +- .../Install/controllers/IndexController.php | 2 +- .../Install/controllers/WizardController.php | 2 +- app/code/core/Mage/Install/etc/config.xml | 2 +- app/code/core/Mage/Install/etc/install.xml | 2 +- .../Mage/Install/view/install/begin.phtml | 2 +- .../Mage/Install/view/install/config.phtml | 5 +- .../Install/view/install/create_admin.phtml | 2 +- .../Mage/Install/view/install/db/main.phtml | 2 +- .../Mage/Install/view/install/db/mysql4.phtml | 2 +- .../Mage/Install/view/install/download.phtml | 2 +- .../core/Mage/Install/view/install/end.phtml | 2 +- .../core/Mage/Install/view/install/layout.xml | 2 +- .../Mage/Install/view/install/locale.phtml | 2 +- .../core/Mage/Install/view/install/page.phtml | 2 +- .../Mage/Install/view/install/state.phtml | 2 +- app/code/core/Mage/Log/Helper/Data.php | 2 +- app/code/core/Mage/Log/Model/Aggregation.php | 2 +- app/code/core/Mage/Log/Model/Cron.php | 2 +- app/code/core/Mage/Log/Model/Customer.php | 2 +- app/code/core/Mage/Log/Model/Log.php | 2 +- .../Mage/Log/Model/Resource/Aggregation.php | 2 +- .../core/Mage/Log/Model/Resource/Customer.php | 2 +- .../Mage/Log/Model/Resource/Helper/Mysql4.php | 2 +- app/code/core/Mage/Log/Model/Resource/Log.php | 2 +- .../core/Mage/Log/Model/Resource/Shell.php | 2 +- .../core/Mage/Log/Model/Resource/Visitor.php | 22 +- .../Log/Model/Resource/Visitor/Collection.php | 2 +- .../Log/Model/Resource/Visitor/Online.php | 2 +- .../Resource/Visitor/Online/Collection.php | 2 +- app/code/core/Mage/Log/Model/Shell.php | 2 +- app/code/core/Mage/Log/Model/Visitor.php | 2 +- .../core/Mage/Log/Model/Visitor/Online.php | 2 +- .../data/log_setup/data-install-1.6.0.0.php | 2 +- app/code/core/Mage/Log/etc/config.xml | 2 +- app/code/core/Mage/Log/etc/system.xml | 2 +- .../Log/sql/log_setup/install-1.6.0.0.php | 2 +- app/code/core/Mage/Media/Helper/Data.php | 2 +- app/code/core/Mage/Media/Model/File/Image.php | 2 +- app/code/core/Mage/Media/Model/Image.php | 2 +- .../Media/Model/Image/Config/Interface.php | 2 +- app/code/core/Mage/Media/etc/config.xml | 2 +- .../core/Mage/Newsletter/Block/Subscribe.php | 2 +- app/code/core/Mage/Newsletter/Helper/Data.php | 2 +- .../core/Mage/Newsletter/Model/Message.php | 2 +- .../core/Mage/Newsletter/Model/Observer.php | 2 +- .../core/Mage/Newsletter/Model/Problem.php | 2 +- app/code/core/Mage/Newsletter/Model/Queue.php | 2 +- .../Newsletter/Model/Resource/Problem.php | 2 +- .../Model/Resource/Problem/Collection.php | 5 +- .../Mage/Newsletter/Model/Resource/Queue.php | 2 +- .../Model/Resource/Queue/Collection.php | 2 +- .../Newsletter/Model/Resource/Subscriber.php | 2 +- .../Model/Resource/Subscriber/Collection.php | 2 +- .../Newsletter/Model/Resource/Template.php | 2 +- .../Model/Resource/Template/Collection.php | 2 +- .../core/Mage/Newsletter/Model/Session.php | 2 +- .../core/Mage/Newsletter/Model/Subscriber.php | 2 +- .../core/Mage/Newsletter/Model/Template.php | 2 +- .../Mage/Newsletter/Model/Template/Filter.php | 2 +- .../controllers/ManageController.php | 2 +- .../controllers/SubscriberController.php | 2 +- .../data-upgrade-1.6.0.0-1.6.0.1.php | 2 +- .../core/Mage/Newsletter/etc/adminhtml.xml | 2 +- app/code/core/Mage/Newsletter/etc/config.xml | 2 +- app/code/core/Mage/Newsletter/etc/system.xml | 2 +- .../sql/newsletter_setup/install-1.6.0.0.php | 2 +- .../Mage/Newsletter/view/frontend/layout.xml | 2 +- .../Newsletter/view/frontend/subscribe.phtml | 7 +- app/code/core/Mage/Ogone/Block/Form.php | 2 +- app/code/core/Mage/Ogone/Block/Info.php | 2 +- app/code/core/Mage/Ogone/Block/Paypage.php | 2 +- app/code/core/Mage/Ogone/Block/Placeform.php | 2 +- app/code/core/Mage/Ogone/Helper/Data.php | 2 +- app/code/core/Mage/Ogone/Model/Api.php | 2 +- app/code/core/Mage/Ogone/Model/Config.php | 2 +- .../Mage/Ogone/Model/Source/PaymentAction.php | 2 +- .../core/Mage/Ogone/Model/Source/Pmlist.php | 2 +- .../core/Mage/Ogone/Model/Source/Template.php | 2 +- .../Mage/Ogone/controllers/ApiController.php | 2 +- app/code/core/Mage/Ogone/etc/config.xml | 2 +- app/code/core/Mage/Ogone/etc/system.xml | 2 +- .../Ogone/sql/ogone_setup/install-1.6.0.0.php | 2 +- .../core/Mage/Ogone/view/adminhtml/info.phtml | 2 +- .../core/Mage/Ogone/view/frontend/form.phtml | 2 +- .../core/Mage/Ogone/view/frontend/info.phtml | 2 +- .../core/Mage/Ogone/view/frontend/layout.xml | 2 +- .../Mage/Ogone/view/frontend/paypage.phtml | 2 +- .../Mage/Ogone/view/frontend/placeform.phtml | 2 +- app/code/core/Mage/Page/Block/Html.php | 2 +- .../core/Mage/Page/Block/Html/Breadcrumbs.php | 2 +- app/code/core/Mage/Page/Block/Html/Footer.php | 2 +- app/code/core/Mage/Page/Block/Html/Head.php | 5 +- app/code/core/Mage/Page/Block/Html/Header.php | 2 +- .../core/Mage/Page/Block/Html/Notices.php | 2 +- app/code/core/Mage/Page/Block/Html/Pager.php | 2 +- .../core/Mage/Page/Block/Html/Welcome.php | 2 +- .../core/Mage/Page/Block/Html/Wrapper.php | 2 +- app/code/core/Mage/Page/Block/Js/Cookie.php | 2 +- .../core/Mage/Page/Block/Js/Translate.php | 7 +- app/code/core/Mage/Page/Block/Redirect.php | 2 +- app/code/core/Mage/Page/Block/Switch.php | 21 +- .../Mage/Page/Block/Template/Container.php | 2 +- .../core/Mage/Page/Block/Template/Links.php | 2 +- .../Mage/Page/Block/Template/Links/Block.php | 2 +- app/code/core/Mage/Page/Helper/Data.php | 2 +- app/code/core/Mage/Page/Helper/Html.php | 2 +- app/code/core/Mage/Page/Helper/Layout.php | 2 +- app/code/core/Mage/Page/Model/Config.php | 2 +- .../core/Mage/Page/Model/Source/Layout.php | 2 +- app/code/core/Mage/Page/etc/config.xml | 2 +- app/code/core/Mage/Page/etc/system.xml | 2 +- .../Mage/Page/view/frontend/1column.phtml | 2 +- .../Page/view/frontend/2columns-left.phtml | 2 +- .../Page/view/frontend/2columns-right.phtml | 2 +- .../Mage/Page/view/frontend/3columns.phtml | 2 +- .../view/frontend/callouts/left_col.phtml | 2 +- .../view/frontend/callouts/right_col.phtml | 2 +- .../core/Mage/Page/view/frontend/empty.phtml | 2 +- .../Page/view/frontend/html/breadcrumbs.phtml | 2 +- .../Mage/Page/view/frontend/html/footer.phtml | 2 +- .../Mage/Page/view/frontend/html/head.phtml | 2 +- .../Mage/Page/view/frontend/html/header.phtml | 2 +- .../Page/view/frontend/html/notices.phtml | 4 +- .../Mage/Page/view/frontend/html/pager.phtml | 2 +- .../Mage/Page/view/frontend/js/calendar.phtml | 2 +- .../Mage/Page/view/frontend/js/cookie.phtml | 2 +- .../Mage/Page/view/frontend/js/cookies.js | 2 +- .../core/Mage/Page/view/frontend/layout.xml | 2 +- app/code/core/Mage/Page/view/frontend/menu.js | 2 +- .../core/Mage/Page/view/frontend/popup.phtml | 2 +- .../core/Mage/Page/view/frontend/print.phtml | 2 +- .../Mage/Page/view/frontend/redirect.phtml | 2 +- .../Page/view/frontend/switch/flags.phtml | 2 +- .../Page/view/frontend/switch/languages.phtml | 2 +- .../Page/view/frontend/switch/stores.phtml | 2 +- .../view/frontend/template/container.phtml | 2 +- .../Page/view/frontend/template/links.phtml | 2 +- .../view/frontend/template/linksblock.phtml | 2 +- .../Block/Adminhtml/Cache/Additional.php | 2 +- app/code/core/Mage/PageCache/Helper/Data.php | 2 +- .../PageCache/Model/Control/Interface.php | 2 +- .../Mage/PageCache/Model/Control/Zend.php | 2 +- .../core/Mage/PageCache/Model/Observer.php | 2 +- .../Model/System/Config/Source/Controls.php | 2 +- .../Adminhtml/PageCacheController.php | 2 +- .../core/Mage/PageCache/etc/adminhtml.xml | 2 +- app/code/core/Mage/PageCache/etc/config.xml | 2 +- app/code/core/Mage/PageCache/etc/system.xml | 2 +- .../view/adminhtml/cache/additional.phtml | 2 +- .../Mage/PageCache/view/adminhtml/layout.xml | 2 +- .../Mage/PageCache/view/frontend/cookie.phtml | 2 +- .../Mage/PageCache/view/frontend/layout.xml | 2 +- .../Paygate/Block/Authorizenet/Form/Cc.php | 2 +- .../Paygate/Block/Authorizenet/Info/Cc.php | 2 +- app/code/core/Mage/Paygate/Helper/Data.php | 12 +- .../core/Mage/Paygate/Model/Authorizenet.php | 7 +- .../Mage/Paygate/Model/Authorizenet/Cards.php | 2 +- .../Mage/Paygate/Model/Authorizenet/Debug.php | 2 +- .../Paygate/Model/Authorizenet/Request.php | 2 +- .../Paygate/Model/Authorizenet/Result.php | 2 +- .../Model/Authorizenet/Source/Cctype.php | 2 +- .../Authorizenet/Source/PaymentAction.php | 2 +- .../Model/Resource/Authorizenet/Debug.php | 2 +- .../Authorizenet/Debug/Collection.php | 2 +- .../Authorizenet/PaymentController.php | 2 +- .../Authorizenet/PaymentController.php | 2 +- app/code/core/Mage/Paygate/etc/config.xml | 2 +- app/code/core/Mage/Paygate/etc/system.xml | 2 +- .../sql/paygate_setup/install-1.6.0.0.php | 2 +- .../Mage/Paygate/view/adminhtml/form/cc.phtml | 2 +- .../Mage/Paygate/view/adminhtml/info/cc.phtml | 2 +- .../Paygate/view/adminhtml/info/pdf.phtml | 2 +- .../Mage/Paygate/view/frontend/form/cc.phtml | 2 +- .../Mage/Paygate/view/frontend/info/cc.phtml | 2 +- .../Block/Catalog/Product/View/Profile.php | 2 +- app/code/core/Mage/Payment/Block/Form.php | 2 +- app/code/core/Mage/Payment/Block/Form/Cc.php | 2 +- .../core/Mage/Payment/Block/Form/Ccsave.php | 2 +- .../core/Mage/Payment/Block/Form/Checkmo.php | 2 +- .../Mage/Payment/Block/Form/Container.php | 2 +- .../Mage/Payment/Block/Form/Purchaseorder.php | 2 +- app/code/core/Mage/Payment/Block/Info.php | 2 +- app/code/core/Mage/Payment/Block/Info/Cc.php | 2 +- .../core/Mage/Payment/Block/Info/Ccsave.php | 2 +- .../core/Mage/Payment/Block/Info/Checkmo.php | 2 +- .../Mage/Payment/Block/Info/Container.php | 2 +- .../Mage/Payment/Block/Info/Purchaseorder.php | 2 +- app/code/core/Mage/Payment/Exception.php | 2 +- app/code/core/Mage/Payment/Helper/Data.php | 2 +- .../Billing/Agreement/MethodInterface.php | 2 +- .../Model/Billing/AgreementAbstract.php | 2 +- app/code/core/Mage/Payment/Model/Config.php | 2 +- app/code/core/Mage/Payment/Model/Info.php | 2 +- .../Mage/Payment/Model/Info/Exception.php | 2 +- .../Mage/Payment/Model/Method/Abstract.php | 92 +- .../core/Mage/Payment/Model/Method/Cc.php | 52 +- .../core/Mage/Payment/Model/Method/Ccsave.php | 2 +- .../Mage/Payment/Model/Method/Checkmo.php | 2 +- .../core/Mage/Payment/Model/Method/Free.php | 4 +- .../Payment/Model/Method/Purchaseorder.php | 2 +- app/code/core/Mage/Payment/Model/Observer.php | 2 +- .../Mage/Payment/Model/Paygate/Result.php | 2 +- .../Mage/Payment/Model/Recurring/Profile.php | 2 +- .../Recurring/Profile/MethodInterface.php | 2 +- .../core/Mage/Payment/Model/Source/Cctype.php | 2 +- .../Mage/Payment/Model/Source/Invoice.php | 2 +- app/code/core/Mage/Payment/etc/adminhtml.xml | 2 +- app/code/core/Mage/Payment/etc/config.xml | 2 +- app/code/core/Mage/Payment/etc/system.xml | 9 +- .../Mage/Payment/view/adminhtml/form/cc.phtml | 2 +- .../Payment/view/adminhtml/form/ccsave.phtml | 2 +- .../Payment/view/adminhtml/form/checkmo.phtml | 2 +- .../view/adminhtml/form/purchaseorder.phtml | 2 +- .../Payment/view/adminhtml/info/checkmo.phtml | 2 +- .../Payment/view/adminhtml/info/default.phtml | 2 +- .../view/adminhtml/info/pdf/checkmo.phtml | 2 +- .../view/adminhtml/info/pdf/default.phtml | 2 +- .../adminhtml/info/pdf/purchaseorder.phtml | 2 +- .../view/adminhtml/info/purchaseorder.phtml | 2 +- .../product/view/profile/options.phtml | 2 +- .../product/view/profile/schedule.phtml | 2 +- .../Mage/Payment/view/frontend/form/cc.phtml | 2 +- .../Payment/view/frontend/form/ccsave.phtml | 2 +- .../Payment/view/frontend/form/checkmo.phtml | 2 +- .../view/frontend/form/purchaseorder.phtml | 2 +- .../Payment/view/frontend/info/checkmo.phtml | 2 +- .../Payment/view/frontend/info/default.phtml | 2 +- .../view/frontend/info/purchaseorder.phtml | 2 +- .../Mage/Payment/view/frontend/layout.xml | 2 +- .../Block/Adminhtml/Settlement/Details.php | 2 +- .../Adminhtml/Settlement/Details/Form.php | 2 +- .../Block/Adminhtml/Settlement/Report.php | 2 +- .../Adminhtml/Settlement/Report/Grid.php | 2 +- .../Adminhtml/System/Config/ApiWizard.php | 2 +- .../System/Config/Fieldset/Global.php | 2 +- .../Adminhtml/System/Config/Fieldset/Hint.php | 2 +- .../System/Config/Fieldset/Store.php | 2 +- .../System/Config/Payflowlink/Advanced.php | 2 +- .../System/Config/Payflowlink/Info.php | 2 +- .../core/Mage/Paypal/Block/Express/Form.php | 2 +- .../core/Mage/Paypal/Block/Express/Review.php | 2 +- .../Paypal/Block/Express/Review/Details.php | 2 +- .../Mage/Paypal/Block/Express/Shortcut.php | 2 +- .../Mage/Paypal/Block/Hosted/Pro/Form.php | 2 +- .../Mage/Paypal/Block/Hosted/Pro/Iframe.php | 2 +- .../Mage/Paypal/Block/Hosted/Pro/Info.php | 2 +- app/code/core/Mage/Paypal/Block/Iframe.php | 5 +- app/code/core/Mage/Paypal/Block/Logo.php | 2 +- .../Paypal/Block/Payflow/Advanced/Form.php | 4 +- .../Paypal/Block/Payflow/Advanced/Iframe.php | 11 +- .../Paypal/Block/Payflow/Advanced/Info.php | 2 +- .../Paypal/Block/Payflow/Advanced/Review.php | 3 +- .../Mage/Paypal/Block/Payflow/Link/Form.php | 4 +- .../Mage/Paypal/Block/Payflow/Link/Iframe.php | 29 +- .../Mage/Paypal/Block/Payflow/Link/Info.php | 2 +- .../Mage/Paypal/Block/Payflow/Link/Review.php | 10 +- .../core/Mage/Paypal/Block/Payment/Info.php | 2 +- .../core/Mage/Paypal/Block/Standard/Form.php | 2 +- .../Mage/Paypal/Block/Standard/Redirect.php | 2 +- .../Paypal/Controller/Express/Abstract.php | 4 +- app/code/core/Mage/Paypal/Exception.php | 2 +- app/code/core/Mage/Paypal/Helper/Data.php | 2 +- app/code/core/Mage/Paypal/Helper/Hss.php | 6 +- .../core/Mage/Paypal/Model/Api/Abstract.php | 2 +- app/code/core/Mage/Paypal/Model/Api/Nvp.php | 2 +- .../core/Mage/Paypal/Model/Api/Standard.php | 2 +- app/code/core/Mage/Paypal/Model/Cart.php | 2 +- app/code/core/Mage/Paypal/Model/Cert.php | 2 +- app/code/core/Mage/Paypal/Model/Config.php | 13 +- app/code/core/Mage/Paypal/Model/Direct.php | 2 +- app/code/core/Mage/Paypal/Model/Express.php | 2 +- .../Mage/Paypal/Model/Express/Checkout.php | 2 +- app/code/core/Mage/Paypal/Model/Hostedpro.php | 2 +- .../Mage/Paypal/Model/Hostedpro/Request.php | 2 +- app/code/core/Mage/Paypal/Model/Info.php | 2 +- app/code/core/Mage/Paypal/Model/Ipn.php | 9 +- .../Mage/Paypal/Model/Method/Agreement.php | 2 +- app/code/core/Mage/Paypal/Model/Observer.php | 29 +- .../Mage/Paypal/Model/Payflow/Request.php | 2 +- .../Mage/Paypal/Model/Payflowadvanced.php | 30 +- .../core/Mage/Paypal/Model/Payflowlink.php | 508 +- .../core/Mage/Paypal/Model/Payflowpro.php | 2 +- .../Mage/Paypal/Model/Payment/Transaction.php | 2 +- app/code/core/Mage/Paypal/Model/Pro.php | 2 +- .../Mage/Paypal/Model/Report/Settlement.php | 2 +- .../Paypal/Model/Report/Settlement/Row.php | 2 +- .../core/Mage/Paypal/Model/Resource/Cert.php | 2 +- .../Model/Resource/Payment/Transaction.php | 3 +- .../Payment/Transaction/Collection.php | 3 +- .../Model/Resource/Report/Settlement.php | 2 +- .../Model/Resource/Report/Settlement/Row.php | 2 +- .../Report/Settlement/Row/Collection.php | 2 +- .../core/Mage/Paypal/Model/Resource/Setup.php | 2 +- app/code/core/Mage/Paypal/Model/Session.php | 2 +- app/code/core/Mage/Paypal/Model/Standard.php | 2 +- .../Model/System/Config/Backend/Cert.php | 2 +- .../Model/System/Config/Backend/Cron.php | 2 +- .../System/Config/Backend/MerchantCountry.php | 2 +- .../Config/Source/AuthorizationAmounts.php | 11 +- .../System/Config/Source/BuyerCountry.php | 2 +- .../System/Config/Source/FetchingSchedule.php | 2 +- .../Model/System/Config/Source/Logo.php | 2 +- .../System/Config/Source/MerchantCountry.php | 2 +- .../System/Config/Source/PaymentActions.php | 2 +- .../Config/Source/PaymentActions/Express.php | 2 +- .../Adminhtml/Paypal/ReportsController.php | 2 +- .../Paypal/controllers/ExpressController.php | 2 +- .../controllers/HostedproController.php | 2 +- .../Mage/Paypal/controllers/IpnController.php | 2 +- .../Paypal/controllers/PayflowController.php | 145 +- .../controllers/PayflowadvancedController.php | 147 +- .../Paypal/controllers/StandardController.php | 2 +- app/code/core/Mage/Paypal/etc/adminhtml.xml | 2 +- app/code/core/Mage/Paypal/etc/config.xml | 10 +- app/code/core/Mage/Paypal/etc/system.xml | 24 +- .../sql/paypal_setup/install-1.6.0.0.php | 2 +- .../paypal_setup/upgrade-1.6.0.0-1.6.0.1.php | 2 +- .../paypal_setup/upgrade-1.6.0.1-1.6.0.2.php | 2 +- .../core/Mage/Paypal/view/adminhtml/boxes.css | 2 +- .../Mage/Paypal/view/adminhtml/layout.xml | 2 +- .../adminhtml/system/config/api_wizard.phtml | 6 +- .../system/config/fieldset/global.phtml | 2 +- .../system/config/fieldset/hint.phtml | 2 +- .../system/config/fieldset/store.phtml | 2 +- .../system/config/payflowlink/advanced.phtml | 8 +- .../system/config/payflowlink/info.phtml | 32 +- .../Paypal/view/frontend/express/review.phtml | 2 +- .../frontend/express/review/details.phtml | 2 +- .../view/frontend/express/shortcut.phtml | 2 +- .../Mage/Paypal/view/frontend/hss/form.phtml | 2 +- .../Paypal/view/frontend/hss/iframe.phtml | 2 +- .../Mage/Paypal/view/frontend/hss/info.phtml | 2 +- .../Mage/Paypal/view/frontend/hss/js.phtml | 2 +- .../Paypal/view/frontend/hss/redirect.phtml | 5 +- .../view/frontend/hss/review/button.phtml | 2 +- .../core/Mage/Paypal/view/frontend/layout.xml | 54 +- .../Paypal/view/frontend/partner/logo.phtml | 2 +- .../view/frontend/payflowadvanced/form.phtml | 2 +- .../frontend/payflowadvanced/iframe.phtml | 99 +- .../view/frontend/payflowadvanced/info.phtml | 20 +- .../frontend/payflowadvanced/redirect.phtml | 79 +- .../view/frontend/payflowlink/form.phtml | 2 +- .../view/frontend/payflowlink/iframe.phtml | 99 +- .../view/frontend/payflowlink/info.phtml | 20 +- .../view/frontend/payflowlink/redirect.phtml | 79 +- .../Paypal/view/frontend/payment/mark.phtml | 2 +- .../view/frontend/payment/redirect.phtml | 2 +- .../core/Mage/Paypal/view/frontend/review.js | 2 +- .../core/Mage/PaypalUk/Block/Express/Form.php | 2 +- .../Mage/PaypalUk/Block/Express/Shortcut.php | 2 +- app/code/core/Mage/PaypalUk/Helper/Data.php | 2 +- app/code/core/Mage/PaypalUk/Model/Api/Nvp.php | 87 +- app/code/core/Mage/PaypalUk/Model/Direct.php | 2 +- app/code/core/Mage/PaypalUk/Model/Express.php | 2 +- .../Mage/PaypalUk/Model/Express/Checkout.php | 2 +- app/code/core/Mage/PaypalUk/Model/Pro.php | 2 +- app/code/core/Mage/PaypalUk/Model/Session.php | 2 +- .../controllers/ExpressController.php | 2 +- app/code/core/Mage/PaypalUk/etc/config.xml | 2 +- .../sql/paypaluk_setup/install-1.6.0.0.php | 2 +- .../Mage/PaypalUk/view/frontend/layout.xml | 2 +- .../Mage/Persistent/Block/Form/Remember.php | 2 +- .../Persistent/Block/Header/Additional.php | 2 +- app/code/core/Mage/Persistent/Helper/Data.php | 2 +- .../core/Mage/Persistent/Helper/Session.php | 16 +- .../core/Mage/Persistent/Model/Observer.php | 10 +- .../Persistent/Model/Observer/Session.php | 2 +- .../Persistent/Model/Persistent/Config.php | 2 +- .../Persistent/Model/Resource/Session.php | 7 +- .../core/Mage/Persistent/Model/Session.php | 2 +- .../controllers/IndexController.php | 2 +- .../core/Mage/Persistent/etc/adminhtml.xml | 2 +- app/code/core/Mage/Persistent/etc/config.xml | 2 +- .../core/Mage/Persistent/etc/persistent.xml | 2 +- app/code/core/Mage/Persistent/etc/system.xml | 2 +- .../sql/persistent_setup/install-1.0.0.0.php | 2 +- .../frontend/checkout/onepage/billing.phtml | 9 +- .../frontend/checkout/onepage/login.phtml | 3 +- .../view/frontend/customer/form/login.phtml | 3 +- .../frontend/customer/form/register.phtml | 3 +- .../Mage/Persistent/view/frontend/layout.xml | 2 +- .../view/frontend/remember_me.phtml | 2 +- .../view/frontend/remember_me_tooltip.phtml | 2 +- app/code/core/Mage/Poll/Block/ActivePoll.php | 2 +- app/code/core/Mage/Poll/Helper/Data.php | 2 +- app/code/core/Mage/Poll/Model/Poll.php | 2 +- app/code/core/Mage/Poll/Model/Poll/Answer.php | 2 +- app/code/core/Mage/Poll/Model/Poll/Vote.php | 2 +- .../core/Mage/Poll/Model/Resource/Poll.php | 2 +- .../Mage/Poll/Model/Resource/Poll/Answer.php | 2 +- .../Model/Resource/Poll/Answer/Collection.php | 2 +- .../Poll/Model/Resource/Poll/Collection.php | 2 +- .../Mage/Poll/Model/Resource/Poll/Vote.php | 2 +- .../Mage/Poll/controllers/VoteController.php | 2 +- .../data/poll_setup/data-install-1.6.0.0.php | 2 +- app/code/core/Mage/Poll/etc/adminhtml.xml | 2 +- app/code/core/Mage/Poll/etc/config.xml | 2 +- app/code/core/Mage/Poll/etc/system.xml | 2 +- .../Poll/sql/poll_setup/install-1.6.0.0.php | 2 +- .../core/Mage/Poll/view/frontend/active.phtml | 2 +- .../core/Mage/Poll/view/frontend/layout.xml | 2 +- .../core/Mage/Poll/view/frontend/result.phtml | 2 +- .../ProductAlert/Block/Email/Abstract.php | 2 +- .../Mage/ProductAlert/Block/Email/Price.php | 2 +- .../Mage/ProductAlert/Block/Email/Stock.php | 2 +- .../Mage/ProductAlert/Block/Product/View.php | 2 +- .../core/Mage/ProductAlert/Helper/Data.php | 29 +- .../core/Mage/ProductAlert/Model/Email.php | 2 +- .../core/Mage/ProductAlert/Model/Observer.php | 2 +- .../core/Mage/ProductAlert/Model/Price.php | 2 +- .../ProductAlert/Model/Resource/Abstract.php | 2 +- .../ProductAlert/Model/Resource/Price.php | 2 +- .../Model/Resource/Price/Collection.php | 2 +- .../Resource/Price/Customer/Collection.php | 2 +- .../ProductAlert/Model/Resource/Stock.php | 2 +- .../Model/Resource/Stock/Collection.php | 2 +- .../Resource/Stock/Customer/Collection.php | 2 +- .../core/Mage/ProductAlert/Model/Stock.php | 2 +- .../controllers/AddController.php | 8 +- .../controllers/UnsubscribeController.php | 2 +- .../core/Mage/ProductAlert/etc/config.xml | 2 +- .../core/Mage/ProductAlert/etc/system.xml | 2 +- .../productalert_setup/install-1.6.0.0.php | 2 +- .../view/frontend/email/price.phtml | 2 +- .../view/frontend/email/stock.phtml | 2 +- .../ProductAlert/view/frontend/layout.xml | 2 +- .../view/frontend/product/view.phtml | 2 +- .../Mage/Rating/Block/Entity/Detailed.php | 2 +- app/code/core/Mage/Rating/Helper/Data.php | 2 +- app/code/core/Mage/Rating/Model/Observer.php | 2 +- app/code/core/Mage/Rating/Model/Rating.php | 2 +- .../core/Mage/Rating/Model/Rating/Entity.php | 2 +- .../core/Mage/Rating/Model/Rating/Option.php | 2 +- .../Mage/Rating/Model/Rating/Option/Vote.php | 2 +- .../Mage/Rating/Model/Resource/Rating.php | 2 +- .../Model/Resource/Rating/Collection.php | 2 +- .../Rating/Model/Resource/Rating/Entity.php | 2 +- .../Rating/Model/Resource/Rating/Option.php | 2 +- .../Resource/Rating/Option/Collection.php | 2 +- .../Model/Resource/Rating/Option/Vote.php | 2 +- .../Rating/Option/Vote/Collection.php | 2 +- .../rating_setup/data-install-1.6.0.0.php | 2 +- app/code/core/Mage/Rating/etc/adminhtml.xml | 2 +- app/code/core/Mage/Rating/etc/config.xml | 2 +- .../sql/rating_setup/install-1.6.0.0.php | 2 +- .../Mage/Rating/view/frontend/detailed.phtml | 2 +- .../Mage/Rating/view/frontend/empty.phtml | 2 +- .../Mage/Reports/Block/Product/Abstract.php | 2 +- .../Mage/Reports/Block/Product/Compared.php | 2 +- .../Mage/Reports/Block/Product/Viewed.php | 2 +- .../Reports/Block/Product/Widget/Compared.php | 2 +- .../Reports/Block/Product/Widget/Viewed.php | 2 +- app/code/core/Mage/Reports/Exception.php | 2 +- app/code/core/Mage/Reports/Helper/Data.php | 2 +- app/code/core/Mage/Reports/Model/Config.php | 2 +- app/code/core/Mage/Reports/Model/Event.php | 2 +- .../Mage/Reports/Model/Event/Observer.php | 2 +- .../core/Mage/Reports/Model/Event/Type.php | 2 +- app/code/core/Mage/Reports/Model/Flag.php | 3 +- .../Mage/Reports/Model/Grouped/Collection.php | 2 +- .../Reports/Model/Product/Index/Abstract.php | 2 +- .../Reports/Model/Product/Index/Compared.php | 2 +- .../Reports/Model/Product/Index/Viewed.php | 2 +- app/code/core/Mage/Reports/Model/Report.php | 2 +- .../Model/Resource/Accounts/Collection.php | 2 +- .../Model/Resource/Customer/Collection.php | 2 +- .../Resource/Customer/Orders/Collection.php | 2 +- .../Resource/Customer/Totals/Collection.php | 2 +- .../Entity/Summary/Collection/Abstract.php | 2 +- .../Mage/Reports/Model/Resource/Event.php | 2 +- .../Model/Resource/Event/Collection.php | 2 +- .../Reports/Model/Resource/Event/Type.php | 2 +- .../Model/Resource/Event/Type/Collection.php | 2 +- .../Model/Resource/Helper/Interface.php | 51 + .../Reports/Model/Resource/Helper/Mysql4.php | 70 +- .../Model/Resource/Order/Collection.php | 2 +- .../Model/Resource/Product/Collection.php | 2 +- .../Resource/Product/Downloads/Collection.php | 2 +- .../Model/Resource/Product/Index/Abstract.php | 2 +- .../Product/Index/Collection/Abstract.php | 2 +- .../Model/Resource/Product/Index/Compared.php | 2 +- .../Product/Index/Compared/Collection.php | 2 +- .../Model/Resource/Product/Index/Viewed.php | 2 +- .../Product/Index/Viewed/Collection.php | 2 +- .../Resource/Product/Lowstock/Collection.php | 2 +- .../Resource/Product/Ordered/Collection.php | 2 +- .../Resource/Product/Sold/Collection.php | 2 +- .../Resource/Product/Viewed/Collection.php | 2 +- .../Model/Resource/Quote/Collection.php | 2 +- .../Model/Resource/Report/Abstract.php | 14 +- .../Model/Resource/Report/Collection.php | 2 +- .../Resource/Report/Collection/Abstract.php | 287 + .../Model/Resource/Report/Product/Viewed.php | 212 + .../Report/Product/Viewed/Collection.php | 367 ++ .../Model/Resource/Review/Collection.php | 2 +- .../Resource/Review/Customer/Collection.php | 2 +- .../Resource/Review/Product/Collection.php | 2 +- .../Resource/Shopcart/Product/Collection.php | 2 +- .../Reports/Model/Resource/Tag/Collection.php | 7 +- .../Resource/Tag/Customer/Collection.php | 2 +- .../Model/Resource/Tag/Product/Collection.php | 2 +- .../Model/Resource/Wishlist/Collection.php | 2 +- .../Resource/Wishlist/Product/Collection.php | 2 +- app/code/core/Mage/Reports/Model/Session.php | 2 +- app/code/core/Mage/Reports/Model/Test.php | 2 +- app/code/core/Mage/Reports/Model/Totals.php | 2 +- .../reports_setup/data-install-1.6.0.0.php | 2 +- app/code/core/Mage/Reports/etc/adminhtml.xml | 6 +- app/code/core/Mage/Reports/etc/config.xml | 6 +- app/code/core/Mage/Reports/etc/system.xml | 2 +- app/code/core/Mage/Reports/etc/widget.xml | 2 +- .../sql/reports_setup/install-1.6.0.0.php | 2 +- .../reports_setup/mysql4-install-1.6.0.0.php | 2 +- .../upgrade-1.6.0.0-1.6.0.0.1.php | 99 + .../view/frontend/home_product_compared.phtml | 2 +- .../view/frontend/home_product_viewed.phtml | 2 +- .../Mage/Reports/view/frontend/layout.xml | 2 +- .../view/frontend/product_compared.phtml | 2 +- .../view/frontend/product_viewed.phtml | 2 +- .../column/compared_default_list.phtml | 2 +- .../column/compared_images_list.phtml | 2 +- .../compared/column/compared_names_list.phtml | 2 +- .../compared/content/compared_grid.phtml | 2 +- .../compared/content/compared_list.phtml | 2 +- .../viewed/column/viewed_default_list.phtml | 2 +- .../viewed/column/viewed_images_list.phtml | 2 +- .../viewed/column/viewed_names_list.phtml | 2 +- .../widget/viewed/content/viewed_grid.phtml | 2 +- .../widget/viewed/content/viewed_list.phtml | 2 +- .../Mage/Reports/view/frontend/widgets.css | 2 +- .../core/Mage/Review/Block/Customer/List.php | 58 +- .../Mage/Review/Block/Customer/Recent.php | 2 +- .../core/Mage/Review/Block/Customer/View.php | 2 +- app/code/core/Mage/Review/Block/Form.php | 2 +- app/code/core/Mage/Review/Block/Helper.php | 2 +- .../core/Mage/Review/Block/Product/View.php | 2 +- .../Mage/Review/Block/Product/View/List.php | 2 +- app/code/core/Mage/Review/Block/View.php | 2 +- app/code/core/Mage/Review/Helper/Data.php | 2 +- app/code/core/Mage/Review/Model/Observer.php | 2 +- .../Mage/Review/Model/Resource/Review.php | 2 +- .../Model/Resource/Review/Collection.php | 2 +- .../Resource/Review/Product/Collection.php | 7 +- .../Review/Model/Resource/Review/Status.php | 2 +- .../Resource/Review/Status/Collection.php | 2 +- .../Review/Model/Resource/Review/Summary.php | 2 +- .../Resource/Review/Summary/Collection.php | 2 +- app/code/core/Mage/Review/Model/Review.php | 10 +- .../core/Mage/Review/Model/Review/Status.php | 2 +- .../core/Mage/Review/Model/Review/Summary.php | 2 +- app/code/core/Mage/Review/Model/Session.php | 2 +- .../Review/controllers/CustomerController.php | 2 +- .../Review/controllers/ProductController.php | 10 +- .../review_setup/data-install-1.6.0.0.php | 2 +- app/code/core/Mage/Review/etc/adminhtml.xml | 2 +- app/code/core/Mage/Review/etc/config.xml | 2 +- app/code/core/Mage/Review/etc/system.xml | 2 +- .../sql/review_setup/install-1.6.0.0.php | 2 +- .../Review/view/frontend/customer/list.phtml | 2 +- .../view/frontend/customer/recent.phtml | 2 +- .../Review/view/frontend/customer/view.phtml | 2 +- .../core/Mage/Review/view/frontend/form.phtml | 2 +- .../Review/view/frontend/helper/summary.phtml | 2 +- .../view/frontend/helper/summary_short.phtml | 2 +- .../core/Mage/Review/view/frontend/layout.xml | 2 +- .../view/frontend/product/view/count.phtml | 2 +- .../view/frontend/product/view/list.phtml | 2 +- .../view/frontend/product/view/other.phtml | 2 +- .../core/Mage/Review/view/frontend/view.phtml | 2 +- app/code/core/Mage/Rss/Block/Abstract.php | 2 +- .../core/Mage/Rss/Block/Catalog/Abstract.php | 2 +- .../core/Mage/Rss/Block/Catalog/Category.php | 2 +- app/code/core/Mage/Rss/Block/Catalog/New.php | 31 +- .../Mage/Rss/Block/Catalog/NotifyStock.php | 8 +- .../core/Mage/Rss/Block/Catalog/Review.php | 8 +- .../core/Mage/Rss/Block/Catalog/Salesrule.php | 74 +- .../core/Mage/Rss/Block/Catalog/Special.php | 2 +- app/code/core/Mage/Rss/Block/Catalog/Tag.php | 2 +- app/code/core/Mage/Rss/Block/List.php | 2 +- .../core/Mage/Rss/Block/Order/Details.php | 2 +- app/code/core/Mage/Rss/Block/Order/New.php | 2 +- app/code/core/Mage/Rss/Block/Order/Status.php | 2 +- app/code/core/Mage/Rss/Block/Wishlist.php | 2 +- app/code/core/Mage/Rss/Helper/Catalog.php | 2 +- app/code/core/Mage/Rss/Helper/Data.php | 2 +- app/code/core/Mage/Rss/Helper/Order.php | 2 +- app/code/core/Mage/Rss/Model/Observer.php | 2 +- .../core/Mage/Rss/Model/Resource/Order.php | 2 +- app/code/core/Mage/Rss/Model/Rss.php | 2 +- app/code/core/Mage/Rss/Model/Session.php | 2 +- .../Rss/Model/System/Config/Backend/Links.php | 2 +- .../Rss/controllers/CatalogController.php | 2 +- .../Mage/Rss/controllers/IndexController.php | 2 +- .../Mage/Rss/controllers/OrderController.php | 2 +- app/code/core/Mage/Rss/etc/adminhtml.xml | 2 +- app/code/core/Mage/Rss/etc/config.xml | 10 +- app/code/core/Mage/Rss/etc/system.xml | 2 +- .../core/Mage/Rss/view/adminhtml/layout.xml | 2 +- .../core/Mage/Rss/view/frontend/layout.xml | 2 +- .../core/Mage/Rss/view/frontend/list.phtml | 2 +- .../core/Mage/Rss/view/frontend/nofeed.phtml | 2 +- .../Rss/view/frontend/order/details.phtml | 2 +- app/code/core/Mage/Rule/Block/Actions.php | 2 +- app/code/core/Mage/Rule/Block/Conditions.php | 2 +- app/code/core/Mage/Rule/Block/Editable.php | 2 +- app/code/core/Mage/Rule/Block/Newchild.php | 2 +- app/code/core/Mage/Rule/Block/Rule.php | 2 +- app/code/core/Mage/Rule/Helper/Data.php | 2 +- app/code/core/Mage/Rule/Model/Abstract.php | 502 ++ .../core/Mage/Rule/Model/Action/Abstract.php | 6 +- .../Mage/Rule/Model/Action/Collection.php | 2 +- .../core/Mage/Rule/Model/Action/Interface.php | 2 +- .../Mage/Rule/Model/Condition/Abstract.php | 12 +- .../Mage/Rule/Model/Condition/Combine.php | 9 +- .../Mage/Rule/Model/Condition/Interface.php | 2 +- .../Rule/Model/Condition/Product/Abstract.php | 513 ++ .../core/Mage/Rule/Model/Renderer/Actions.php | 2 +- .../Mage/Rule/Model/Renderer/Conditions.php | 2 +- .../Mage/Rule/Model/Resource/Abstract.php | 250 + .../Resource/Rule/Collection/Abstract.php | 236 + app/code/core/Mage/Rule/Model/Rule.php | 335 +- app/code/core/Mage/Rule/etc/config.xml | 2 +- .../Block/Adminhtml/Billing/Agreement.php | 2 +- .../Adminhtml/Billing/Agreement/Grid.php | 2 +- .../Adminhtml/Billing/Agreement/View.php | 2 +- .../Adminhtml/Billing/Agreement/View/Form.php | 2 +- .../Billing/Agreement/View/Tab/Info.php | 2 +- .../Billing/Agreement/View/Tab/Orders.php | 2 +- .../Adminhtml/Billing/Agreement/View/Tabs.php | 2 +- .../Adminhtml/Customer/Edit/Tab/Agreement.php | 2 +- .../Customer/Edit/Tab/Recurring/Profile.php | 2 +- .../Block/Adminhtml/Recurring/Profile.php | 2 +- .../Adminhtml/Recurring/Profile/Edit/Form.php | 2 +- .../Adminhtml/Recurring/Profile/Grid.php | 2 +- .../Adminhtml/Recurring/Profile/View.php | 2 +- .../Recurring/Profile/View/Getawayinfo.php | 2 +- .../Adminhtml/Recurring/Profile/View/Info.php | 2 +- .../Recurring/Profile/View/Items.php | 2 +- .../Recurring/Profile/View/Tab/Info.php | 2 +- .../Recurring/Profile/View/Tab/Orders.php | 2 +- .../Block/Adminhtml/Report/Filter/Form.php | 2 +- .../Adminhtml/Report/Filter/Form/Coupon.php | 89 + .../Adminhtml/Report/Filter/Form/Order.php | 2 +- .../Sales/Block/Billing/Agreement/View.php | 2 +- .../Mage/Sales/Block/Billing/Agreements.php | 2 +- .../core/Mage/Sales/Block/Guest/Links.php | 2 +- .../core/Mage/Sales/Block/Items/Abstract.php | 2 +- .../core/Mage/Sales/Block/Order/Comments.php | 2 +- .../Mage/Sales/Block/Order/Creditmemo.php | 2 +- .../Sales/Block/Order/Creditmemo/Items.php | 2 +- .../Sales/Block/Order/Creditmemo/Totals.php | 2 +- .../Block/Order/Email/Creditmemo/Items.php | 2 +- .../Sales/Block/Order/Email/Invoice/Items.php | 2 +- .../Mage/Sales/Block/Order/Email/Items.php | 2 +- .../Sales/Block/Order/Email/Items/Default.php | 2 +- .../Block/Order/Email/Items/Order/Default.php | 2 +- .../Block/Order/Email/Items/Order/Grouped.php | 2 +- .../Block/Order/Email/Shipment/Items.php | 2 +- .../core/Mage/Sales/Block/Order/History.php | 2 +- app/code/core/Mage/Sales/Block/Order/Info.php | 2 +- .../Mage/Sales/Block/Order/Info/Buttons.php | 2 +- .../core/Mage/Sales/Block/Order/Invoice.php | 2 +- .../Mage/Sales/Block/Order/Invoice/Items.php | 2 +- .../Mage/Sales/Block/Order/Invoice/Totals.php | 2 +- .../Block/Order/Item/Renderer/Default.php | 2 +- .../Block/Order/Item/Renderer/Grouped.php | 2 +- .../core/Mage/Sales/Block/Order/Items.php | 2 +- .../core/Mage/Sales/Block/Order/Print.php | 2 +- .../Sales/Block/Order/Print/Creditmemo.php | 2 +- .../Mage/Sales/Block/Order/Print/Invoice.php | 2 +- .../Mage/Sales/Block/Order/Print/Shipment.php | 2 +- .../core/Mage/Sales/Block/Order/Recent.php | 2 +- .../core/Mage/Sales/Block/Order/Shipment.php | 2 +- .../Mage/Sales/Block/Order/Shipment/Items.php | 2 +- .../core/Mage/Sales/Block/Order/Totals.php | 2 +- app/code/core/Mage/Sales/Block/Order/View.php | 2 +- .../Block/Payment/Form/Billing/Agreement.php | 2 +- .../Block/Payment/Info/Billing/Agreement.php | 2 +- .../Sales/Block/Recurring/Profile/View.php | 2 +- .../Mage/Sales/Block/Recurring/Profiles.php | 2 +- .../core/Mage/Sales/Block/Reorder/Sidebar.php | 32 +- .../Mage/Sales/Block/Widget/Guest/Form.php | 2 +- .../core/Mage/Sales/Controller/Abstract.php | 2 +- app/code/core/Mage/Sales/Exception.php | 2 +- app/code/core/Mage/Sales/Helper/Data.php | 2 +- app/code/core/Mage/Sales/Helper/Guest.php | 2 +- app/code/core/Mage/Sales/Helper/Reorder.php | 2 +- app/code/core/Mage/Sales/Model/Abstract.php | 2 +- .../core/Mage/Sales/Model/Api/Resource.php | 2 +- .../Mage/Sales/Model/Billing/Agreement.php | 2 +- app/code/core/Mage/Sales/Model/Config.php | 2 +- .../core/Mage/Sales/Model/Convert/Order.php | 2 +- .../core/Mage/Sales/Model/Convert/Quote.php | 2 +- .../core/Mage/Sales/Model/Email/Template.php | 2 +- app/code/core/Mage/Sales/Model/Observer.php | 186 +- app/code/core/Mage/Sales/Model/Order.php | 2 +- .../core/Mage/Sales/Model/Order/Address.php | 2 +- app/code/core/Mage/Sales/Model/Order/Api.php | 2 +- .../core/Mage/Sales/Model/Order/Api/V2.php | 2 +- .../core/Mage/Sales/Model/Order/Config.php | 8 +- .../Mage/Sales/Model/Order/Creditmemo.php | 32 +- .../Mage/Sales/Model/Order/Creditmemo/Api.php | 2 +- .../Sales/Model/Order/Creditmemo/Api/V2.php | 2 +- .../Sales/Model/Order/Creditmemo/Comment.php | 2 +- .../Sales/Model/Order/Creditmemo/Config.php | 2 +- .../Sales/Model/Order/Creditmemo/Item.php | 60 +- .../Model/Order/Creditmemo/Total/Abstract.php | 2 +- .../Model/Order/Creditmemo/Total/Cost.php | 2 +- .../Model/Order/Creditmemo/Total/Discount.php | 30 +- .../Model/Order/Creditmemo/Total/Grand.php | 2 +- .../Model/Order/Creditmemo/Total/Shipping.php | 2 +- .../Model/Order/Creditmemo/Total/Subtotal.php | 6 +- .../Model/Order/Creditmemo/Total/Tax.php | 69 +- .../core/Mage/Sales/Model/Order/Invoice.php | 28 +- .../Mage/Sales/Model/Order/Invoice/Api.php | 2 +- .../Mage/Sales/Model/Order/Invoice/Api/V2.php | 2 +- .../Sales/Model/Order/Invoice/Comment.php | 2 +- .../Mage/Sales/Model/Order/Invoice/Config.php | 2 +- .../Mage/Sales/Model/Order/Invoice/Item.php | 27 +- .../Model/Order/Invoice/Total/Abstract.php | 2 +- .../Sales/Model/Order/Invoice/Total/Cost.php | 2 +- .../Model/Order/Invoice/Total/Discount.php | 19 +- .../Sales/Model/Order/Invoice/Total/Grand.php | 2 +- .../Model/Order/Invoice/Total/Shipping.php | 2 +- .../Model/Order/Invoice/Total/Subtotal.php | 31 +- .../Sales/Model/Order/Invoice/Total/Tax.php | 33 +- app/code/core/Mage/Sales/Model/Order/Item.php | 8 +- .../core/Mage/Sales/Model/Order/Payment.php | 9 +- .../Sales/Model/Order/Payment/Transaction.php | 2 +- .../Mage/Sales/Model/Order/Pdf/Abstract.php | 6 +- .../Mage/Sales/Model/Order/Pdf/Creditmemo.php | 2 +- .../Mage/Sales/Model/Order/Pdf/Invoice.php | 2 +- .../Sales/Model/Order/Pdf/Items/Abstract.php | 44 +- .../Order/Pdf/Items/Creditmemo/Default.php | 36 +- .../Order/Pdf/Items/Creditmemo/Grouped.php | 2 +- .../Model/Order/Pdf/Items/Invoice/Default.php | 58 +- .../Model/Order/Pdf/Items/Invoice/Grouped.php | 2 +- .../Order/Pdf/Items/Shipment/Default.php | 2 +- .../Mage/Sales/Model/Order/Pdf/Shipment.php | 2 +- .../Model/Order/Pdf/Shipment/Packaging.php | 2 +- .../Sales/Model/Order/Pdf/Total/Default.php | 2 +- .../core/Mage/Sales/Model/Order/Shipment.php | 2 +- .../Mage/Sales/Model/Order/Shipment/Api.php | 2 +- .../Sales/Model/Order/Shipment/Api/V2.php | 2 +- .../Sales/Model/Order/Shipment/Comment.php | 2 +- .../Mage/Sales/Model/Order/Shipment/Item.php | 2 +- .../Mage/Sales/Model/Order/Shipment/Track.php | 2 +- .../core/Mage/Sales/Model/Order/Status.php | 2 +- .../Mage/Sales/Model/Order/Status/History.php | 2 +- app/code/core/Mage/Sales/Model/Order/Tax.php | 2 +- .../core/Mage/Sales/Model/Order/Total.php | 2 +- .../Method/Billing/AgreementAbstract.php | 2 +- app/code/core/Mage/Sales/Model/Quote.php | 98 +- .../core/Mage/Sales/Model/Quote/Address.php | 19 +- .../Mage/Sales/Model/Quote/Address/Item.php | 2 +- .../Mage/Sales/Model/Quote/Address/Rate.php | 2 +- .../Mage/Sales/Model/Quote/Address/Total.php | 2 +- .../Model/Quote/Address/Total/Abstract.php | 2 +- .../Model/Quote/Address/Total/Collector.php | 2 +- .../Model/Quote/Address/Total/Custbalance.php | 2 +- .../Model/Quote/Address/Total/Discount.php | 7 +- .../Sales/Model/Quote/Address/Total/Grand.php | 4 +- .../Sales/Model/Quote/Address/Total/Msrp.php | 2 +- .../Model/Quote/Address/Total/Nominal.php | 2 +- .../Quote/Address/Total/Nominal/Collector.php | 2 +- .../Total/Nominal/Recurring/Initial.php | 2 +- .../Address/Total/Nominal/Recurring/Trial.php | 2 +- .../Total/Nominal/RecurringAbstract.php | 2 +- .../Quote/Address/Total/Nominal/Shipping.php | 2 +- .../Quote/Address/Total/Nominal/Subtotal.php | 2 +- .../Model/Quote/Address/Total/Shipping.php | 2 +- .../Model/Quote/Address/Total/Subtotal.php | 2 +- .../Sales/Model/Quote/Address/Total/Tax.php | 2 +- .../core/Mage/Sales/Model/Quote/Config.php | 2 +- app/code/core/Mage/Sales/Model/Quote/Item.php | 2 +- .../Mage/Sales/Model/Quote/Item/Abstract.php | 2 +- .../Mage/Sales/Model/Quote/Item/Option.php | 2 +- .../core/Mage/Sales/Model/Quote/Payment.php | 2 +- .../Mage/Sales/Model/Recurring/Profile.php | 2 +- .../Mage/Sales/Model/Resource/Abstract.php | 2 +- .../Model/Resource/Billing/Agreement.php | 2 +- .../Resource/Billing/Agreement/Collection.php | 2 +- .../Model/Resource/Collection/Abstract.php | 2 +- .../Sales/Model/Resource/Helper/Interface.php | 49 + .../Sales/Model/Resource/Helper/Mysql4.php | 56 +- .../core/Mage/Sales/Model/Resource/Order.php | 2 +- .../Sales/Model/Resource/Order/Abstract.php | 31 +- .../Sales/Model/Resource/Order/Address.php | 31 +- .../Resource/Order/Address/Collection.php | 2 +- .../Order/Attribute/Backend/Billing.php | 2 +- .../Order/Attribute/Backend/Child.php | 2 +- .../Order/Attribute/Backend/Parent.php | 2 +- .../Order/Attribute/Backend/Shipping.php | 2 +- .../Sales/Model/Resource/Order/Collection.php | 2 +- .../Resource/Order/Collection/Abstract.php | 2 +- .../Order/Comment/Collection/Abstract.php | 2 +- .../Sales/Model/Resource/Order/Creditmemo.php | 2 +- .../Creditmemo/Attribute/Backend/Child.php | 2 +- .../Creditmemo/Attribute/Backend/Parent.php | 2 +- .../Resource/Order/Creditmemo/Collection.php | 2 +- .../Resource/Order/Creditmemo/Comment.php | 2 +- .../Order/Creditmemo/Comment/Collection.php | 2 +- .../Order/Creditmemo/Grid/Collection.php | 2 +- .../Model/Resource/Order/Creditmemo/Item.php | 2 +- .../Order/Creditmemo/Item/Collection.php | 2 +- .../Model/Resource/Order/Grid/Collection.php | 2 +- .../Sales/Model/Resource/Order/Invoice.php | 2 +- .../Order/Invoice/Attribute/Backend/Child.php | 2 +- .../Order/Invoice/Attribute/Backend/Item.php | 2 +- .../Order/Invoice/Attribute/Backend/Order.php | 2 +- .../Invoice/Attribute/Backend/Parent.php | 2 +- .../Resource/Order/Invoice/Collection.php | 2 +- .../Model/Resource/Order/Invoice/Comment.php | 2 +- .../Order/Invoice/Comment/Collection.php | 2 +- .../Order/Invoice/Grid/Collection.php | 2 +- .../Model/Resource/Order/Invoice/Item.php | 2 +- .../Order/Invoice/Item/Collection.php | 2 +- .../Mage/Sales/Model/Resource/Order/Item.php | 2 +- .../Model/Resource/Order/Item/Collection.php | 2 +- .../Sales/Model/Resource/Order/Payment.php | 2 +- .../Resource/Order/Payment/Collection.php | 2 +- .../Resource/Order/Payment/Transaction.php | 2 +- .../Order/Payment/Transaction/Collection.php | 2 +- .../Sales/Model/Resource/Order/Shipment.php | 2 +- .../Shipment/Attribute/Backend/Child.php | 2 +- .../Shipment/Attribute/Backend/Parent.php | 2 +- .../Resource/Order/Shipment/Collection.php | 2 +- .../Model/Resource/Order/Shipment/Comment.php | 2 +- .../Order/Shipment/Comment/Collection.php | 2 +- .../Order/Shipment/Grid/Collection.php | 2 +- .../Model/Resource/Order/Shipment/Item.php | 2 +- .../Order/Shipment/Item/Collection.php | 2 +- .../Model/Resource/Order/Shipment/Track.php | 2 +- .../Order/Shipment/Track/Collection.php | 2 +- .../Sales/Model/Resource/Order/Status.php | 2 +- .../Resource/Order/Status/Collection.php | 2 +- .../Model/Resource/Order/Status/History.php | 2 +- .../Order/Status/History/Collection.php | 2 +- .../Mage/Sales/Model/Resource/Order/Tax.php | 2 +- .../Model/Resource/Order/Tax/Collection.php | 2 +- .../core/Mage/Sales/Model/Resource/Quote.php | 2 +- .../Sales/Model/Resource/Quote/Address.php | 2 +- .../Quote/Address/Attribute/Backend.php | 2 +- .../Quote/Address/Attribute/Backend/Child.php | 2 +- .../Address/Attribute/Backend/Parent.php | 2 +- .../Address/Attribute/Backend/Region.php | 2 +- .../Quote/Address/Attribute/Frontend.php | 2 +- .../Attribute/Frontend/Custbalance.php | 2 +- .../Address/Attribute/Frontend/Discount.php | 9 +- .../Address/Attribute/Frontend/Grand.php | 2 +- .../Address/Attribute/Frontend/Shipping.php | 2 +- .../Address/Attribute/Frontend/Subtotal.php | 2 +- .../Quote/Address/Attribute/Frontend/Tax.php | 2 +- .../Resource/Quote/Address/Collection.php | 2 +- .../Model/Resource/Quote/Address/Item.php | 2 +- .../Quote/Address/Item/Collection.php | 2 +- .../Model/Resource/Quote/Address/Rate.php | 2 +- .../Quote/Address/Rate/Collection.php | 2 +- .../Sales/Model/Resource/Quote/Collection.php | 2 +- .../Mage/Sales/Model/Resource/Quote/Item.php | 2 +- .../Model/Resource/Quote/Item/Collection.php | 2 +- .../Model/Resource/Quote/Item/Option.php | 2 +- .../Resource/Quote/Item/Option/Collection.php | 2 +- .../Sales/Model/Resource/Quote/Payment.php | 2 +- .../Resource/Quote/Payment/Collection.php | 2 +- .../Model/Resource/Recurring/Profile.php | 2 +- .../Resource/Recurring/Profile/Collection.php | 2 +- .../core/Mage/Sales/Model/Resource/Report.php | 2 +- .../Sales/Model/Resource/Report/Abstract.php | 2 +- .../Model/Resource/Report/Bestsellers.php | 2 +- .../Report/Bestsellers/Collection.php | 7 +- .../Resource/Report/Collection/Abstract.php | 244 +- .../Sales/Model/Resource/Report/Invoiced.php | 2 +- .../Report/Invoiced/Collection/Invoiced.php | 2 +- .../Report/Invoiced/Collection/Order.php | 2 +- .../Sales/Model/Resource/Report/Order.php | 2 +- .../Resource/Report/Order/Collection.php | 2 +- .../Model/Resource/Report/Order/Createdat.php | 2 +- .../Model/Resource/Report/Order/Updatedat.php | 2 +- .../Report/Order/Updatedat/Collection.php | 2 +- .../Sales/Model/Resource/Report/Refunded.php | 2 +- .../Report/Refunded/Collection/Order.php | 2 +- .../Report/Refunded/Collection/Refunded.php | 2 +- .../Sales/Model/Resource/Report/Shipping.php | 2 +- .../Report/Shipping/Collection/Order.php | 2 +- .../Report/Shipping/Collection/Shipment.php | 2 +- .../Sales/Model/Resource/Sale/Collection.php | 2 +- .../core/Mage/Sales/Model/Resource/Setup.php | 2 +- .../core/Mage/Sales/Model/Service/Order.php | 2 +- .../core/Mage/Sales/Model/Service/Quote.php | 11 +- .../core/Mage/Sales/Model/Status/List.php | 2 +- .../Billing/AgreementController.php | 2 +- .../Sales/controllers/DownloadController.php | 2 +- .../Sales/controllers/GuestController.php | 2 +- .../Sales/controllers/OrderController.php | 2 +- .../Recurring/ProfileController.php | 2 +- .../data/sales_setup/data-install-1.6.0.0.php | 2 +- .../data-upgrade-1.6.0.4-1.6.0.5.php | 76 + app/code/core/Mage/Sales/etc/adminhtml.xml | 2 +- app/code/core/Mage/Sales/etc/api.xml | 2 +- app/code/core/Mage/Sales/etc/config.xml | 30 +- app/code/core/Mage/Sales/etc/fieldset.xml | 2 +- app/code/core/Mage/Sales/etc/system.xml | 2 +- app/code/core/Mage/Sales/etc/widget.xml | 2 +- .../Sales/sql/sales_setup/install-1.6.0.0.php | 2 +- .../sales_setup/upgrade-1.6.0.0-1.6.0.1.php | 2 +- .../sales_setup/upgrade-1.6.0.1-1.6.0.2.php | 2 +- .../sales_setup/upgrade-1.6.0.2-1.6.0.3.php | 2 +- .../sales_setup/upgrade-1.6.0.3-1.6.0.4.php | 2 +- .../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 + .../adminhtml/billing/agreement/form.phtml | 2 +- .../billing/agreement/view/form.phtml | 2 +- .../billing/agreement/view/tab/info.phtml | 2 +- .../payment/form/billing/agreement.phtml | 2 +- .../adminhtml/recurring/profile/view.phtml | 2 +- .../recurring/profile/view/info.phtml | 2 +- .../frontend/billing/agreement/view.phtml | 2 +- .../view/frontend/billing/agreements.phtml | 2 +- .../Sales/view/frontend/billing_agreement.xml | 2 +- .../frontend/email/creditmemo/items.phtml | 2 +- .../view/frontend/email/invoice/items.phtml | 2 +- .../Sales/view/frontend/email/items.phtml | 2 +- .../email/items/creditmemo/default.phtml | 2 +- .../email/items/invoice/default.phtml | 2 +- .../frontend/email/items/order/default.phtml | 2 +- .../email/items/shipment/default.phtml | 2 +- .../view/frontend/email/shipment/items.phtml | 2 +- .../view/frontend/email/shipment/track.phtml | 2 +- .../Mage/Sales/view/frontend/guest/form.phtml | 2 +- .../core/Mage/Sales/view/frontend/layout.xml | 2 +- .../Sales/view/frontend/order/comments.phtml | 2 +- .../view/frontend/order/creditmemo.phtml | 2 +- .../frontend/order/creditmemo/items.phtml | 2 +- .../creditmemo/items/renderer/default.phtml | 2 +- .../Sales/view/frontend/order/history.phtml | 2 +- .../Mage/Sales/view/frontend/order/info.phtml | 2 +- .../view/frontend/order/info/buttons.phtml | 2 +- .../Sales/view/frontend/order/invoice.phtml | 2 +- .../view/frontend/order/invoice/items.phtml | 2 +- .../invoice/items/renderer/default.phtml | 2 +- .../Sales/view/frontend/order/items.phtml | 2 +- .../order/items/renderer/default.phtml | 2 +- .../Sales/view/frontend/order/print.phtml | 2 +- .../frontend/order/print/creditmemo.phtml | 2 +- .../view/frontend/order/print/invoice.phtml | 2 +- .../view/frontend/order/print/shipment.phtml | 2 +- .../Sales/view/frontend/order/recent.phtml | 2 +- .../Sales/view/frontend/order/shipment.phtml | 2 +- .../view/frontend/order/shipment/items.phtml | 2 +- .../shipment/items/renderer/default.phtml | 2 +- .../Sales/view/frontend/order/totals.phtml | 6 +- .../view/frontend/order/trackinginfo.phtml | 2 +- .../Mage/Sales/view/frontend/order/view.phtml | 2 +- .../payment/form/billing/agreement.phtml | 2 +- .../Sales/view/frontend/recurring/grid.phtml | 2 +- .../frontend/recurring/profile/view.phtml | 2 +- .../recurring/profile/view/info.phtml | 2 +- .../view/frontend/recurring/profiles.phtml | 2 +- .../Sales/view/frontend/recurring_profile.xml | 2 +- .../Sales/view/frontend/reorder/sidebar.phtml | 2 +- .../view/frontend/widget/guest/form.phtml | 2 +- app/code/core/Mage/SalesRule/Exception.php | 2 +- .../core/Mage/SalesRule/Helper/Coupon.php | 147 + app/code/core/Mage/SalesRule/Helper/Data.php | 2 +- app/code/core/Mage/SalesRule/Model/Coupon.php | 19 +- .../SalesRule/Model/Coupon/Codegenerator.php | 2 +- .../Model/Coupon/CodegeneratorInterface.php | 2 +- .../SalesRule/Model/Coupon/Massgenerator.php | 194 + .../core/Mage/SalesRule/Model/Observer.php | 40 +- .../Mage/SalesRule/Model/Quote/Discount.php | 6 +- .../SalesRule/Model/Quote/Freeshipping.php | 2 +- .../Model/Quote/Nominal/Discount.php | 2 +- .../Mage/SalesRule/Model/Resource/Coupon.php | 69 +- .../Model/Resource/Coupon/Collection.php | 28 +- .../SalesRule/Model/Resource/Coupon/Usage.php | 2 +- .../Model/Resource/Report/Collection.php | 59 +- .../SalesRule/Model/Resource/Report/Rule.php | 31 +- .../Model/Resource/Report/Rule/Createdat.php | 9 +- .../Model/Resource/Report/Rule/Updatedat.php | 2 +- .../Resource/Report/Updatedat/Collection.php | 2 +- .../Mage/SalesRule/Model/Resource/Rule.php | 186 +- .../Model/Resource/Rule/Collection.php | 153 +- .../Model/Resource/Rule/Customer.php | 2 +- .../Resource/Rule/Customer/Collection.php | 2 +- app/code/core/Mage/SalesRule/Model/Rule.php | 336 +- .../Model/Rule/Action/Collection.php | 2 +- .../SalesRule/Model/Rule/Action/Product.php | 2 +- .../Model/Rule/Condition/Address.php | 2 +- .../Model/Rule/Condition/Combine.php | 2 +- .../Model/Rule/Condition/Product.php | 18 +- .../Model/Rule/Condition/Product/Combine.php | 2 +- .../Model/Rule/Condition/Product/Found.php | 12 +- .../Rule/Condition/Product/Subselect.php | 37 +- .../Mage/SalesRule/Model/Rule/Customer.php | 2 +- .../System/Config/Source/Coupon/Format.php | 54 + .../core/Mage/SalesRule/Model/Validator.php | 10 +- .../core/Mage/SalesRule/etc/adminhtml.xml | 16 +- app/code/core/Mage/SalesRule/etc/config.xml | 30 +- app/code/core/Mage/SalesRule/etc/fieldset.xml | 2 +- app/code/core/Mage/SalesRule/etc/system.xml | 95 + .../sql/salesrule_setup/install-1.6.0.0.php | 2 +- .../upgrade-1.6.0.0-1.6.0.1.php | 2 +- .../upgrade-1.6.0.1-1.6.0.2.php | 145 + .../upgrade-1.6.0.2-1.6.0.3.php | 182 + app/code/core/Mage/Sendfriend/Block/Send.php | 2 +- app/code/core/Mage/Sendfriend/Helper/Data.php | 2 +- .../core/Mage/Sendfriend/Model/Observer.php | 2 +- .../Sendfriend/Model/Resource/Sendfriend.php | 2 +- .../Model/Resource/Sendfriend/Collection.php | 2 +- .../Mage/Sendfriend/Model/Resource/Setup.php | 2 +- .../core/Mage/Sendfriend/Model/Sendfriend.php | 2 +- .../controllers/ProductController.php | 2 +- app/code/core/Mage/Sendfriend/etc/config.xml | 2 +- app/code/core/Mage/Sendfriend/etc/system.xml | 2 +- .../sql/sendfriend_setup/install-1.6.0.0.php | 2 +- .../Mage/Sendfriend/view/frontend/layout.xml | 2 +- .../Mage/Sendfriend/view/frontend/send.phtml | 2 +- .../Mage/Shipping/Block/Tracking/Ajax.php | 2 +- .../Mage/Shipping/Block/Tracking/Popup.php | 2 +- app/code/core/Mage/Shipping/Exception.php | 2 +- app/code/core/Mage/Shipping/Helper/Data.php | 2 +- .../Mage/Shipping/Model/Carrier/Abstract.php | 89 +- .../Mage/Shipping/Model/Carrier/Flatrate.php | 2 +- .../Shipping/Model/Carrier/Freeshipping.php | 12 +- .../Mage/Shipping/Model/Carrier/Interface.php | 2 +- .../Mage/Shipping/Model/Carrier/Pickup.php | 2 +- .../Mage/Shipping/Model/Carrier/Tablerate.php | 2 +- app/code/core/Mage/Shipping/Model/Config.php | 2 +- app/code/core/Mage/Shipping/Model/Info.php | 2 +- .../Mage/Shipping/Model/Rate/Abstract.php | 2 +- .../core/Mage/Shipping/Model/Rate/Request.php | 2 +- .../core/Mage/Shipping/Model/Rate/Result.php | 2 +- .../Shipping/Model/Rate/Result/Abstract.php | 2 +- .../Mage/Shipping/Model/Rate/Result/Error.php | 2 +- .../Shipping/Model/Rate/Result/Method.php | 2 +- .../Model/Resource/Carrier/Tablerate.php | 23 +- .../Resource/Carrier/Tablerate/Collection.php | 2 +- .../Mage/Shipping/Model/Shipment/Request.php | 2 +- .../Mage/Shipping/Model/Shipment/Return.php | 2 +- .../core/Mage/Shipping/Model/Shipping.php | 6 +- .../Shipping/Model/Source/HandlingAction.php | 2 +- .../Shipping/Model/Source/HandlingType.php | 2 +- .../Mage/Shipping/Model/Tracking/Result.php | 2 +- .../Model/Tracking/Result/Abstract.php | 2 +- .../Shipping/Model/Tracking/Result/Error.php | 2 +- .../Shipping/Model/Tracking/Result/Status.php | 2 +- .../controllers/TrackingController.php | 2 +- app/code/core/Mage/Shipping/etc/adminhtml.xml | 2 +- app/code/core/Mage/Shipping/etc/config.xml | 2 +- app/code/core/Mage/Shipping/etc/system.xml | 2 +- .../sql/shipping_setup/install-1.6.0.0.php | 2 +- .../Mage/Shipping/view/frontend/layout.xml | 2 +- .../view/frontend/tracking/ajax.phtml | 2 +- .../view/frontend/tracking/popup.phtml | 2 +- app/code/core/Mage/Sitemap/Helper/Data.php | 2 +- app/code/core/Mage/Sitemap/Model/Observer.php | 2 +- .../Model/Resource/Catalog/Category.php | 2 +- .../Model/Resource/Catalog/Product.php | 2 +- .../Mage/Sitemap/Model/Resource/Cms/Page.php | 2 +- .../Mage/Sitemap/Model/Resource/Sitemap.php | 2 +- .../Model/Resource/Sitemap/Collection.php | 2 +- app/code/core/Mage/Sitemap/Model/Sitemap.php | 2 +- app/code/core/Mage/Sitemap/etc/adminhtml.xml | 2 +- app/code/core/Mage/Sitemap/etc/config.xml | 2 +- app/code/core/Mage/Sitemap/etc/system.xml | 2 +- .../sql/sitemap_setup/install-1.6.0.0.php | 2 +- app/code/core/Mage/Tag/Block/All.php | 2 +- .../core/Mage/Tag/Block/Customer/Recent.php | 2 +- .../core/Mage/Tag/Block/Customer/Tags.php | 2 +- .../core/Mage/Tag/Block/Customer/View.php | 2 +- app/code/core/Mage/Tag/Block/Popular.php | 2 +- app/code/core/Mage/Tag/Block/Product/List.php | 2 +- .../core/Mage/Tag/Block/Product/Result.php | 2 +- app/code/core/Mage/Tag/Helper/Data.php | 2 +- app/code/core/Mage/Tag/Model/Api.php | 2 +- app/code/core/Mage/Tag/Model/Api/V2.php | 2 +- .../Tag/Model/Entity/Customer/Collection.php | 2 +- .../core/Mage/Tag/Model/Indexer/Summary.php | 2 +- .../Model/Resource/Customer/Collection.php | 2 +- .../Tag/Model/Resource/Indexer/Summary.php | 10 +- .../Tag/Model/Resource/Popular/Collection.php | 2 +- .../Tag/Model/Resource/Product/Collection.php | 2 +- app/code/core/Mage/Tag/Model/Resource/Tag.php | 4 +- .../Tag/Model/Resource/Tag/Collection.php | 2 +- .../Mage/Tag/Model/Resource/Tag/Relation.php | 6 +- app/code/core/Mage/Tag/Model/Session.php | 2 +- app/code/core/Mage/Tag/Model/Tag.php | 2 +- app/code/core/Mage/Tag/Model/Tag/Relation.php | 2 +- .../Tag/controllers/CustomerController.php | 2 +- .../Mage/Tag/controllers/IndexController.php | 21 +- .../Mage/Tag/controllers/ListController.php | 2 +- .../Tag/controllers/ProductController.php | 2 +- app/code/core/Mage/Tag/etc/adminhtml.xml | 2 +- app/code/core/Mage/Tag/etc/api.xml | 2 +- app/code/core/Mage/Tag/etc/config.xml | 2 +- app/code/core/Mage/Tag/etc/view.xml | 2 +- .../Tag/sql/tag_setup/install-1.6.0.0.php | 2 +- .../core/Mage/Tag/view/frontend/cloud.phtml | 2 +- .../Tag/view/frontend/customer/recent.phtml | 2 +- .../Tag/view/frontend/customer/tags.phtml | 2 +- .../Tag/view/frontend/customer/view.phtml | 2 +- .../core/Mage/Tag/view/frontend/layout.xml | 2 +- .../core/Mage/Tag/view/frontend/list.phtml | 2 +- .../core/Mage/Tag/view/frontend/popular.phtml | 2 +- .../Adminhtml/Frontend/Region/Updater.php | 2 +- .../core/Mage/Tax/Block/Checkout/Discount.php | 2 +- .../Mage/Tax/Block/Checkout/Grandtotal.php | 2 +- .../core/Mage/Tax/Block/Checkout/Shipping.php | 2 +- .../core/Mage/Tax/Block/Checkout/Subtotal.php | 2 +- app/code/core/Mage/Tax/Block/Checkout/Tax.php | 2 +- .../core/Mage/Tax/Block/Sales/Order/Tax.php | 2 +- app/code/core/Mage/Tax/Exception.php | 2 +- app/code/core/Mage/Tax/Helper/Data.php | 2 +- app/code/core/Mage/Tax/Model/Calculation.php | 4 +- .../core/Mage/Tax/Model/Calculation/Rate.php | 2 +- .../Mage/Tax/Model/Calculation/Rate/Title.php | 2 +- .../core/Mage/Tax/Model/Calculation/Rule.php | 2 +- app/code/core/Mage/Tax/Model/Class.php | 2 +- .../Mage/Tax/Model/Class/Source/Customer.php | 2 +- .../Mage/Tax/Model/Class/Source/Product.php | 2 +- app/code/core/Mage/Tax/Model/Config.php | 2 +- .../Mage/Tax/Model/Config/Price/Include.php | 2 +- app/code/core/Mage/Tax/Model/Observer.php | 2 +- .../Mage/Tax/Model/Resource/Calculation.php | 2 +- .../Model/Resource/Calculation/Collection.php | 2 +- .../Tax/Model/Resource/Calculation/Rate.php | 2 +- .../Resource/Calculation/Rate/Collection.php | 2 +- .../Model/Resource/Calculation/Rate/Title.php | 2 +- .../Calculation/Rate/Title/Collection.php | 2 +- .../Tax/Model/Resource/Calculation/Rule.php | 2 +- .../Resource/Calculation/Rule/Collection.php | 2 +- .../core/Mage/Tax/Model/Resource/Class.php | 2 +- .../Tax/Model/Resource/Class/Collection.php | 2 +- .../Tax/Model/Resource/Report/Collection.php | 2 +- .../Mage/Tax/Model/Resource/Report/Tax.php | 2 +- .../Model/Resource/Report/Tax/Createdat.php | 2 +- .../Model/Resource/Report/Tax/Updatedat.php | 2 +- .../Resource/Report/Updatedat/Collection.php | 2 +- .../Tax/Model/Resource/Sales/Order/Tax.php | 2 +- .../Resource/Sales/Order/Tax/Collection.php | 2 +- .../Model/Resource/Sales/Order/Tax/Item.php | 2 +- .../Sales/Order/Tax/Item/Collection.php | 2 +- .../core/Mage/Tax/Model/Resource/Setup.php | 2 +- .../core/Mage/Tax/Model/Sales/Order/Tax.php | 2 +- .../Mage/Tax/Model/Sales/Order/Tax/Item.php | 2 +- .../Mage/Tax/Model/Sales/Pdf/Grandtotal.php | 2 +- .../Mage/Tax/Model/Sales/Pdf/Shipping.php | 2 +- .../Mage/Tax/Model/Sales/Pdf/Subtotal.php | 2 +- .../core/Mage/Tax/Model/Sales/Pdf/Tax.php | 2 +- .../Tax/Model/Sales/Total/Quote/Discount.php | 2 +- .../Sales/Total/Quote/Nominal/Subtotal.php | 2 +- .../Model/Sales/Total/Quote/Nominal/Tax.php | 2 +- .../Tax/Model/Sales/Total/Quote/Shipping.php | 2 +- .../Tax/Model/Sales/Total/Quote/Subtotal.php | 22 +- .../Mage/Tax/Model/Sales/Total/Quote/Tax.php | 12 +- .../Model/System/Config/Source/Algorithm.php | 2 +- .../Tax/Model/System/Config/Source/Apply.php | 2 +- .../Model/System/Config/Source/PriceType.php | 2 +- .../System/Config/Source/Tax/Country.php | 2 +- .../System/Config/Source/Tax/Display/Type.php | 2 +- .../Model/System/Config/Source/Tax/Region.php | 2 +- .../data/tax_setup/data-install-1.6.0.0.php | 2 +- app/code/core/Mage/Tax/etc/adminhtml.xml | 2 +- app/code/core/Mage/Tax/etc/config.xml | 2 +- app/code/core/Mage/Tax/etc/fieldset.xml | 2 +- app/code/core/Mage/Tax/etc/system.xml | 2 +- .../Tax/sql/tax_setup/install-1.6.0.0.php | 2 +- .../sql/tax_setup/upgrade-1.6.0.0-1.6.0.1.php | 2 +- .../sql/tax_setup/upgrade-1.6.0.1-1.6.0.2.php | 2 +- .../sql/tax_setup/upgrade-1.6.0.2-1.6.0.3.php | 2 +- .../Tax/view/frontend/checkout/discount.phtml | 2 +- .../view/frontend/checkout/grandtotal.phtml | 2 +- .../Tax/view/frontend/checkout/shipping.phtml | 2 +- .../Tax/view/frontend/checkout/subtotal.phtml | 2 +- .../Mage/Tax/view/frontend/checkout/tax.phtml | 2 +- .../Mage/Tax/view/frontend/order/tax.phtml | 2 +- .../Usa/Block/Adminhtml/Dhl/Unitofmeasure.php | 82 + app/code/core/Mage/Usa/Helper/Data.php | 2 +- .../Usa/Model/Shipping/Carrier/Abstract.php | 6 +- .../Mage/Usa/Model/Shipping/Carrier/Dhl.php | 19 +- .../Shipping/Carrier/Dhl/International.php | 1646 ++++++ .../Dhl/International/Source/Contenttype.php | 50 + .../International/Source/Method/Abstract.php | 72 + .../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 + .../Model/Shipping/Carrier/Dhl/Label/Pdf.php | 104 + .../Shipping/Carrier/Dhl/Label/Pdf/Page.php | 150 + .../Carrier/Dhl/Label/Pdf/PageBuilder.php | 627 +++ .../Carrier/Dhl/Source/Dutypaymenttype.php | 2 +- .../Carrier/Dhl/Source/Freemethod.php | 2 +- .../Shipping/Carrier/Dhl/Source/Method.php | 2 +- .../Dhl/Source/Protection/Rounding.php | 2 +- .../Carrier/Dhl/Source/Protection/Value.php | 2 +- .../Carrier/Dhl/Source/Shipmenttype.php | 2 +- .../Mage/Usa/Model/Shipping/Carrier/Fedex.php | 46 +- .../Shipping/Carrier/Fedex/Source/Dropoff.php | 2 +- .../Carrier/Fedex/Source/Freemethod.php | 2 +- .../Shipping/Carrier/Fedex/Source/Method.php | 2 +- .../Carrier/Fedex/Source/Packaging.php | 2 +- .../Mage/Usa/Model/Shipping/Carrier/Ups.php | 11 +- .../Shipping/Carrier/Ups/Source/Container.php | 2 +- .../Shipping/Carrier/Ups/Source/DestType.php | 2 +- .../Carrier/Ups/Source/Freemethod.php | 2 +- .../Shipping/Carrier/Ups/Source/Method.php | 2 +- .../Shipping/Carrier/Ups/Source/Mode.php | 2 +- .../Carrier/Ups/Source/OriginShipment.php | 2 +- .../Shipping/Carrier/Ups/Source/Pickup.php | 2 +- .../Shipping/Carrier/Ups/Source/Type.php | 2 +- .../Carrier/Ups/Source/Unitofmeasure.php | 2 +- .../Mage/Usa/Model/Shipping/Carrier/Usps.php | 8 +- .../Carrier/Usps/Source/Container.php | 2 +- .../Carrier/Usps/Source/Freemethod.php | 2 +- .../Carrier/Usps/Source/Machinable.php | 2 +- .../Shipping/Carrier/Usps/Source/Method.php | 2 +- .../Shipping/Carrier/Usps/Source/Size.php | 2 +- app/code/core/Mage/Usa/etc/config.xml | 26 +- .../Usa/etc/dhl/international/countries.xml | 1553 +++++ app/code/core/Mage/Usa/etc/system.xml | 287 +- .../Usa/sql/usa_setup/install-1.6.0.0.php | 2 +- .../sql/usa_setup/upgrade-1.6.0.0-1.6.0.1.php | 2 +- .../core/Mage/Usa/view/adminhtml/dhl/logo.jpg | Bin 0 -> 9166 bytes .../view/adminhtml/dhl/unitofmeasure.phtml | 53 + .../core/Mage/Weee/Block/Element/Weee/Tax.php | 2 +- .../Mage/Weee/Block/Renderer/Weee/Tax.php | 2 +- app/code/core/Mage/Weee/Helper/Data.php | 2 +- .../Weee/Model/Attribute/Backend/Weee/Tax.php | 2 +- .../Mage/Weee/Model/Config/Source/Display.php | 2 +- app/code/core/Mage/Weee/Model/Observer.php | 32 +- .../Resource/Attribute/Backend/Weee/Tax.php | 2 +- .../core/Mage/Weee/Model/Resource/Setup.php | 2 +- .../core/Mage/Weee/Model/Resource/Tax.php | 2 +- app/code/core/Mage/Weee/Model/Tax.php | 25 +- .../Mage/Weee/Model/Total/Creditmemo/Weee.php | 2 +- .../Mage/Weee/Model/Total/Invoice/Weee.php | 2 +- .../Weee/Model/Total/Quote/Nominal/Weee.php | 2 +- .../core/Mage/Weee/Model/Total/Quote/Weee.php | 2 +- app/code/core/Mage/Weee/etc/config.xml | 2 +- app/code/core/Mage/Weee/etc/fieldset.xml | 2 +- app/code/core/Mage/Weee/etc/system.xml | 2 +- .../Weee/sql/weee_setup/install-1.6.0.0.php | 2 +- .../Weee/view/adminhtml/renderer/tax.phtml | 4 +- .../core/Mage/Weee/view/frontend/layout.xml | 2 +- .../Mage/Weee/view/frontend/tax_toggle.js | 2 +- .../Mage/Widget/Block/Adminhtml/Widget.php | 9 +- .../Widget/Block/Adminhtml/Widget/Chooser.php | 29 +- .../Widget/Block/Adminhtml/Widget/Form.php | 2 +- .../Block/Adminhtml/Widget/Instance.php | 2 +- .../Block/Adminhtml/Widget/Instance/Edit.php | 2 +- .../Widget/Instance/Edit/Chooser/Block.php | 9 +- .../Widget/Instance/Edit/Chooser/Layout.php | 2 +- .../Widget/Instance/Edit/Chooser/Template.php | 2 +- .../Adminhtml/Widget/Instance/Edit/Form.php | 2 +- .../Widget/Instance/Edit/Tab/Main.php | 2 +- .../Widget/Instance/Edit/Tab/Main/Layout.php | 2 +- .../Widget/Instance/Edit/Tab/Properties.php | 2 +- .../Widget/Instance/Edit/Tab/Settings.php | 2 +- .../Adminhtml/Widget/Instance/Edit/Tabs.php | 2 +- .../Block/Adminhtml/Widget/Instance/Grid.php | 2 +- .../Widget/Block/Adminhtml/Widget/Options.php | 2 +- app/code/core/Mage/Widget/Block/Interface.php | 2 +- app/code/core/Mage/Widget/Helper/Data.php | 2 +- app/code/core/Mage/Widget/Model/Observer.php | 2 +- .../Mage/Widget/Model/Resource/Widget.php | 2 +- .../Widget/Model/Resource/Widget/Instance.php | 2 +- .../Resource/Widget/Instance/Collection.php | 10 +- .../Mage/Widget/Model/Template/Filter.php | 2 +- app/code/core/Mage/Widget/Model/Widget.php | 2 +- .../core/Mage/Widget/Model/Widget/Config.php | 2 +- .../Mage/Widget/Model/Widget/Instance.php | 4 +- .../Adminhtml/Widget/InstanceController.php | 25 +- .../Adminhtml/WidgetController.php | 2 +- app/code/core/Mage/Widget/etc/adminhtml.xml | 2 +- app/code/core/Mage/Widget/etc/config.xml | 2 +- app/code/core/Mage/Widget/etc/translater.xml | 34 + .../sql/widget_setup/install-1.6.0.0.php | 2 +- .../view/adminhtml/instance/edit/layout.phtml | 52 +- .../Widget/view/adminhtml/instance/js.phtml | 2 +- .../Mage/Widget/view/adminhtml/layout.xml | 2 +- .../core/Mage/Widget/view/frontend/layout.xml | 2 +- .../Mage/Widget/view/frontend/widgets.css | 2 +- .../core/Mage/Wishlist/Block/Abstract.php | 2 +- .../Mage/Wishlist/Block/Customer/Sharing.php | 2 +- .../Mage/Wishlist/Block/Customer/Sidebar.php | 2 +- .../Mage/Wishlist/Block/Customer/Wishlist.php | 2 +- .../Block/Customer/Wishlist/Item/Options.php | 2 +- .../Mage/Wishlist/Block/Item/Configure.php | 2 +- app/code/core/Mage/Wishlist/Block/Links.php | 2 +- .../Mage/Wishlist/Block/Render/Item/Price.php | 2 +- .../Mage/Wishlist/Block/Share/Email/Items.php | 2 +- .../Mage/Wishlist/Block/Share/Email/Rss.php | 2 +- .../Mage/Wishlist/Block/Share/Wishlist.php | 2 +- .../Mage/Wishlist/Controller/Abstract.php | 2 +- app/code/core/Mage/Wishlist/Helper/Data.php | 2 +- app/code/core/Mage/Wishlist/Model/Config.php | 2 +- .../Wishlist/Model/Config/Source/Summary.php | 2 +- app/code/core/Mage/Wishlist/Model/Item.php | 16 +- .../core/Mage/Wishlist/Model/Item/Option.php | 2 +- .../core/Mage/Wishlist/Model/Observer.php | 2 +- .../Mage/Wishlist/Model/Resource/Item.php | 2 +- .../Model/Resource/Item/Collection.php | 2 +- .../Wishlist/Model/Resource/Item/Option.php | 2 +- .../Model/Resource/Item/Option/Collection.php | 2 +- .../Mage/Wishlist/Model/Resource/Wishlist.php | 2 +- .../Model/Resource/Wishlist/Collection.php | 2 +- app/code/core/Mage/Wishlist/Model/Session.php | 2 +- .../core/Mage/Wishlist/Model/Wishlist.php | 2 +- .../Wishlist/controllers/IndexController.php | 6 +- .../Wishlist/controllers/SharedController.php | 2 +- app/code/core/Mage/Wishlist/etc/adminhtml.xml | 2 +- app/code/core/Mage/Wishlist/etc/config.xml | 2 +- app/code/core/Mage/Wishlist/etc/system.xml | 2 +- app/code/core/Mage/Wishlist/etc/view.xml | 2 +- .../sql/wishlist_setup/install-1.6.0.0.php | 2 +- .../Wishlist/view/frontend/email/items.phtml | 2 +- .../Wishlist/view/frontend/email/rss.phtml | 2 +- .../view/frontend/item/configure/addto.phtml | 2 +- .../Mage/Wishlist/view/frontend/layout.xml | 2 +- .../Wishlist/view/frontend/options_list.phtml | 2 +- .../view/frontend/render/item/price.phtml | 2 +- .../render/item/price_msrp_item.phtml | 2 +- .../frontend/render/item/price_msrp_rss.phtml | 2 +- .../Mage/Wishlist/view/frontend/shared.phtml | 2 +- .../Mage/Wishlist/view/frontend/sharing.phtml | 2 +- .../Mage/Wishlist/view/frontend/sidebar.phtml | 2 +- .../Mage/Wishlist/view/frontend/view.phtml | 2 +- .../XmlConnect/Block/Adminhtml/History.php | 2 +- .../Block/Adminhtml/History/Grid.php | 2 +- .../XmlConnect/Block/Adminhtml/Mobile.php | 2 +- .../Block/Adminhtml/Mobile/Edit.php | 2 +- .../Block/Adminhtml/Mobile/Edit/Form.php | 2 +- .../Adminhtml/Mobile/Edit/Submission.php | 2 +- .../Block/Adminhtml/Mobile/Edit/Tab/Cache.php | 2 +- .../Adminhtml/Mobile/Edit/Tab/Content.php | 2 +- .../Adminhtml/Mobile/Edit/Tab/Design.php | 2 +- .../Mobile/Edit/Tab/Design/Accordion.php | 2 +- .../Edit/Tab/Design/Accordion/Images.php | 2 +- .../Mobile/Edit/Tab/Design/Accordion/Tabs.php | 2 +- .../Edit/Tab/Design/Accordion/Themes.php | 2 +- .../Mobile/Edit/Tab/Design/Preview.php | 2 +- .../Mobile/Edit/Tab/Design/Themes.php | 2 +- .../Mobile/Edit/Tab/Flurryanalytics.php | 2 +- .../Adminhtml/Mobile/Edit/Tab/General.php | 2 +- .../Mobile/Edit/Tab/Notification.php | 2 +- .../Adminhtml/Mobile/Edit/Tab/Payment.php | 2 +- .../Adminhtml/Mobile/Edit/Tab/Settings.php | 2 +- .../Adminhtml/Mobile/Edit/Tab/Social.php | 2 +- .../Mobile/Edit/Tab/Submission/History.php | 2 +- .../Block/Adminhtml/Mobile/Edit/Tabs.php | 2 +- .../Adminhtml/Mobile/Form/Element/Addrow.php | 6 +- .../Adminhtml/Mobile/Form/Element/Color.php | 2 +- .../Adminhtml/Mobile/Form/Element/Country.php | 2 +- .../Mobile/Form/Element/Datetime.php | 2 +- .../Adminhtml/Mobile/Form/Element/Font.php | 2 +- .../Adminhtml/Mobile/Form/Element/Image.php | 2 +- .../Adminhtml/Mobile/Form/Element/Page.php | 6 +- .../Adminhtml/Mobile/Form/Element/Tabs.php | 2 +- .../Adminhtml/Mobile/Form/Element/Theme.php | 2 +- .../Block/Adminhtml/Mobile/Grid.php | 2 +- .../Adminhtml/Mobile/Grid/Renderer/Bool.php | 2 +- .../Adminhtml/Mobile/Grid/Renderer/Type.php | 2 +- .../Adminhtml/Mobile/Preview/Content.php | 2 +- .../Adminhtml/Mobile/Preview/Tabitems.php | 2 +- .../Block/Adminhtml/Mobile/Submission.php | 2 +- .../Adminhtml/Mobile/Submission/Form.php | 2 +- .../Renderer/Country/Androidmarket.php | 2 +- .../Submission/Renderer/Country/Istore.php | 2 +- .../Mobile/Submission/Tab/Container.php | 2 +- .../Submission/Tab/Container/Submission.php | 2 +- .../Adminhtml/Mobile/Submission/Tabs.php | 2 +- .../Block/Adminhtml/Mobile/Widget/Form.php | 2 +- .../Mage/XmlConnect/Block/Adminhtml/Queue.php | 2 +- .../XmlConnect/Block/Adminhtml/Queue/Edit.php | 2 +- .../Block/Adminhtml/Queue/Edit/Form.php | 2 +- .../XmlConnect/Block/Adminhtml/Queue/Grid.php | 2 +- .../Adminhtml/Queue/Grid/Renderer/Action.php | 2 +- .../Queue/Grid/Renderer/Application.php | 2 +- .../Adminhtml/Queue/Grid/Renderer/Id.php | 2 +- .../Queue/Grid/Renderer/Msgtitle.php | 2 +- .../Queue/Grid/Renderer/Pushtitle.php | 2 +- .../Adminhtml/Queue/Grid/Renderer/Status.php | 2 +- .../Queue/Grid/Renderer/Template.php | 2 +- .../XmlConnect/Block/Adminhtml/Template.php | 2 +- .../Block/Adminhtml/Template/Edit.php | 2 +- .../Block/Adminhtml/Template/Edit/Form.php | 2 +- .../Block/Adminhtml/Template/Grid.php | 2 +- .../Template/Grid/Renderer/Application.php | 2 +- .../Adminhtml/Template/Grid/Renderer/Name.php | 2 +- .../Block/Adminhtml/Template/Preview.php | 2 +- .../Block/Adminhtml/Template/Preview/Form.php | 2 +- app/code/core/Mage/XmlConnect/Block/Cart.php | 16 +- .../Mage/XmlConnect/Block/Cart/Crosssell.php | 11 +- .../core/Mage/XmlConnect/Block/Cart/Info.php | 2 +- .../XmlConnect/Block/Cart/Item/Renderer.php | 17 +- .../Block/Cart/Item/Renderer/Configurable.php | 2 +- .../Block/Cart/Item/Renderer/Grouped.php | 2 +- .../Block/Cart/Paypal/Mecl/Details.php | 2 +- .../Block/Cart/Paypal/Mecl/Review.php | 2 +- .../Cart/Paypal/Mecl/Shippingmethods.php | 2 +- .../Block/Cart/Paypal/Mep/Totals.php | 2 +- .../Mage/XmlConnect/Block/Cart/Totals.php | 6 +- .../core/Mage/XmlConnect/Block/Catalog.php | 4 +- .../XmlConnect/Block/Catalog/Category.php | 4 +- .../Block/Catalog/Category/Info.php | 4 +- .../Mage/XmlConnect/Block/Catalog/Filters.php | 10 +- .../Mage/XmlConnect/Block/Catalog/Product.php | 11 +- .../Block/Catalog/Product/Attributes.php | 2 +- .../Block/Catalog/Product/Gallery.php | 2 +- .../XmlConnect/Block/Catalog/Product/List.php | 2 +- .../Block/Catalog/Product/Options.php | 6 +- .../Block/Catalog/Product/Options/Bundle.php | 6 +- .../Catalog/Product/Options/Configurable.php | 8 +- .../Catalog/Product/Options/Giftcard.php | 2 +- .../Block/Catalog/Product/Options/Grouped.php | 4 +- .../Block/Catalog/Product/Options/Simple.php | 2 +- .../Block/Catalog/Product/Options/Virtual.php | 2 +- .../Block/Catalog/Product/Price.php | 2 +- .../Block/Catalog/Product/Price/Bundle.php | 18 +- .../Block/Catalog/Product/Price/Default.php | 20 +- .../Block/Catalog/Product/Price/Giftcard.php | 2 +- .../Block/Catalog/Product/Related.php | 2 +- .../Block/Catalog/Product/Review.php | 8 +- .../Block/Catalog/Product/Review/List.php | 2 +- .../Mage/XmlConnect/Block/Catalog/Search.php | 8 +- .../Block/Catalog/Search/Suggest.php | 4 +- .../Block/Checkout/Address/Billing.php | 4 +- .../Block/Checkout/Address/Form.php | 2 +- .../Block/Checkout/Address/Shipping.php | 4 +- .../XmlConnect/Block/Checkout/Agreements.php | 11 +- .../Block/Checkout/Order/Review.php | 2 +- .../Block/Checkout/Order/Review/Info.php | 13 +- .../Checkout/Payment/Method/Authorizenet.php | 2 +- .../Block/Checkout/Payment/Method/Ccsave.php | 2 +- .../Block/Checkout/Payment/Method/Checkmo.php | 2 +- .../Payment/Method/Info/Authorizenet.php | 2 +- .../Checkout/Payment/Method/Info/Ccsave.php | 2 +- .../Checkout/Payment/Method/Info/Checkmo.php | 2 +- .../Checkout/Payment/Method/Info/Free.php | 2 +- .../Payment/Method/Info/Paypal/Abstract.php | 2 +- .../Payment/Method/Info/Paypal/Express.php | 2 +- .../Payment/Method/Info/Paypal/Mecl.php | 2 +- .../Method/Info/Pbridge/Authorizenet.php | 2 +- .../Method/Info/Pbridge/Paypal/Direct.php | 2 +- .../Method/Info/Pbridge/Paypaluk/Direct.php | 2 +- .../Payment/Method/Info/Pbridge/Verisign.php | 2 +- .../Payment/Method/Info/Purchaseorder.php | 2 +- .../Block/Checkout/Payment/Method/List.php | 4 +- .../Checkout/Payment/Method/Paypal/Direct.php | 2 +- .../Payment/Method/Paypal/Payflow.php | 2 +- .../Payment/Method/Pbridge/Abstract.php | 2 +- .../Checkout/Payment/Method/Purchaseorder.php | 2 +- .../Block/Checkout/Pbridge/Result.php | 2 +- .../Checkout/Shipping/Method/Available.php | 8 +- .../core/Mage/XmlConnect/Block/Cms/Page.php | 2 +- .../Mage/XmlConnect/Block/Configuration.php | 2 +- .../Block/Customer/Address/Form.php | 12 +- .../Block/Customer/Address/List.php | 10 +- .../Mage/XmlConnect/Block/Customer/Form.php | 32 +- .../Block/Customer/GiftcardCheck.php | 2 +- .../Block/Customer/Order/Details.php | 2 +- .../Customer/Order/Item/Renderer/Bundle.php | 2 +- .../Customer/Order/Item/Renderer/Default.php | 2 +- .../Order/Item/Renderer/Downloadable.php | 2 +- .../Customer/Order/Item/Renderer/Grouped.php | 2 +- .../XmlConnect/Block/Customer/Order/Items.php | 2 +- .../XmlConnect/Block/Customer/Order/List.php | 4 +- .../Block/Customer/Order/Totals.php | 2 +- .../Block/Customer/Order/Totals/Tax.php | 2 +- .../XmlConnect/Block/Customer/Storecredit.php | 18 +- app/code/core/Mage/XmlConnect/Block/Home.php | 4 +- .../Mage/XmlConnect/Block/Review/Form.php | 4 +- .../core/Mage/XmlConnect/Block/Wishlist.php | 13 +- .../Mage/XmlConnect/Controller/Action.php | 2 +- .../core/Mage/XmlConnect/Helper/Android.php | 2 +- .../Helper/Catalog/Category/Image.php | 2 +- .../Helper/Customer/Form/Renderer.php | 6 +- .../Mage/XmlConnect/Helper/Customer/Order.php | 14 +- app/code/core/Mage/XmlConnect/Helper/Data.php | 61 +- .../core/Mage/XmlConnect/Helper/Image.php | 2 +- app/code/core/Mage/XmlConnect/Helper/Ipad.php | 2 +- .../core/Mage/XmlConnect/Helper/Iphone.php | 2 +- .../core/Mage/XmlConnect/Helper/Theme.php | 2 +- .../System/Config/Backend/Baseurl.php | 2 +- .../Config/Backend/Currency/Default.php | 2 +- .../Mage/XmlConnect/Model/Application.php | 2 +- .../Model/Catalog/Category/Image.php | 2 +- .../Model/Catalog/Category/Media/Config.php | 2 +- .../core/Mage/XmlConnect/Model/ConfigData.php | 2 +- .../core/Mage/XmlConnect/Model/History.php | 2 +- .../core/Mage/XmlConnect/Model/Observer.php | 5 +- .../Model/Payment/Method/Paypal/Config.php | 2 +- .../Model/Payment/Method/Paypal/Mecl.php | 2 +- .../Model/Payment/Method/Paypal/Mep.php | 2 +- .../XmlConnect/Model/Paypal/Mecl/Checkout.php | 2 +- .../XmlConnect/Model/Paypal/Mep/Checkout.php | 2 +- .../XmlConnect/Model/Preview/Abstract.php | 2 +- .../Mage/XmlConnect/Model/Preview/Android.php | 2 +- .../Mage/XmlConnect/Model/Preview/Ipad.php | 2 +- .../Mage/XmlConnect/Model/Preview/Iphone.php | 2 +- app/code/core/Mage/XmlConnect/Model/Queue.php | 2 +- .../XmlConnect/Model/Resource/Application.php | 2 +- .../Model/Resource/Application/Collection.php | 2 +- .../Model/Resource/Cms/Page/Collection.php | 2 +- .../XmlConnect/Model/Resource/ConfigData.php | 2 +- .../Model/Resource/ConfigData/Collection.php | 2 +- .../Model/Resource/Filter/Collection.php | 2 +- .../XmlConnect/Model/Resource/History.php | 2 +- .../Model/Resource/History/Collection.php | 2 +- .../Mage/XmlConnect/Model/Resource/Queue.php | 2 +- .../Model/Resource/Queue/Collection.php | 2 +- .../Mage/XmlConnect/Model/Resource/Setup.php | 2 +- .../XmlConnect/Model/Resource/Template.php | 2 +- .../Model/Resource/Template/Collection.php | 2 +- .../XmlConnect/Model/Simplexml/Element.php | 41 +- .../Mage/XmlConnect/Model/Simplexml/Form.php | 2 +- .../Model/Simplexml/Form/Abstract.php | 4 +- .../Model/Simplexml/Form/Element/Abstract.php | 2 +- .../Model/Simplexml/Form/Element/Checkbox.php | 2 +- .../Simplexml/Form/Element/Collection.php | 2 +- .../Form/Element/CountryListSelect.php | 2 +- .../Model/Simplexml/Form/Element/Date.php | 2 +- .../Model/Simplexml/Form/Element/Email.php | 2 +- .../Model/Simplexml/Form/Element/Fieldset.php | 2 +- .../Model/Simplexml/Form/Element/File.php | 2 +- .../Model/Simplexml/Form/Element/Image.php | 2 +- .../Simplexml/Form/Element/Multiline.php | 2 +- .../Simplexml/Form/Element/Multiselect.php | 2 +- .../Form/Element/Renderer/Interface.php | 2 +- .../Model/Simplexml/Form/Element/Select.php | 2 +- .../Model/Simplexml/Form/Element/Text.php | 2 +- .../Model/Simplexml/Form/Element/Textarea.php | 2 +- .../Simplexml/Form/Element/Validator.php | 2 +- .../Form/Element/Validator/Abstract.php | 31 +- .../Simplexml/Form/Element/Validator/Rule.php | 2 +- app/code/core/Mage/XmlConnect/Model/Tabs.php | 2 +- .../core/Mage/XmlConnect/Model/Template.php | 2 +- app/code/core/Mage/XmlConnect/Model/Theme.php | 2 +- .../Adminhtml/MobileController.php | 40 +- .../XmlConnect/controllers/CartController.php | 2 +- .../controllers/CatalogController.php | 11 +- .../controllers/CheckoutController.php | 8 +- .../XmlConnect/controllers/CmsController.php | 2 +- .../controllers/ConfigurationController.php | 2 +- .../controllers/CustomerController.php | 3 +- .../controllers/IndexController.php | 2 +- .../controllers/Paypal/MeclController.php | 2 +- .../controllers/Paypal/MepController.php | 2 +- .../controllers/PbridgeController.php | 6 +- .../controllers/ReviewController.php | 2 +- .../controllers/WishlistController.php | 2 +- .../core/Mage/XmlConnect/etc/adminhtml.xml | 2 +- app/code/core/Mage/XmlConnect/etc/config.xml | 5 +- app/code/core/Mage/XmlConnect/etc/system.xml | 2 +- .../Mage/XmlConnect/etc/themes/custom.xml | 2 +- .../Mage/XmlConnect/etc/themes/default.xml | 2 +- .../Mage/XmlConnect/etc/themes/funk_leaf.xml | 2 +- .../Mage/XmlConnect/etc/themes/hot_red.xml | 2 +- .../Mage/XmlConnect/etc/themes/sky_blue.xml | 2 +- .../sql/xmlconnect_setup/install-1.6.0.0.php | 2 +- .../XmlConnect/view/adminhtml/css/boxes.css | 2 +- .../view/adminhtml/css/dropdown.css | 2 +- .../view/adminhtml/css/mobile-android.css | 2 +- .../view/adminhtml/css/mobile-catalog.css | 2 +- .../view/adminhtml/css/mobile-home.css | 2 +- .../adminhtml/css/mobile-ipad-catalog.css | 2 +- .../view/adminhtml/css/mobile-ipad-home.css | 2 +- .../XmlConnect/view/adminhtml/css/styles.css | 2 +- .../view/adminhtml/edit/tab/design.phtml | 2 +- .../tab/design/preview/catalog_android.phtml | 2 +- .../tab/design/preview/catalog_hor_ipad.phtml | 2 +- .../tab/design/preview/catalog_ipad.phtml | 2 +- .../tab/design/preview/catalog_iphone.phtml | 2 +- .../tab/design/preview/home_android.phtml | 2 +- .../tab/design/preview/home_hor_ipad.phtml | 2 +- .../edit/tab/design/preview/home_ipad.phtml | 2 +- .../edit/tab/design/preview/home_iphone.phtml | 2 +- .../design/preview/productinfo_iphone.phtml | 2 +- .../design/preview/tab_items_android.phtml | 2 +- .../tab/design/preview/tab_items_ipad.phtml | 2 +- .../tab/design/preview/tab_items_iphone.phtml | 2 +- .../edit/tab/design/preview_android.phtml | 4 +- .../edit/tab/design/preview_ipad.phtml | 6 +- .../edit/tab/design/preview_iphone.phtml | 4 +- .../view/adminhtml/form/element/addrow.phtml | 6 +- .../form/element/app_tabs_android.phtml | 2 +- .../form/element/app_tabs_ipad.phtml | 2 +- .../form/element/app_tabs_iphone.phtml | 2 +- .../form/element/country/androidmarket.phtml | 2 +- .../form/element/country/istore.phtml | 2 +- .../view/adminhtml/form/element/themes.phtml | 14 +- .../images/mobile_preview/mobile-catalog.css | 2 +- .../images/mobile_preview/mobile-home.css | 2 +- .../Mage/XmlConnect/view/adminhtml/layout.xml | 2 +- .../mobile/notification_helper.phtml | 2 +- .../submission/app_icons_preview.phtml | 2 +- .../view/adminhtml/submission/container.phtml | 2 +- .../view/adminhtml/template/preview.phtml | 2 +- .../Mage/XmlConnect/view/frontend/layout.xml | 2 +- .../view/frontend/pbridge/result.phtml | 2 +- app/code/core/Zend/Date.php | 5008 +++++++++++++++++ .../adminhtml/default/default/local.xml | 2 +- .../default/skin/default/below_ie7.css | 2 +- .../default/default/skin/default/boxes.css | 77 +- .../default/default/skin/default/custom.css | 2 +- .../default/default/skin/default/ie7.css | 2 +- .../default/default/skin/default/iestyles.css | 8 +- .../default/skin/default/images/btn_gr_bg.gif | Bin 0 -> 148 bytes .../default/skin/default/images/btn_gr_on.gif | Bin 0 -> 137 bytes .../skin/default/images/btn_gr_over.gif | Bin 0 -> 147 bytes .../skin/default/images/i_question-mark.png | Bin 0 -> 1654 bytes .../default/default/skin/default/menu.css | 2 +- .../default/default/skin/default/print.css | 2 +- .../default/default/skin/default/reset.css | 2 +- .../adminhtml/default/default/theme.xml | 2 +- app/design/frontend/default/default/local.xml | 2 +- .../default/default/skin/blank/css/print.css | 2 +- .../default/skin/blank/css/styles-ie.css | 2 +- .../default/default/skin/blank/css/styles.css | 27 +- .../default/skin/blue/css/styles-ie.css | 2 +- .../default/default/skin/blue/css/styles.css | 28 +- .../default/skin/default/css/print.css | 2 +- .../default/skin/default/css/styles-ie.css | 2 +- .../default/skin/default/css/styles.css | 29 +- app/design/frontend/default/default/theme.xml | 2 +- .../sales/order/items/renderer.phtml | 2 +- .../iphone/Mage_Catalog/layer/view.phtml | 2 +- .../default/iphone/Mage_Catalog/layout.xml | 2 +- .../iphone/Mage_Catalog/navigation/top.phtml | 2 +- .../Mage_Catalog/product/compare/list.phtml | 115 +- .../product/compare/sidebar.phtml | 2 +- .../iphone/Mage_Catalog/product/gallery.phtml | 2 +- .../iphone/Mage_Catalog/product/list.phtml | 2 +- .../Mage_Catalog/product/list/toolbar.phtml | 2 +- .../Mage_Catalog/product/list/upsell.phtml | 2 +- .../iphone/Mage_Catalog/product/price.phtml | 2 +- .../iphone/Mage_Catalog/product/view.phtml | 4 +- .../Mage_Catalog/product/view/addto.phtml | 2 +- .../Mage_Catalog/product/view/addtocart.phtml | 2 +- .../product/view/addtowishlist.phtml | 2 +- .../Mage_Catalog/product/view/media.phtml | 2 +- .../product/view/type/grouped.phtml | 2 +- .../product/view/type/grouped_grid.phtml | 2 +- .../iphone/Mage_CatalogSearch/form.mini.phtml | 2 +- .../iphone/Mage_CatalogSearch/layout.xml | 2 +- .../iphone/Mage_CatalogSearch/result.phtml | 2 +- .../default/iphone/Mage_Checkout/cart.phtml | 2 +- .../Mage_Checkout/cart/item/default.phtml | 2 +- .../Mage_Checkout/cart/no_items_header.phtml | 2 +- .../iphone/Mage_Checkout/cart/sidebar.phtml | 2 +- .../iphone/Mage_Checkout/cartheader.phtml | 2 +- .../default/iphone/Mage_Checkout/layout.xml | 2 +- .../iphone/Mage_Checkout/onepage/login.phtml | 3 +- .../default/iphone/Mage_Cms/layout.xml | 2 +- .../default/iphone/Mage_Contacts/layout.xml | 2 +- .../iphone/Mage_Customer/form/edit.phtml | 2 +- .../Mage_Customer/form/forgotpassword.phtml | 2 +- .../iphone/Mage_Customer/form/login.phtml | 3 +- .../iphone/Mage_Customer/form/register.phtml | 3 +- .../default/iphone/Mage_Customer/layout.xml | 4 +- .../default/iphone/Mage_Page/1column.phtml | 2 +- .../iphone/Mage_Page/html/footer.phtml | 2 +- .../default/iphone/Mage_Page/html/head.phtml | 4 +- .../iphone/Mage_Page/html/header.phtml | 2 +- .../default/iphone/Mage_Page/html/pager.phtml | 2 +- .../default/iphone/Mage_Page/layout.xml | 2 +- .../iphone/Mage_Page/switch/languages.phtml | 2 +- .../iphone/Mage_Page/switch/stores.phtml | 2 +- .../checkout/onepage/login.phtml | 3 +- .../Mage_Persistent/customer/form/login.phtml | 3 +- .../customer/form/register.phtml | 3 +- .../default/iphone/Mage_Persistent/layout.xml | 2 +- .../default/iphone/Mage_Review/layout.xml | 2 +- .../iphone/Mage_Sales/order/history.phtml | 2 +- .../iphone/Mage_Sales/order/items.phtml | 2 +- .../iphone/Mage_Sales/order/recent.phtml | 2 +- .../iphone/Mage_Sales/order/totals.phtml | 2 +- .../default/iphone/Mage_Sendfriend/layout.xml | 2 +- .../default/iphone/Mage_Sendfriend/send.phtml | 2 +- .../iphone/Mage_Shipping/tracking/ajax.phtml | 2 +- .../iphone/Mage_Shipping/tracking/popup.phtml | 2 +- .../default/iphone/Mage_Tag/layout.xml | 2 +- .../default/iphone/Mage_Tag/list.phtml | 2 +- .../default/iphone/Mage_Wishlist/view.phtml | 2 +- app/design/frontend/default/iphone/local.xml | 2 +- .../iphone/skin/default/css/iphone.css | 154 +- .../skin/default/images/i_star_black.png | Bin 0 -> 3540 bytes .../default/iphone/skin/default/js/iphone.js | 39 +- app/design/frontend/default/iphone/theme.xml | 2 +- app/design/frontend/default/iphone/view.xml | 2 +- .../default/modern/Mage_Catalog/layout.xml | 2 +- .../modern/Mage_Catalog/product/list.phtml | 2 +- .../Mage_Catalog/product/list/upsell.phtml | 2 +- .../modern/Mage_Catalog/product/view.phtml | 2 +- .../Mage_Catalog/product/view/media.phtml | 2 +- .../Mage_Catalog/product/view/tabs.phtml | 2 +- .../modern/Mage_CatalogSearch/form.mini.phtml | 2 +- .../modern/Mage_CatalogSearch/layout.xml | 2 +- .../default/modern/Mage_Checkout/cart.phtml | 5 +- .../default/modern/Mage_Checkout/layout.xml | 2 +- .../default/modern/Mage_Contacts/layout.xml | 2 +- .../default/modern/Mage_Customer/layout.xml | 4 +- .../default/modern/Mage_Newsletter/layout.xml | 2 +- .../modern/Mage_Newsletter/subscribe.phtml | 7 +- .../default/modern/Mage_Page/3columns.phtml | 2 +- .../modern/Mage_Page/html/footer.phtml | 2 +- .../modern/Mage_Page/html/header.phtml | 2 +- .../default/modern/Mage_Page/layout.xml | 2 +- .../default/modern/Mage_Payment/layout.xml | 2 +- .../default/modern/Mage_Persistent/layout.xml | 2 +- .../default/modern/Mage_Review/layout.xml | 2 +- .../default/modern/Mage_Rss/layout.xml | 2 +- .../default/modern/Mage_Sales/layout.xml | 2 +- .../default/modern/Mage_Sendfriend/layout.xml | 2 +- .../default/modern/Mage_Tag/layout.xml | 2 +- .../default/modern/Mage_Wishlist/layout.xml | 2 +- .../skin/default/Mage_Catalog/widgets.css | 2 +- .../modern/skin/default/Mage_Cms/widgets.css | 2 +- .../skin/default/Mage_Reports/widgets.css | 2 +- .../default/modern/skin/default/css/print.css | 2 +- .../modern/skin/default/css/styles-ie.css | 2 +- .../modern/skin/default/css/styles.css | 26 +- app/design/frontend/default/modern/theme.xml | 2 +- app/design/frontend/default/modern/view.xml | 2 +- .../default/skin/default/css/boxes.css | 2 +- .../default/skin/default/css/clears.css | 2 +- .../default/skin/default/css/ie7minus.css | 2 +- .../default/skin/default/css/iestyles.css | 2 +- .../default/skin/default/css/reset.css | 2 +- app/design/install/default/default/theme.xml | 2 +- app/etc/config.xml | 2 +- app/etc/local.xml.additional | 2 +- app/etc/local.xml.template | 2 +- app/etc/modules/Mage_All.xml | 2 +- app/etc/modules/Mage_Api.xml | 2 +- app/etc/modules/Mage_Authorizenet.xml | 2 +- app/etc/modules/Mage_Bundle.xml | 2 +- app/etc/modules/Mage_Captcha.xml | 39 + app/etc/modules/Mage_Centinel.xml | 2 +- app/etc/modules/Mage_Connect.xml | 2 +- app/etc/modules/Mage_Downloadable.xml | 2 +- app/etc/modules/Mage_GoogleOptimizer.xml | 2 +- app/etc/modules/Mage_GoogleShopping.xml | 2 +- app/etc/modules/Mage_ImportExport.xml | 2 +- app/etc/modules/Mage_LoadTest.xml | 2 +- app/etc/modules/Mage_Ogone.xml | 2 +- app/etc/modules/Mage_PageCache.xml | 2 +- app/etc/modules/Mage_Persistent.xml | 2 +- app/etc/modules/Mage_Weee.xml | 2 +- app/etc/modules/Mage_Widget.xml | 2 +- app/etc/modules/Mage_XmlConnect.xml | 2 +- app/etc/modules/Phoenix_Moneybookers.xml | 2 +- dev/shell/indexer.php | 2 +- dev/shell/install.php | 2 +- dev/shell/log.php | 2 +- .../etc/integration-tests-config.xml | 2 +- .../integration/etc/local-mysql.xml.dist | 2 +- .../framework/Magento/Test/Bootstrap.php | 38 +- .../framework/Magento/Test/Db/DbAbstract.php | 9 +- .../framework/Magento/Test/Db/Mysql.php | 2 +- .../framework/Magento/Test/Entity.php | 2 +- .../framework/Magento/Test/Helper/Config.php | 2 +- .../framework/Magento/Test/Helper/Factory.php | 2 +- .../framework/Magento/Test/Listener.php | 2 +- .../Test/Listener/Annotation/Config.php | 2 +- .../Test/Listener/Annotation/Fixture.php | 9 +- .../Test/Listener/Annotation/Isolation.php | 8 +- .../Magento/Test/Profiler/OutputBamboo.php | 2 +- .../framework/Magento/Test/Request.php | 2 +- .../framework/Magento/Test/Response.php | 2 +- .../Test/TestCase/ControllerAbstract.php | 2 +- .../Test/TestCase/IntegrityAbstract.php | 2 +- .../Magento/Test/TestSuite/ModuleGroups.php | 2 +- dev/tests/integration/framework/bootstrap.php | 2 +- .../tests/unit/framework/bootstrap.php | 2 +- .../framework/tests/unit/phpunit.xml.dist | 2 +- .../Test/Bootstrap/_files/local-custom.xml | 2 +- .../Test/Bootstrap/_files/local-invalid.xml | 2 +- .../testsuite/Magento/Test/BootstrapTest.php | 18 +- .../testsuite/Magento/Test/Db/MysqlTest.php | 2 +- .../testsuite/Magento/Test/EntityTest.php | 8 +- .../Magento/Test/Helper/FactoryTest.php | 2 +- .../Test/Listener/Annotation/ConfigTest.php | 2 +- .../Test/Listener/Annotation/FixtureTest.php | 11 +- .../Listener/Annotation/IsolationTest.php | 14 +- .../_files/sample_fixture_two_rollback.php | 2 +- .../testsuite/Magento/Test/ListenerTest.php | 2 +- .../Test/Profiler/OutputBambooTest.php | 2 +- .../testsuite/Magento/Test/RequestTest.php | 2 +- .../testsuite/Magento/Test/ResponseTest.php | 2 +- .../Test/TestCase/ControllerAbstractTest.php | 2 +- .../Test/TestSuite/ModuleGroupsTest.php | 7 +- .../_files/ModuleGroups/Mg_Author_Module.php | 2 +- .../_files/ModuleGroups/Mg_Integrity.php | 2 +- .../_files/ModuleGroups/Mg_Mage_Catalog.php | 2 +- .../_files/ModuleGroups/Mg_Mage_Core.php | 2 +- .../ModuleGroups/Mg_Mage_Core_Mage_Eav.php | 2 +- dev/tests/integration/phpunit-ce.xml.dist | 2 +- dev/tests/integration/phpunit.xml.dist | 2 +- .../testsuite/AllRelevantTests.php | 5 +- .../testsuite/Mage/Admin/Model/UserTest.php | 54 + .../testsuite/Mage/Admin/_files/user.php | 50 + .../Report/Sales/Bestsellers/GridTest.php | 2 +- .../Block/Report/Sales/Coupons/GridTest.php | 2 +- .../Block/Report/Sales/Invoiced/GridTest.php | 2 +- .../Block/Report/Sales/Refunded/GridTest.php | 2 +- .../Block/Report/Sales/Sales/GridTest.php | 2 +- .../Block/Report/Sales/Shipping/GridTest.php | 2 +- .../Block/Report/Sales/Tax/GridTest.php | 2 +- .../Mage/Bundle/Model/ProductTest.php | 2 +- .../Catalog/Block/Product/AbstractTest.php | 2 +- .../Block/Product/List/CrosssellTest.php | 2 +- .../Block/Product/List/RelatedTest.php | 2 +- .../Mage/Catalog/Block/Product/ListTest.php | 2 +- .../Mage/Catalog/Block/Product/NewTest.php | 2 +- .../Block/Product/View/OptionsTest.php | 2 +- .../Product/View/Type/ConfigurableTest.php | 2 +- .../Mage/Catalog/Block/Product/ViewTest.php | 2 +- .../Mage/Catalog/Helper/Category/FlatTest.php | 2 +- .../Mage/Catalog/Helper/CategoryTest.php | 2 +- .../Mage/Catalog/Helper/DataTest.php | 2 +- .../Mage/Catalog/Helper/ImageTest.php | 2 +- .../testsuite/Mage/Catalog/Helper/MapTest.php | 2 +- .../Mage/Catalog/Helper/OutputTest.php | 2 +- .../Catalog/Helper/Product/CompareTest.php | 2 +- .../Mage/Catalog/Helper/Product/FlatTest.php | 2 +- .../Mage/Catalog/Helper/Product/UrlTest.php | 2 +- .../Mage/Catalog/Helper/Product/ViewTest.php | 2 +- .../Mage/Catalog/Helper/ProductTest.php | 2 +- .../Mage/Catalog/Model/AbstractTest.php | 2 +- .../Catalog/Model/Category/Api/V2Test.php | 2 +- .../Mage/Catalog/Model/Category/ApiTest.php | 2 +- .../Model/Category/Attribute/ApiTest.php | 2 +- .../Mage/Catalog/Model/CategoryTest.php | 2 +- .../Mage/Catalog/Model/CategoryTreeTest.php | 2 +- .../Model/Convert/Adapter/ProductTest.php | 2 +- .../Mage/Catalog/Model/DesignTest.php | 2 +- .../Model/Layer/Filter/AttributeTest.php | 2 +- .../Model/Layer/Filter/CategoryTest.php | 2 +- .../Model/Layer/Filter/DecimalTest.php | 2 +- .../Catalog/Model/Layer/Filter/ItemTest.php | 2 +- .../Catalog/Model/Layer/Filter/PriceTest.php | 3 +- .../_files/attribute_weight_filterable.php | 2 +- .../Filter/_files/attribute_with_option.php | 2 +- .../Mage/Catalog/Model/LayerTest.php | 2 +- .../Model/Product/Attribute/ApiTest.php | 2 +- .../Product/Attribute/Backend/MediaTest.php | 2 +- .../Product/Attribute/Backend/PriceTest.php | 2 +- .../Attribute/Backend/TierpriceTest.php | 2 +- .../Model/Product/Attribute/Media/ApiTest.php | 2 +- .../Attribute/Tierprice/Api/V2Test.php | 2 +- .../Product/Attribute/Tierprice/ApiTest.php | 2 +- .../Mage/Catalog/Model/Product/ImageTest.php | 2 +- .../Model/Product/Type/AbstractTest.php | 2 +- .../Catalog/Model/Product/Type/ApiTest.php | 2 +- .../Type/Configurable/AttributeTest.php | 2 +- .../Product/Type/Configurable/PriceTest.php | 2 +- .../Model/Product/Type/ConfigurableTest.php | 2 +- .../Catalog/Model/Product/Type/PriceTest.php | 2 +- .../Model/Product/Type/VirtualTest.php | 2 +- .../Mage/Catalog/Model/Product/TypeTest.php | 2 +- .../Mage/Catalog/Model/Product/UrlTest.php | 2 +- .../Catalog/Model/ProductExternalTest.php | 2 +- .../Mage/Catalog/Model/ProductGettersTest.php | 2 +- .../Mage/Catalog/Model/ProductPriceTest.php | 2 +- .../Mage/Catalog/Model/ProductTest.php | 2 +- .../Model/Resource/Eav/AttributeTest.php | 2 +- .../Model/Resource/Product/CollectionTest.php | 2 +- .../Mage/Catalog/Model/Resource/UrlTest.php | 51 + .../Model/Resource/_files/url_rewrites.php | 67 + .../testsuite/Mage/Catalog/Model/UrlTest.php | 2 +- .../testsuite/Mage/Catalog/WidgetTest.php | 2 +- .../Mage/Catalog/_files/categories.php | 2 +- .../Catalog/_files/product_configurable.php | 2 +- .../Mage/Catalog/_files/product_image.php | 2 +- .../Catalog/_files/product_image_rollback.php | 2 +- .../Mage/Catalog/_files/product_simple.php | 2 +- .../Catalog/_files/product_with_image.php | 2 +- .../_files/product_with_image_rollback.php | 2 +- .../Mage/Catalog/_files/products.php | 2 +- .../Catalog/_files/products_crosssell.php | 2 +- .../Mage/Catalog/_files/products_new.php | 2 +- .../Mage/Catalog/_files/products_related.php | 2 +- .../Mage/Catalog/_files/two_products.php | 2 +- .../Mage/Catalog/_files/url_rewrites.php | 2 +- .../Catalog/_files/url_rewrites_invalid.php | 2 +- .../controllers/CategoryControllerTest.php | 2 +- .../controllers/IndexControllerTest.php | 2 +- .../Product/CompareControllerTest.php | 2 +- .../controllers/ProductControllerTest.php | 2 +- .../controllers/Seo/SitemapControllerTest.php | 2 +- .../Catalog/controllers/_files/products.php | 2 +- .../CatalogInventory/Model/Stock/ItemTest.php | 2 +- .../Mage/CatalogSearch/Block/TermTest.php | 2 +- .../Mage/CatalogSearch/Helper/DataTest.php | 2 +- .../Checkout/Block/Cart/Item/RendererTest.php | 2 +- .../testsuite/Mage/Cms/Block/BlockTest.php | 2 +- .../Mage/Cms/Block/Widget/BlockTest.php | 2 +- .../testsuite/Mage/Cms/Helper/PageTest.php | 2 +- .../Mage/Cms/Model/Wysiwyg/ConfigTest.php | 2 +- .../Cms/Model/Wysiwyg/Images/StorageTest.php | 2 +- .../testsuite/Mage/Cms/_files/block.php | 2 +- .../testsuite/Mage/Cms/_files/pages.php | 2 +- .../Cms/controllers/PageControllerTest.php | 2 +- .../Mage/Core/Block/AbstractTest.php | 2 +- .../Mage/Core/Block/TemplateTest.php | 2 +- .../testsuite/Mage/Core/Block/TextTest.php | 2 +- .../default/default/Mage_Core/dummy.phtml | 2 +- .../default/default/Mage_Core/dummy.phtml | 2 +- .../Block/_files/template_test_assign.phtml | 2 +- .../Mage/Core/Controller/RequestHttpTest.php | 2 +- .../Core/Controller/Varien/ActionTest.php | 2 +- .../Mage/Core/Controller/Varien/FrontTest.php | 2 +- .../Controller/Varien/Router/StandardTest.php | 2 +- .../Mage/Core/Helper/AbstractTest.php | 16 +- .../testsuite/Mage/Core/Helper/DataTest.php | 4 +- .../testsuite/Mage/Core/Helper/HttpTest.php | 2 +- .../testsuite/Mage/Core/Helper/JsTest.php | 4 +- .../testsuite/Mage/Core/Helper/StringTest.php | 2 +- .../Mage/Core/Helper/Url/RewriteTest.php | 2 +- .../testsuite/Mage/Core/Helper/UrlTest.php | 2 +- .../Mage/Core/Model/App/AreaTest.php | 2 +- .../testsuite/Mage/Core/Model/AppTest.php | 2 +- .../testsuite/Mage/Core/Model/CacheTest.php | 31 +- .../Mage/Core/Model/Config/BaseTest.php | 2 +- .../Mage/Core/Model/Config/DataTest.php | 2 +- .../Mage/Core/Model/Config/ElementTest.php | 2 +- .../Mage/Core/Model/Config/FieldsetTest.php | 2 +- .../Mage/Core/Model/Config/OptionsTest.php | 4 +- .../Mage/Core/Model/Config/SystemTest.php | 2 +- .../Mage/Core/Model/ConfigFactoryTest.php | 2 +- .../testsuite/Mage/Core/Model/ConfigTest.php | 2 +- .../Model/Design/Backend/ExceptionsTest.php | 2 +- .../Core/Model/Design/PackageMergingTest.php | 4 +- .../Mage/Core/Model/Design/PackageTest.php | 20 +- .../Core/Model/Design/Source/DesignTest.php | 2 +- .../_files/design/frontend/a/d/theme.xml | 2 +- .../_files/design/frontend/b/e/theme.xml | 2 +- .../design/frontend/default/default/theme.xml | 2 +- .../testsuite/Mage/Core/Model/DesignTest.php | 2 +- .../Core/Model/Email/Template/FilterTest.php | 2 +- .../Mage/Core/Model/Email/TemplateTest.php | 2 +- .../Mage/Core/Model/EncryptionTest.php | 2 +- .../Mage/Core/Model/Layout/DataTest.php | 2 +- .../Mage/Core/Model/Layout/ElementTest.php | 2 +- .../Mage/Core/Model/Layout/UpdateTest.php | 4 +- .../testsuite/Mage/Core/Model/LayoutTest.php | 2 +- .../Mage/Core/Model/Resource/CacheTest.php | 2 +- .../Mage/Core/Model/Resource/ConfigTest.php | 2 +- .../Core/Model/Resource/Db/AbstractTest.php | 2 +- .../Core/Model/Resource/Entity/TableTest.php | 2 +- .../Core/Model/Resource/Helper/Mysql4Test.php | 2 +- .../Mage/Core/Model/Resource/IteratorTest.php | 2 +- .../Mage/Core/Model/Resource/LayoutTest.php | 2 +- .../Mage/Core/Model/Resource/SessionTest.php | 2 +- .../Mage/Core/Model/Resource/SetupTest.php | 2 +- .../Model/Resource/Store/CollectionTest.php | 2 +- .../Core/Model/Resource/TransactionTest.php | 2 +- .../Mage/Core/Model/ResourceMysqlTest.php | 2 +- .../Mage/Core/Model/ResourceTest.php | 2 +- .../Model/Session/Abstract/VarienTest.php | 72 + .../testsuite/Mage/Core/Model/StoreTest.php | 2 +- .../Mage/Core/Model/TemplateTest.php | 4 +- .../Mage/Core/Model/Translate/ExprTest.php | 2 +- .../Mage/Core/Model/Translate/InlineTest.php | 3 +- .../Mage/Core/Model/Translate/StringTest.php | 2 +- .../Translate/_files/_translation_data.php | 2 +- .../Mage/Core/Model/TranslateTest.php | 2 +- .../Mage/Core/Model/Url/RewriteTest.php | 2 +- .../testsuite/Mage/Core/Model/UrlTest.php | 2 +- .../Mage/Core/Model/Variable/ConfigTest.php | 2 +- .../Mage/Core/Model/VariableTest.php | 2 +- .../testsuite/Mage/Core/Model/WebsiteTest.php | 2 +- .../Mage/Core/Model/_files/_layout_update.xml | 2 +- .../design/adminhtml/package/test/theme.xml | 2 +- .../design/frontend/default/default/theme.xml | 2 +- .../skin/default/fixture_script_two.js | 2 +- .../Fixture_Module/fixture_script.js | 2 +- .../skin/theme_nested_skin/fixture_script.js | 2 +- .../jquery-no-conflict.js} | 2 +- .../ru_RU/Fixture_Module/fixture_script.js | 2 +- .../locale/ru_RU/fixture_script.js | 2 +- .../frontend/package/custom_theme/theme.xml | 2 +- .../frontend/package/default/fallback.phtml | 2 +- .../package/default/skin/access_violation.php | 2 +- .../skin/default/fixture_script_four.js | 2 +- .../skin/default/fixture_script_three.js | 2 +- .../skin/default/fixture_script_two.js | 2 +- .../package/default/skin/default/scripts.js | 2 +- .../default/skin/theme/css/deep/recursive.css | 2 +- .../default/skin/theme/css/exception.css | 2 +- .../package/default/skin/theme/css/file.css | 2 +- .../package/default/skin/theme/recursive.css | 2 +- .../theme_nested_skin/fixture_script_three.js | 2 +- .../theme_nested_skin/fixture_script_two.js | 2 +- .../test/default/Mage_Catalog/layout.xml | 2 +- .../default/Mage_Catalog/theme_template.phtml | 2 +- .../frontend/test/default/Mage_Cms/layout.xml | 2 +- .../test/default/Mage_Core/layout.xml | 2 +- .../test/default/skin/default/css/styles.css | 2 +- .../test/default/skin/default/js/tabs.js | 2 +- .../design/frontend/test/default/view.xml | 2 +- .../Mage/Core/Model/_files/jslib/calendar.css | 2 +- .../Mage/Core/Model/_files/jslib/calendar.js | 2 +- .../skin/_merged/case_2_merged_css_files.css | 2 +- .../skin/_merged/case_2_merged_js_files.js | 2 +- .../Mage/Core/Model/_files/skin/file.css | 2 +- .../Mage/Core/Model/_files/skin/script.js | 2 +- .../Mage/Core/_files/design_change.php | 2 +- .../Core/_files/design_change_timezone.php | 2 +- .../testsuite/Mage/Core/_files/store.php | 2 +- .../testsuite/Mage/Core/_files/variable.php | 2 +- .../Core/controllers/AjaxControllerTest.php | 2 +- .../Core/controllers/IndexControllerTest.php | 2 +- .../Mage/Cron/Model/ObserverTest.php | 2 +- .../Block/Account/Dashboard/InfoTest.php | 2 +- .../Mage/Customer/Block/Widget/GenderTest.php | 2 +- .../Customer/Model/Address/ConfigTest.php | 2 +- .../Model/Convert/Adapter/CustomerTest.php | 2 +- .../Mage/Customer/Model/FormTest.php | 2 +- .../Mage/Customer/Model/GroupTest.php | 2 +- .../Mage/Customer/_files/address_formats.php | 2 +- .../Entity/Attribute/CollectionTest.php | 2 +- .../GiftMessage/Block/Message/InlineTest.php | 2 +- .../testsuite/Mage/Index/Model/ShellTest.php | 2 +- .../Mage/Log/Model/Resource/ShellTest.php | 2 +- .../testsuite/Mage/Log/Model/ShellTest.php | 2 +- .../Mage/Newsletter/Model/QueueTest.php | 2 +- .../Mage/Newsletter/Model/TemplateTest.php | 2 +- .../Mage/Newsletter/_files/queue.php | 2 +- .../Mage/Newsletter/_files/subscribers.php | 2 +- .../Mage/Newsletter/_files/template.php | 2 +- .../Mage/Page/Block/Html/BreadcrumbsTest.php | 2 +- .../Mage/Page/Block/Html/FooterTest.php | 2 +- .../Mage/Page/Block/Html/HeadTest.php | 4 +- .../ProductAlert/Block/Email/StockTest.php | 2 +- .../testsuite/Mage/Report/WidgetTest.php | 2 +- .../controllers/ProductControllerTest.php | 2 +- .../Mage/Sales/Block/Order/CommentsTest.php | 2 +- .../Sales/Model/Order/Shipment/TrackTest.php | 2 +- .../Mage/Shipping/Helper/DataTest.php | 2 +- .../Mage/Tag/Block/Customer/ViewTest.php | 2 +- .../testsuite/Mage/Tag/Model/TagTest.php | 2 +- .../Widget/Instance/Edit/Tab/MainTest.php | 2 +- .../Widget/Instance/Edit/Tab/SettingsTest.php | 2 +- .../Mage/Widget/Model/Widget/ConfigTest.php | 2 +- .../Mage/Widget/Model/Widget/InstanceTest.php | 2 +- .../Mage/Widget/Model/WidgetTest.php | 2 +- .../Mage/Wishlist/Block/AbstractTest.php | 2 +- .../XmlConnect/Helper/Catalog/ImageTest.php | 2 +- .../Mage/XmlConnect/Helper/DataTest.php | 2 +- .../Mage/XmlConnect/Helper/ImageTest.php | 2 +- .../Model/Catalog/Category/ImageTest.php | 2 +- .../Mage/XmlConnect/Model/TabsTest.php | 2 +- dev/tests/integration/testsuite/MageTest.php | 36 +- .../Phoenix/Moneybookers/Block/FormTest.php | 2 +- .../Moneybookers/Block/PaymentTest.php | 2 +- .../integrity/Mage/Widget/SkinFilesTest.php | 2 +- .../Mage/Widget/TemplateFilesTest.php | 2 +- .../Mage/XmlConnect/SkinFilesTest.php | 2 +- .../modular/Email/TemplateFilesTest.php | 2 +- .../integrity/modular/LayoutFilesTest.php | 2 +- .../integrity/modular/TemplateFilesTest.php | 2 +- .../integrity/modular/ViewConfigFilesTest.php | 2 +- .../integrity/theme/SkinFilesTest.php | 15 +- .../integrity/theme/TemplateFilesTest.php | 2 +- .../integrity/theme/XmlFilesTest.php | 2 +- .../Inspection/CodeSniffer/Command.php | 2 +- .../framework/Inspection/CommandAbstract.php | 20 +- .../Inspection/CopyPasteDetector/Command.php | 22 +- .../Inspection/MessDetector/Command.php | 2 +- dev/tests/static/framework/bootstrap.php | 2 +- .../framework/tests/unit/phpunit.xml.dist | 2 +- .../Inspection/CodeSniffer/CommandTest.php | 17 +- .../CopyPasteDetector/CommandTest.php | 61 +- .../Inspection/MessDetector/CommandTest.php | 33 +- dev/tests/static/phpunit-all.xml.dist | 2 +- dev/tests/static/phpunit.xml.dist | 2 +- .../testsuite/Integrity/ClassesTest.php | 144 +- .../static/testsuite/Legacy/ClassesTest.php | 211 +- .../static/testsuite/Legacy/ConfigTest.php | 4 +- .../testsuite/Legacy/EmailTemplateTest.php | 4 +- .../testsuite/Legacy/FilesystemTest.php | 53 + .../static/testsuite/Legacy/LayoutTest.php | 4 +- .../static/testsuite/Legacy/LicenseTest.php | 2 +- .../testsuite/Legacy/ObsoleteCodeTest.php | 20 +- .../static/testsuite/Legacy/TableTest.php | 17 +- .../Legacy/_files/obsolete_classes.php | 3 +- .../Legacy/_files/obsolete_constants.php | 2 +- .../Legacy/_files/obsolete_methods.php | 2 +- .../Legacy/_files/obsolete_properties.php | 2 +- .../testsuite/Php/Exemplar/CodeMessTest.php | 83 +- .../testsuite/Php/Exemplar/CodeStyleTest.php | 7 +- .../Php/Exemplar/_files/phpmd/data.php | 125 + .../Exemplar/_files/phpmd/output/coupling.xml | 8 - .../phpmd/output/cyclomatic_complexity.xml | 8 - .../_files/phpmd/output/descendant_count.xml | 8 - .../_files/phpmd/output/field_count.xml | 8 - .../_files/phpmd/output/inheritance_depth.xml | 8 - .../_files/phpmd/output/method_count.xml | 8 - .../_files/phpmd/output/method_length.xml | 8 - .../Exemplar/_files/phpmd/output/naming.xml | 35 - .../_files/phpmd/output/parameter_list.xml | 8 - .../phpmd/output/prohibited_statement.xml | 11 - .../output/prohibited_statement_goto.xml | 8 - .../_files/phpmd/output/public_count.xml | 8 - .../Exemplar/_files/phpmd/output/unused.xml | 17 - .../Php/Exemplar/_files/phpmd_ruleset.xsd | 132 + .../static/testsuite/Php/LiveCodeTest.php | 7 +- .../testsuite/Php/_files/phpcs/ruleset.xml | 6 +- .../testsuite/Php/_files/phpmd/ruleset.xml | 8 +- dev/tests/static/testsuite/Util/Classes.php | 154 + .../{FileDataProvider.php => Util/Files.php} | 13 +- dev/tests/unit/framework/bootstrap.php | 2 +- dev/tests/unit/phpunit.xml.dist | 2 +- dev/tests/unit/testsuite/AllTests.php | 2 +- .../Layer/Filter/Price/AlgorithmTest.php | 19 +- .../Filter/Price/_files/_algorithm_data.php | 101 +- dev/tests/unit/testsuite/Magento/AllTests.php | 2 +- .../Magento/Autoload/Ns/TestClass.php | 2 +- .../testsuite/Magento/Autoload/TestClass.php | 2 +- .../Magento/Autoload/TestClassExists.php | 2 +- .../Magento/Autoload/TestClassMapInFile.php | 2 +- .../testsuite/Magento/Autoload/TestMap.php | 2 +- .../unit/testsuite/Magento/AutoloadTest.php | 6 +- .../testsuite/Magento/Config/AllTests.php | 2 +- .../unit/testsuite/Magento/Config/DomTest.php | 4 +- .../testsuite/Magento/Config/ThemeTest.php | 6 +- .../testsuite/Magento/Config/ViewTest.php | 2 +- .../unit/testsuite/Magento/Config/XsdTest.php | 2 +- .../Config/_files/dom/ambiguous_merged.xml | 2 +- .../Config/_files/dom/ambiguous_new_one.xml | 2 +- .../Config/_files/dom/ambiguous_new_two.xml | 2 +- .../Config/_files/dom/ambiguous_one.xml | 2 +- .../Config/_files/dom/ambiguous_two.xml | 2 +- .../Magento/Config/_files/dom/ids.xml | 2 +- .../Magento/Config/_files/dom/ids_merged.xml | 2 +- .../Magento/Config/_files/dom/ids_new.xml | 2 +- .../Magento/Config/_files/dom/no_ids.xml | 2 +- .../Config/_files/dom/no_ids_merged.xml | 2 +- .../Magento/Config/_files/dom/no_ids_new.xml | 2 +- .../_files/packages/default/default/theme.xml | 2 +- .../_files/packages/default/test/theme.xml | 2 +- .../_files/packages/default/test2/theme.xml | 2 +- .../_files/packages/test/default/theme.xml | 2 +- .../Magento/Config/_files/sample.xsd | 2 +- .../Magento/Config/_files/theme_invalid.xml | 2 +- .../Magento/Config/_files/view_invalid.xml | 2 +- .../Magento/Config/_files/view_one.xml | 2 +- .../Magento/Config/_files/view_two.xml | 2 +- .../testsuite/Magento/Convert/AllTests.php | 2 +- .../testsuite/Magento/Convert/ExcelTest.php | 2 +- .../Magento/Crypt/_files/_cipher_info.php | 2 +- .../Magento/Crypt/_files/_crypt_fixtures.php | 2 +- .../unit/testsuite/Magento/CryptTest.php | 2 +- .../testsuite/Magento/Profiler/AllTests.php | 2 +- .../Magento/Profiler/Output/AllTests.php | 2 +- .../Magento/Profiler/Output/CsvfileTest.php | 2 +- .../Magento/Profiler/Output/FirebugTest.php | 2 +- .../Magento/Profiler/Output/HtmlTest.php | 2 +- .../Magento/Profiler/OutputAbstractTest.php | 2 +- .../Magento/Profiler/_files/timers.php | 2 +- .../unit/testsuite/Magento/ProfilerTest.php | 2 +- dev/tests/unit/testsuite/Varien/AllTests.php | 2 +- .../Varien/Data/Collection/DbTest.php | 79 +- .../Varien/Db/Adapter/Pdo/MysqlTest.php | 91 + .../unit/testsuite/Varien/ObjectTest.php | 2 +- dev/tools/batch_tests/batch.php | 2 +- dev/tools/classmap/fs_generator.php | 2 +- dev/tools/classmap/log_generator.php | 2 +- dev/tools/classmap/logger.php | 2 +- dev/tools/migration/factory_names.php | 114 + downloader/Maged/Connect.php | 262 +- downloader/Maged/Connect/Frontend.php | 2 +- downloader/Maged/Controller.php | 107 +- downloader/Maged/Exception.php | 2 +- downloader/Maged/Model.php | 2 +- downloader/Maged/Model/Config.php | 2 +- downloader/Maged/Model/Config/Abstract.php | 2 +- downloader/Maged/Model/Config/Community.php | 2 +- downloader/Maged/Model/Config/Interface.php | 2 +- downloader/Maged/Model/Connect.php | 2 +- downloader/Maged/Model/Connect/Request.php | 2 +- downloader/Maged/Model/Dowloader.php | 2 +- downloader/Maged/Model/Session.php | 2 +- downloader/Maged/View.php | 2 +- downloader/index.php | 2 +- downloader/lib/Mage/Archive.php | 12 +- downloader/lib/Mage/Archive/Abstract.php | 11 +- downloader/lib/Mage/Archive/Bz.php | 40 +- downloader/lib/Mage/Archive/Gz.php | 40 +- downloader/lib/Mage/Archive/Helper/File.php | 274 + .../lib/Mage/Archive/Helper/File/Bz.php | 92 + .../lib/Mage/Archive/Helper/File/Gz.php | 83 + downloader/lib/Mage/Archive/Interface.php | 2 +- downloader/lib/Mage/Archive/Tar.php | 416 +- downloader/lib/Mage/Autoload/Simple.php | 2 +- downloader/lib/Mage/Backup.php | 59 + downloader/lib/Mage/Backup/Abstract.php | 318 ++ downloader/lib/Mage/Backup/Archive/Tar.php | 82 + downloader/lib/Mage/Backup/Db.php | 129 + 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 | 283 + .../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/Nomedia.php | 82 + downloader/lib/Mage/Backup/Snapshot.php | 140 + .../lib/Mage/Connect/Channel/Generator.php | 2 +- .../lib/Mage/Connect/Channel/Parser.php | 2 +- downloader/lib/Mage/Connect/Channel/VO.php | 2 +- downloader/lib/Mage/Connect/Command.php | 2 +- .../lib/Mage/Connect/Command/Channels.php | 2 +- .../Mage/Connect/Command/Channels_Header.php | 2 +- .../lib/Mage/Connect/Command/Config.php | 23 +- .../Mage/Connect/Command/Config_Header.php | 2 +- .../lib/Mage/Connect/Command/Install.php | 157 +- .../Mage/Connect/Command/Install_Header.php | 2 +- .../lib/Mage/Connect/Command/Package.php | 2 +- .../Mage/Connect/Command/Package_Header.php | 2 +- .../lib/Mage/Connect/Command/Registry.php | 2 +- .../Mage/Connect/Command/Registry_Header.php | 2 +- .../lib/Mage/Connect/Command/Remote.php | 2 +- .../Mage/Connect/Command/Remote_Header.php | 2 +- downloader/lib/Mage/Connect/Config.php | 181 +- downloader/lib/Mage/Connect/Converter.php | 2 +- downloader/lib/Mage/Connect/Frontend.php | 2 +- downloader/lib/Mage/Connect/Frontend/CLI.php | 2 +- downloader/lib/Mage/Connect/Ftp.php | 2 +- downloader/lib/Mage/Connect/Loader.php | 9 +- downloader/lib/Mage/Connect/Loader/Ftp.php | 2 +- downloader/lib/Mage/Connect/Package.php | 2 +- .../lib/Mage/Connect/Package/Hotfix.php | 2 +- .../lib/Mage/Connect/Package/Reader.php | 2 +- .../lib/Mage/Connect/Package/Target.php | 2 +- downloader/lib/Mage/Connect/Package/VO.php | 2 +- .../lib/Mage/Connect/Package/Writer.php | 2 +- downloader/lib/Mage/Connect/Packager.php | 85 +- downloader/lib/Mage/Connect/Rest.php | 146 +- downloader/lib/Mage/Connect/Singleconfig.php | 2 +- .../lib/Mage/Connect/Structures/Graph.php | 2 +- .../lib/Mage/Connect/Structures/Node.php | 2 +- downloader/lib/Mage/Connect/Validator.php | 171 +- downloader/lib/Mage/DB/Exception.php | 2 +- downloader/lib/Mage/DB/Mysqli.php | 2 +- downloader/lib/Mage/Exception.php | 6 +- downloader/lib/Mage/HTTP/Client.php | 22 +- downloader/lib/Mage/HTTP/Client/Curl.php | 2 +- downloader/lib/Mage/HTTP/Client/Socket.php | 2 +- downloader/lib/Mage/HTTP/IClient.php | 2 +- downloader/lib/Mage/System/Args.php | 10 +- downloader/lib/Mage/System/Dirs.php | 34 +- downloader/lib/Mage/System/Ftp.php | 509 ++ downloader/lib/Mage/Xml/Generator.php | 2 +- downloader/lib/Mage/Xml/Parser.php | 2 +- downloader/mage.php | 2 +- downloader/skin/boxes.css | 2 +- downloader/skin/ie7boxes.css | 2 +- downloader/skin/ieboxes.css | 2 +- downloader/skin/install/boxes.css | 2 +- downloader/skin/install/clears.css | 2 +- downloader/skin/install/ie7minus.css | 2 +- downloader/skin/install/iestyles.css | 2 +- downloader/skin/install/reset.css | 2 +- downloader/target.xml | 2 +- downloader/template/connect/iframe.phtml | 8 +- downloader/template/connect/packages.phtml | 49 +- .../template/connect/packages_prepare.phtml | 2 +- downloader/template/exception.phtml | 2 +- downloader/template/footer.phtml | 2 +- downloader/template/header.phtml | 2 +- downloader/template/index.phtml | 2 +- downloader/template/install/download.phtml | 24 +- downloader/template/install/footer.phtml | 2 +- downloader/template/install/header.phtml | 2 +- downloader/template/install/writable.phtml | 2 +- downloader/template/login.phtml | 2 +- downloader/template/messages.phtml | 2 +- downloader/template/noroute.phtml | 2 +- downloader/template/settings.phtml | 2 +- downloader/template/writable.phtml | 2 +- index.php | 2 +- index.php.sample | 2 +- lib/Mage/Archive.php | 12 +- lib/Mage/Archive/Abstract.php | 13 +- lib/Mage/Archive/Bz.php | 40 +- lib/Mage/Archive/Gz.php | 40 +- lib/Mage/Archive/Helper/File.php | 274 + lib/Mage/Archive/Helper/File/Bz.php | 92 + lib/Mage/Archive/Helper/File/Gz.php | 83 + lib/Mage/Archive/Interface.php | 2 +- lib/Mage/Archive/Tar.php | 416 +- lib/Mage/Autoload/Simple.php | 2 +- lib/Mage/Backup.php | 59 + lib/Mage/Backup/Abstract.php | 317 ++ lib/Mage/Backup/Archive/Tar.php | 82 + lib/Mage/Backup/Db.php | 129 + 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 | 198 + lib/Mage/Backup/Interface.php | 88 + lib/Mage/Backup/Media.php | 99 + lib/Mage/Backup/Nomedia.php | 82 + lib/Mage/Backup/Snapshot.php | 140 + lib/Mage/Connect/Channel/Generator.php | 2 +- lib/Mage/Connect/Channel/Parser.php | 2 +- lib/Mage/Connect/Channel/VO.php | 2 +- lib/Mage/Connect/Command.php | 2 +- lib/Mage/Connect/Command/Channels.php | 2 +- lib/Mage/Connect/Command/Channels_Header.php | 2 +- lib/Mage/Connect/Command/Config.php | 2 +- lib/Mage/Connect/Command/Config_Header.php | 2 +- lib/Mage/Connect/Command/Install.php | 2 +- lib/Mage/Connect/Command/Install_Header.php | 2 +- lib/Mage/Connect/Command/Package.php | 2 +- lib/Mage/Connect/Command/Package_Header.php | 2 +- lib/Mage/Connect/Command/Registry.php | 2 +- lib/Mage/Connect/Command/Registry_Header.php | 2 +- lib/Mage/Connect/Command/Remote.php | 2 +- lib/Mage/Connect/Command/Remote_Header.php | 2 +- lib/Mage/Connect/Config.php | 2 +- lib/Mage/Connect/Converter.php | 2 +- lib/Mage/Connect/Frontend.php | 2 +- lib/Mage/Connect/Frontend/CLI.php | 2 +- lib/Mage/Connect/Ftp.php | 464 +- lib/Mage/Connect/Loader.php | 2 +- lib/Mage/Connect/Loader/Ftp.php | 2 +- lib/Mage/Connect/Package.php | 2 +- lib/Mage/Connect/Package/Hotfix.php | 2 +- lib/Mage/Connect/Package/Reader.php | 2 +- lib/Mage/Connect/Package/Target.php | 2 +- lib/Mage/Connect/Package/VO.php | 2 +- lib/Mage/Connect/Package/Writer.php | 2 +- lib/Mage/Connect/Packager.php | 2 +- lib/Mage/Connect/Rest.php | 2 +- lib/Mage/Connect/Singleconfig.php | 2 +- lib/Mage/Connect/Structures/Graph.php | 2 +- lib/Mage/Connect/Structures/Node.php | 2 +- lib/Mage/Connect/Validator.php | 2 +- lib/Mage/DB/Exception.php | 2 +- lib/Mage/DB/Mysqli.php | 2 +- lib/Mage/Exception.php | 5 +- lib/Mage/HTTP/Client.php | 2 +- lib/Mage/HTTP/Client/Curl.php | 2 +- lib/Mage/HTTP/Client/Socket.php | 2 +- lib/Mage/HTTP/IClient.php | 2 +- lib/Mage/System/Args.php | 6 +- lib/Mage/System/Dirs.php | 4 +- lib/Mage/System/Ftp.php | 509 ++ lib/Mage/Xml/Generator.php | 2 +- lib/Mage/Xml/Parser.php | 2 +- lib/Magento/Autoload.php | 8 +- lib/Magento/Config/Dom.php | 6 +- lib/Magento/Config/Theme.php | 6 +- lib/Magento/Config/View.php | 2 +- lib/Magento/Config/XmlAbstract.php | 12 +- lib/Magento/Config/theme.xsd | 2 +- lib/Magento/Config/view.xsd | 2 +- lib/Magento/Convert/Excel.php | 2 +- lib/Magento/Crypt.php | 2 +- lib/Magento/Exception.php | 2 +- lib/Magento/Profiler.php | 2 +- lib/Magento/Profiler/Output/Csvfile.php | 2 +- lib/Magento/Profiler/Output/Firebug.php | 2 +- lib/Magento/Profiler/Output/Html.php | 2 +- lib/Magento/Profiler/OutputAbstract.php | 2 +- lib/Varien/Cache/Backend/Database.php | 2 +- lib/Varien/Cache/Backend/Eaccelerator.php | 2 +- lib/Varien/Cache/Backend/Memcached.php | 2 +- lib/Varien/Cache/Core.php | 2 +- lib/Varien/Convert/Container/Abstract.php | 2 +- lib/Varien/Convert/Exception.php | 2 +- lib/Varien/Convert/Mapper/Column.php | 2 +- lib/Varien/Convert/Mapper/Interface.php | 2 +- lib/Varien/Data/Collection.php | 2 +- lib/Varien/Data/Collection/Db.php | 76 +- lib/Varien/Data/Collection/Filesystem.php | 4 +- lib/Varien/Data/Form.php | 2 +- lib/Varien/Data/Form/Abstract.php | 17 +- lib/Varien/Data/Form/Element/Abstract.php | 2 +- lib/Varien/Data/Form/Element/Button.php | 2 +- lib/Varien/Data/Form/Element/Checkbox.php | 2 +- lib/Varien/Data/Form/Element/Checkboxes.php | 2 +- lib/Varien/Data/Form/Element/Collection.php | 9 +- lib/Varien/Data/Form/Element/Column.php | 2 +- lib/Varien/Data/Form/Element/Date.php | 2 +- lib/Varien/Data/Form/Element/Editor.php | 4 +- lib/Varien/Data/Form/Element/Fieldset.php | 2 +- lib/Varien/Data/Form/Element/File.php | 2 +- lib/Varien/Data/Form/Element/Gallery.php | 2 +- lib/Varien/Data/Form/Element/Hidden.php | 2 +- lib/Varien/Data/Form/Element/Image.php | 2 +- lib/Varien/Data/Form/Element/Imagefile.php | 2 +- lib/Varien/Data/Form/Element/Label.php | 27 +- lib/Varien/Data/Form/Element/Link.php | 2 +- lib/Varien/Data/Form/Element/Multiline.php | 2 +- lib/Varien/Data/Form/Element/Multiselect.php | 2 +- lib/Varien/Data/Form/Element/Note.php | 2 +- lib/Varien/Data/Form/Element/Obscure.php | 2 +- lib/Varien/Data/Form/Element/Password.php | 2 +- lib/Varien/Data/Form/Element/Radio.php | 2 +- lib/Varien/Data/Form/Element/Radios.php | 2 +- .../Data/Form/Element/Renderer/Interface.php | 2 +- lib/Varien/Data/Form/Element/Reset.php | 2 +- lib/Varien/Data/Form/Element/Select.php | 2 +- lib/Varien/Data/Form/Element/Submit.php | 2 +- lib/Varien/Data/Form/Element/Text.php | 2 +- lib/Varien/Data/Form/Element/Textarea.php | 2 +- lib/Varien/Data/Form/Element/Time.php | 2 +- lib/Varien/Data/Form/Filter/Date.php | 2 +- lib/Varien/Data/Form/Filter/Escapehtml.php | 2 +- lib/Varien/Data/Form/Filter/Interface.php | 2 +- lib/Varien/Data/Form/Filter/Striptags.php | 2 +- lib/Varien/Data/Tree.php | 2 +- lib/Varien/Data/Tree/Db.php | 2 +- lib/Varien/Data/Tree/Dbp.php | 2 +- lib/Varien/Data/Tree/Node.php | 2 +- lib/Varien/Data/Tree/Node/Collection.php | 2 +- lib/Varien/Date.php | 2 +- lib/Varien/Db/Adapter/Interface.php | 12 +- lib/Varien/Db/Adapter/Mysqli.php | 2 +- lib/Varien/Db/Adapter/Pdo/Mysql.php | 69 +- lib/Varien/Db/Ddl/Table.php | 2 +- lib/Varien/Db/Exception.php | 2 +- lib/Varien/Db/Helper.php | 2 +- lib/Varien/Db/Select.php | 2 +- lib/Varien/Db/Statement/Parameter.php | 2 +- lib/Varien/Db/Statement/Pdo/Mysql.php | 2 +- lib/Varien/Db/Statement/Sqlsrv.php | 2 +- lib/Varien/Db/Tree.php | 2 +- lib/Varien/Db/Tree/Exception.php | 2 +- lib/Varien/Db/Tree/Node.php | 2 +- lib/Varien/Db/Tree/Node/Exception.php | 2 +- lib/Varien/Db/Tree/NodeSet.php | 2 +- lib/Varien/Db/Tree/NodeSet/Exception.php | 2 +- lib/Varien/Debug.php | 2 +- lib/Varien/Directory/Collection.php | 2 +- lib/Varien/Directory/Factory.php | 2 +- lib/Varien/Directory/IFactory.php | 2 +- lib/Varien/Event.php | 2 +- lib/Varien/Event/Collection.php | 2 +- lib/Varien/Event/Observer.php | 2 +- lib/Varien/Event/Observer/Collection.php | 2 +- lib/Varien/Event/Observer/Cron.php | 2 +- lib/Varien/Event/Observer/Regex.php | 2 +- lib/Varien/Exception.php | 2 +- lib/Varien/File/Csv.php | 2 +- lib/Varien/File/CsvMulty.php | 2 +- lib/Varien/File/Object.php | 2 +- lib/Varien/File/Transfer/Adapter/Http.php | 2 +- lib/Varien/File/Uploader.php | 2 +- lib/Varien/Filter/Array.php | 2 +- lib/Varien/Filter/Array/Grid.php | 2 +- lib/Varien/Filter/Email.php | 2 +- lib/Varien/Filter/Money.php | 2 +- lib/Varien/Filter/Object.php | 2 +- lib/Varien/Filter/Object/Grid.php | 2 +- lib/Varien/Filter/Sprintf.php | 2 +- lib/Varien/Filter/Template.php | 2 +- lib/Varien/Filter/Template/Simple.php | 2 +- .../Filter/Template/Tokenizer/Abstract.php | 2 +- .../Filter/Template/Tokenizer/Parameter.php | 2 +- .../Filter/Template/Tokenizer/Variable.php | 2 +- lib/Varien/Gdata/Gshopping/Content.php | 2 +- lib/Varien/Gdata/Gshopping/Entry.php | 2 +- .../Gdata/Gshopping/Extension/Attribute.php | 2 +- .../Gdata/Gshopping/Extension/Control.php | 2 +- .../Gdata/Gshopping/Extension/Shipping.php | 2 +- lib/Varien/Gdata/Gshopping/Extension/Tax.php | 2 +- lib/Varien/Gdata/Gshopping/HttpException.php | 2 +- lib/Varien/Gdata/Gshopping/ItemQuery.php | 2 +- lib/Varien/Http/Adapter/Curl.php | 81 +- lib/Varien/Http/Client.php | 2 +- lib/Varien/Image.php | 2 +- lib/Varien/Image/Adapter.php | 2 +- lib/Varien/Image/Adapter/Abstract.php | 2 +- lib/Varien/Image/Adapter/Gd2.php | 2 +- lib/Varien/Io/Abstract.php | 2 +- lib/Varien/Io/Exception.php | 2 +- lib/Varien/Io/File.php | 2 +- lib/Varien/Io/Ftp.php | 2 +- lib/Varien/Io/Interface.php | 2 +- lib/Varien/Io/Sftp.php | 2 +- lib/Varien/Object.php | 2 +- lib/Varien/Object/Cache.php | 2 +- lib/Varien/Object/Mapper.php | 2 +- lib/Varien/Pear.php | 2 +- lib/Varien/Pear/Frontend.php | 2 +- lib/Varien/Pear/Package.php | 2 +- lib/Varien/Pear/Registry.php | 2 +- lib/Varien/Simplexml/Config.php | 2 +- .../Simplexml/Config/Cache/Abstract.php | 2 +- lib/Varien/Simplexml/Config/Cache/File.php | 2 +- lib/Varien/Simplexml/Element.php | 2 +- lib/Zend/Captcha/Word.php | 16 +- lib/flex/uploader/uploader.mxml | 2 +- lib/flex/uploader/uploaderSingle.mxml | 2 +- lib/flex/varien/varien/upload/Uploader.as | 2 +- .../varien/varien/upload/UploaderEvent.as | 2 +- .../varien/varien/upload/UploaderSingle.as | 2 +- pub/cron.php | 2 +- pub/errors/404.php | 2 +- pub/errors/503.php | 2 +- pub/errors/default/404.phtml | 2 +- pub/errors/default/503.phtml | 2 +- pub/errors/default/css/styles.css | 2 +- pub/errors/default/page.phtml | 2 +- pub/errors/default/report.phtml | 2 +- pub/errors/design.xml | 2 +- pub/errors/local.xml.sample | 2 +- pub/errors/processor.php | 2 +- pub/errors/report.php | 2 +- pub/get.php | 2 +- pub/index.php | 2 +- pub/js/jquery/jquery-1.7.1.min.js | 4 + pub/js/jquery/jquery-no-conflict.js | 26 + pub/js/lib/dropdown.js | 2 +- pub/js/lib/flex.js | 2 +- pub/js/mage/adminhtml/accordion.js | 2 +- pub/js/mage/adminhtml/backup.js | 189 + pub/js/mage/adminhtml/browser.js | 2 +- pub/js/mage/adminhtml/events.js | 2 +- .../mage/adminhtml/fix-extjs-defer-before.js | 42 + pub/js/mage/adminhtml/fix-extjs-defer.js | 8 +- pub/js/mage/adminhtml/flexuploader.js | 2 +- pub/js/mage/adminhtml/form.js | 17 +- pub/js/mage/adminhtml/grid.js | 24 +- pub/js/mage/adminhtml/image.js | 2 +- pub/js/mage/adminhtml/loader.js | 2 +- pub/js/mage/adminhtml/tabs.js | 2 +- pub/js/mage/adminhtml/tools.js | 2 +- pub/js/mage/adminhtml/uploader.js | 2 +- .../plugins/magentovariable/editor_plugin.js | 2 +- .../plugins/magentowidget/editor_plugin.js | 2 +- .../mage/adminhtml/wysiwyg/tiny_mce/setup.js | 2 +- .../themes/advanced/skins/default/content.css | 2 +- .../themes/advanced/skins/default/dialog.css | 2 +- pub/js/mage/adminhtml/wysiwyg/widget.js | 16 +- pub/js/mage/captcha.js | 87 + pub/js/mage/directpost.js | 2 +- pub/js/mage/translate.js | 2 +- pub/js/mage/translate_inline.css | 6 +- pub/js/mage/translate_inline.js | 20 +- pub/js/prototype/prototype.js | 2 +- pub/js/prototype/validation.js | 47 +- pub/js/varien/configurable.js | 2 +- pub/js/varien/form.js | 5 +- pub/js/varien/js.js | 23 +- pub/js/varien/product.js | 37 +- 5730 files changed, 48625 insertions(+), 15554 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/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 100755 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/Store/Switcher/Form/Renderer/Fieldset.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/Source/Customer/Address/Type.php create mode 100644 app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group/Multiselect.php create mode 100644 app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php create mode 100644 app/code/core/Mage/Adminhtml/etc/translater.xml create mode 100644 app/code/core/Mage/Adminhtml/view/adminhtml/backup/dialogs.phtml create mode 100644 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/group.phtml create mode 100644 app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/account/form/renderer/group.phtml create mode 100644 app/code/core/Mage/Adminhtml/view/adminhtml/customer/sales/order/create/address/form/renderer/vat.phtml create mode 100644 app/code/core/Mage/Adminhtml/view/adminhtml/customer/system/config/validatevat.phtml create mode 100644 app/code/core/Mage/Adminhtml/view/adminhtml/promo/salesrulejs.phtml create mode 100644 app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/form/renderer/fieldset.phtml 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/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/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/Captcha/view/adminhtml/layout.xml create mode 100644 app/code/core/Mage/Captcha/view/adminhtml/reload.png create mode 100644 app/code/core/Mage/Captcha/view/adminhtml/zend.phtml create mode 100644 app/code/core/Mage/Captcha/view/frontend/layout.xml create mode 100644 app/code/core/Mage/Captcha/view/frontend/reload.png create mode 100644 app/code/core/Mage/Captcha/view/frontend/zend.phtml 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 100755 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.10-1.6.0.0.11.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/sql/cataloginventory_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php create mode 100644 app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.1-1.6.0.2.php create mode 100644 app/code/core/Mage/Checkout/Model/Cart/Interface.php create mode 100644 app/code/core/Mage/Checkout/etc/translater.xml create mode 100644 app/code/core/Mage/Core/Helper/Hint.php create mode 100644 app/code/core/Mage/Core/Model/Calculator.php create mode 100644 app/code/core/Mage/Core/etc/translater.xml create mode 100644 app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php create mode 100644 app/code/core/Mage/Customer/data/customer_setup/data-upgrade-1.6.1.0-1.6.2.0.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/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/Rule/Model/Abstract.php create mode 100644 app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php create mode 100644 app/code/core/Mage/Rule/Model/Resource/Abstract.php create mode 100644 app/code/core/Mage/Rule/Model/Resource/Rule/Collection/Abstract.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 100755 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/SalesRule/sql/salesrule_setup/upgrade-1.6.0.2-1.6.0.3.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/Method/Abstract.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/Model/Shipping/Carrier/Dhl/Label/Pdf.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php create mode 100644 app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php create mode 100644 app/code/core/Mage/Usa/etc/dhl/international/countries.xml create mode 100644 app/code/core/Mage/Usa/view/adminhtml/dhl/logo.jpg create mode 100644 app/code/core/Mage/Usa/view/adminhtml/dhl/unitofmeasure.phtml create mode 100644 app/code/core/Mage/Widget/etc/translater.xml create mode 100644 app/code/core/Zend/Date.php create mode 100644 app/design/adminhtml/default/default/skin/default/images/btn_gr_bg.gif create mode 100644 app/design/adminhtml/default/default/skin/default/images/btn_gr_on.gif create mode 100644 app/design/adminhtml/default/default/skin/default/images/btn_gr_over.gif create mode 100644 app/design/adminhtml/default/default/skin/default/images/i_question-mark.png create mode 100644 app/design/frontend/default/iphone/skin/default/images/i_star_black.png create mode 100755 app/etc/modules/Mage_Captcha.xml create mode 100644 dev/tests/integration/testsuite/Mage/Admin/Model/UserTest.php create mode 100644 dev/tests/integration/testsuite/Mage/Admin/_files/user.php create mode 100644 dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/UrlTest.php create mode 100644 dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/_files/url_rewrites.php create mode 100644 dev/tests/integration/testsuite/Mage/Core/Model/Session/Abstract/VarienTest.php rename dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/{varien/product.js => jquery/jquery-no-conflict.js} (93%) create mode 100644 dev/tests/static/testsuite/Legacy/FilesystemTest.php create mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/data.php delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/coupling.xml delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/cyclomatic_complexity.xml delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/descendant_count.xml delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/field_count.xml delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/inheritance_depth.xml delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_count.xml delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_length.xml delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/naming.xml delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/parameter_list.xml delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement.xml delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement_goto.xml delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/public_count.xml delete mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/unused.xml create mode 100644 dev/tests/static/testsuite/Php/Exemplar/_files/phpmd_ruleset.xsd create mode 100644 dev/tests/static/testsuite/Util/Classes.php rename dev/tests/static/testsuite/{FileDataProvider.php => Util/Files.php} (97%) rename dev/tests/{integration => unit}/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php (76%) rename dev/tests/{integration => unit}/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php (74%) create mode 100644 dev/tests/unit/testsuite/Varien/Db/Adapter/Pdo/MysqlTest.php create mode 100644 dev/tools/migration/factory_names.php 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/Nomedia.php create mode 100755 downloader/lib/Mage/Backup/Snapshot.php create mode 100755 downloader/lib/Mage/System/Ftp.php 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/Nomedia.php create mode 100644 lib/Mage/Backup/Snapshot.php create mode 100644 lib/Mage/System/Ftp.php create mode 100644 pub/js/jquery/jquery-1.7.1.min.js create mode 100644 pub/js/jquery/jquery-no-conflict.js create mode 100644 pub/js/mage/adminhtml/backup.js create mode 100644 pub/js/mage/adminhtml/fix-extjs-defer-before.js create mode 100644 pub/js/mage/captcha.js diff --git a/.gitignore b/.gitignore index 813e4da6fb2..181608b1714 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ /app/etc/local.xml /app/etc/local.xml.* /app/etc/modules/XEnterprise_Enabler.xml -/app/locale/en_US_org /downloader/.cache /downloader/cache.cfg /downloader/connect.cfg diff --git a/app/Mage.php b/app/Mage.php index 2c15fe09506..60df8c62a14 100644 --- a/app/Mage.php +++ b/app/Mage.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) */ @@ -397,7 +397,7 @@ final class Mage * * @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()) @@ -497,7 +497,7 @@ final class Mage } /** - * Retreive resource helper object + * Retrieve resource helper object * * @param string $moduleName * @return Mage_Core_Model_Resource_Helper_Abstract @@ -555,7 +555,8 @@ final class Mage self::$_app = new Mage_Core_Model_App(); self::setRoot(); self::$_events = new Varien_Event_Collection(); - self::$_config = new Mage_Core_Model_Config($options); + self::setIsInstalled($options); + self::setConfigModel($options); Magento_Profiler::start('self::app::init'); self::$_app->init($code, $type, $options); @@ -577,7 +578,8 @@ final class Mage try { self::setRoot(); self::$_app = new Mage_Core_Model_App(); - self::$_config = new Mage_Core_Model_Config(); + self::setIsInstalled($options); + self::setConfigModel($options); if (!empty($modules)) { self::$_app->initSpecified($code, $type, $options, $modules); @@ -616,7 +618,8 @@ final class Mage self::$_app->setResponse($options['response']); } self::$_events = new Varien_Event_Collection(); - self::$_config = new Mage_Core_Model_Config($options); + self::setIsInstalled($options); + self::setConfigModel($options); self::$_app->run(array( 'scope_code' => $code, 'scope_type' => $type, @@ -647,6 +650,40 @@ final class Mage } } + /** + * Set application isInstalled flag based on given options + * + * @param array $options + */ + public static function setIsInstalled($options = array()) + { + if (isset($options['is_installed']) && $options['is_installed']) { + self::$_isInstalled = true; + } + } + + /** + * Set application Config model + * + * @param array $options + */ + public static function setConfigModel($options = array()) + { + if (isset($options['config_model']) && Magento_Autoload::getInstance()->classExists($options['config_model'])) { + $alternativeConfigModelName = $options['config_model']; + unset($options['config_model']); + $alternativeConfigModel = new $alternativeConfigModelName($options); + } else { + $alternativeConfigModel = null; + } + + if (!is_null($alternativeConfigModel) && ($alternativeConfigModel instanceof Mage_Core_Model_Config)) { + self::$_config = $alternativeConfigModel; + } else { + self::$_config = new Mage_Core_Model_Config($options); + } + } + /** * Retrieve application installation flag * diff --git a/app/bootstrap.php b/app/bootstrap.php index cb2098ccc96..5f431e83807 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/community/Phoenix/Moneybookers/Block/Form.php b/app/code/community/Phoenix/Moneybookers/Block/Form.php index 78940d79cec..e47da3411e1 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Form.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Form.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Block_Form extends Mage_Payment_Block_Form diff --git a/app/code/community/Phoenix/Moneybookers/Block/Info.php b/app/code/community/Phoenix/Moneybookers/Block/Info.php index 61ed815305c..d418a6828c0 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Info.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Info.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Block_Info extends Mage_Payment_Block_Info diff --git a/app/code/community/Phoenix/Moneybookers/Block/Jsinit.php b/app/code/community/Phoenix/Moneybookers/Block/Jsinit.php index fb0d5b316eb..b4080349822 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Jsinit.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Jsinit.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Block_Jsinit extends Mage_Adminhtml_Block_Template diff --git a/app/code/community/Phoenix/Moneybookers/Block/Payment.php b/app/code/community/Phoenix/Moneybookers/Block/Payment.php index 48bb8b9f17f..870db6ad7f0 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Payment.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Payment.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Block_Payment extends Mage_Core_Block_Template diff --git a/app/code/community/Phoenix/Moneybookers/Block/Placeform.php b/app/code/community/Phoenix/Moneybookers/Block/Placeform.php index 025fe292bcb..6d02bbad043 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Placeform.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Placeform.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Block_Placeform extends Mage_Core_Block_Template diff --git a/app/code/community/Phoenix/Moneybookers/Block/Redirect.php b/app/code/community/Phoenix/Moneybookers/Block/Redirect.php index 362da4b5890..418f6d71140 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Redirect.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Redirect.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Block_Redirect extends Mage_Core_Block_Template diff --git a/app/code/community/Phoenix/Moneybookers/Helper/Data.php b/app/code/community/Phoenix/Moneybookers/Helper/Data.php index 83be78bf166..75fcb1d3ce9 100644 --- a/app/code/community/Phoenix/Moneybookers/Helper/Data.php +++ b/app/code/community/Phoenix/Moneybookers/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Helper_Data extends Mage_Payment_Helper_Data diff --git a/app/code/community/Phoenix/Moneybookers/Model/Abstract.php b/app/code/community/Phoenix/Moneybookers/Model/Abstract.php index 74c8fcded23..80f4eff14c3 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Abstract.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Abstract.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ abstract class Phoenix_Moneybookers_Model_Abstract extends Mage_Payment_Model_Method_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Acc.php b/app/code/community/Phoenix/Moneybookers/Model/Acc.php index 2be5714cdd4..22a2df45016 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Acc.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Acc.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Acc extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Csi.php b/app/code/community/Phoenix/Moneybookers/Model/Csi.php index c6bdd497794..4b19d99d23e 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Csi.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Csi.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Csi extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Did.php b/app/code/community/Phoenix/Moneybookers/Model/Did.php index f0f1c7554ff..842b6b26015 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Did.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Did.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Did extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Dnk.php b/app/code/community/Phoenix/Moneybookers/Model/Dnk.php index 9caee9881d9..7e0a130b64b 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Dnk.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Dnk.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Dnk extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Ebt.php b/app/code/community/Phoenix/Moneybookers/Model/Ebt.php index f04d5b93fb5..26ef8296aad 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Ebt.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Ebt.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Ebt extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Ent.php b/app/code/community/Phoenix/Moneybookers/Model/Ent.php index f57f433d81c..051378fdada 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Ent.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Ent.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Ent extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Event.php b/app/code/community/Phoenix/Moneybookers/Model/Event.php index 32c144b1e26..ad043de07b2 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Event.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Event.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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/code/community/Phoenix/Moneybookers/Model/Gcb.php b/app/code/community/Phoenix/Moneybookers/Model/Gcb.php index 62b60426ce4..3b46d2b686a 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Gcb.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Gcb.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Gcb extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Gir.php b/app/code/community/Phoenix/Moneybookers/Model/Gir.php index af91eb7a104..5617cdff903 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Gir.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Gir.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Gir extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Idl.php b/app/code/community/Phoenix/Moneybookers/Model/Idl.php index 36fc568d9aa..c8246a3a104 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Idl.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Idl.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Idl extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Lsr.php b/app/code/community/Phoenix/Moneybookers/Model/Lsr.php index f9ea17b4c79..e134116d4e1 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Lsr.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Lsr.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Lsr extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Mae.php b/app/code/community/Phoenix/Moneybookers/Model/Mae.php index 37c6780408b..1f45ad5c925 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Mae.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Mae.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Mae extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Npy.php b/app/code/community/Phoenix/Moneybookers/Model/Npy.php index b0351157b27..b975c5f2fb8 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Npy.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Npy.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Npy extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Obt.php b/app/code/community/Phoenix/Moneybookers/Model/Obt.php index a236c4eb7e1..90226f2a903 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Obt.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Obt.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Obt extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Pli.php b/app/code/community/Phoenix/Moneybookers/Model/Pli.php index 4809302e76b..31381dd9d89 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Pli.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Pli.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Pli extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Psp.php b/app/code/community/Phoenix/Moneybookers/Model/Psp.php index 3ebb011f5bb..e7e502dbebf 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Psp.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Psp.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Psp extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Pwy.php b/app/code/community/Phoenix/Moneybookers/Model/Pwy.php index f70fe7b8090..457421c779a 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Pwy.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Pwy.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Pwy extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Sft.php b/app/code/community/Phoenix/Moneybookers/Model/Sft.php index c8600a60295..c0d20405955 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Sft.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Sft.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Sft extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/So2.php b/app/code/community/Phoenix/Moneybookers/Model/So2.php index 589c2ed3b06..dc687e6d987 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/So2.php +++ b/app/code/community/Phoenix/Moneybookers/Model/So2.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_So2 extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Wlt.php b/app/code/community/Phoenix/Moneybookers/Model/Wlt.php index d5afa6c617e..7f62412eef1 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Wlt.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Wlt.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_Model_Wlt extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/controllers/MoneybookersController.php b/app/code/community/Phoenix/Moneybookers/controllers/MoneybookersController.php index 8fb226f56f7..d71c3f7ff27 100644 --- a/app/code/community/Phoenix/Moneybookers/controllers/MoneybookersController.php +++ b/app/code/community/Phoenix/Moneybookers/controllers/MoneybookersController.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_MoneybookersController extends Mage_Adminhtml_Controller_Action diff --git a/app/code/community/Phoenix/Moneybookers/controllers/ProcessingController.php b/app/code/community/Phoenix/Moneybookers/controllers/ProcessingController.php index 187e5933721..2bb4d8ba3d9 100644 --- a/app/code/community/Phoenix/Moneybookers/controllers/ProcessingController.php +++ b/app/code/community/Phoenix/Moneybookers/controllers/ProcessingController.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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) */ class Phoenix_Moneybookers_ProcessingController extends Mage_Core_Controller_Front_Action diff --git a/app/code/community/Phoenix/Moneybookers/etc/adminhtml.xml b/app/code/community/Phoenix/Moneybookers/etc/adminhtml.xml index 36afe10c99d..2a2b02f59c6 100644 --- a/app/code/community/Phoenix/Moneybookers/etc/adminhtml.xml +++ b/app/code/community/Phoenix/Moneybookers/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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/code/community/Phoenix/Moneybookers/etc/config.xml b/app/code/community/Phoenix/Moneybookers/etc/config.xml index e1811b93186..9d6fa55ad6e 100644 --- a/app/code/community/Phoenix/Moneybookers/etc/config.xml +++ b/app/code/community/Phoenix/Moneybookers/etc/config.xml @@ -21,7 +21,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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/code/community/Phoenix/Moneybookers/etc/system.xml b/app/code/community/Phoenix/Moneybookers/etc/system.xml index d9099c6ede7..d2dae0a0ccd 100644 --- a/app/code/community/Phoenix/Moneybookers/etc/system.xml +++ b/app/code/community/Phoenix/Moneybookers/etc/system.xml @@ -21,7 +21,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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/code/community/Phoenix/Moneybookers/sql/moneybookers_setup/install-1.6.0.0.php b/app/code/community/Phoenix/Moneybookers/sql/moneybookers_setup/install-1.6.0.0.php index 7614447e1e0..6d1346ecfed 100644 --- a/app/code/community/Phoenix/Moneybookers/sql/moneybookers_setup/install-1.6.0.0.php +++ b/app/code/community/Phoenix/Moneybookers/sql/moneybookers_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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/code/community/Phoenix/Moneybookers/view/adminhtml/activation.js b/app/code/community/Phoenix/Moneybookers/view/adminhtml/activation.js index 441181a328c..fc30ee9a748 100644 --- a/app/code/community/Phoenix/Moneybookers/view/adminhtml/activation.js +++ b/app/code/community/Phoenix/Moneybookers/view/adminhtml/activation.js @@ -19,7 +19,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @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/code/community/Phoenix/Moneybookers/view/adminhtml/info.phtml b/app/code/community/Phoenix/Moneybookers/view/adminhtml/info.phtml index 6e0b9e6e43d..8c3625a0ef4 100644 --- a/app/code/community/Phoenix/Moneybookers/view/adminhtml/info.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/adminhtml/info.phtml @@ -20,7 +20,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/code/community/Phoenix/Moneybookers/view/adminhtml/jsinit.phtml b/app/code/community/Phoenix/Moneybookers/view/adminhtml/jsinit.phtml index 716755ef0d7..80a78fcfbb9 100644 --- a/app/code/community/Phoenix/Moneybookers/view/adminhtml/jsinit.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/adminhtml/jsinit.phtml @@ -20,7 +20,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/code/community/Phoenix/Moneybookers/view/adminhtml/layout.xml b/app/code/community/Phoenix/Moneybookers/view/adminhtml/layout.xml index 4ee3351f27f..29b7b0d40c2 100644 --- a/app/code/community/Phoenix/Moneybookers/view/adminhtml/layout.xml +++ b/app/code/community/Phoenix/Moneybookers/view/adminhtml/layout.xml @@ -21,7 +21,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/code/community/Phoenix/Moneybookers/view/adminhtml/pdf/info.phtml b/app/code/community/Phoenix/Moneybookers/view/adminhtml/pdf/info.phtml index 16fe5c4531a..e2f9ad7ae9d 100644 --- a/app/code/community/Phoenix/Moneybookers/view/adminhtml/pdf/info.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/adminhtml/pdf/info.phtml @@ -20,7 +20,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/code/community/Phoenix/Moneybookers/view/frontend/blank.phtml b/app/code/community/Phoenix/Moneybookers/view/frontend/blank.phtml index c56c42610c9..1752c9c4b30 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/blank.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/blank.phtml @@ -20,7 +20,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/code/community/Phoenix/Moneybookers/view/frontend/form.phtml b/app/code/community/Phoenix/Moneybookers/view/frontend/form.phtml index fc81acd03c9..8484c1e2b6d 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/form.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/form.phtml @@ -20,7 +20,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/code/community/Phoenix/Moneybookers/view/frontend/info.phtml b/app/code/community/Phoenix/Moneybookers/view/frontend/info.phtml index 2e1aa28623e..8e03475a7f9 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/info.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/info.phtml @@ -20,7 +20,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/code/community/Phoenix/Moneybookers/view/frontend/layout.xml b/app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml index 78315e278f2..aff28c1b59d 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml @@ -21,7 +21,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/code/community/Phoenix/Moneybookers/view/frontend/payment.phtml b/app/code/community/Phoenix/Moneybookers/view/frontend/payment.phtml index 598648a66f0..a1f13e95623 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/payment.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/payment.phtml @@ -20,7 +20,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/code/community/Phoenix/Moneybookers/view/frontend/placeform.phtml b/app/code/community/Phoenix/Moneybookers/view/frontend/placeform.phtml index 4314c9f3aae..0a0c2457ab0 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/placeform.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/placeform.phtml @@ -20,7 +20,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/code/community/Phoenix/Moneybookers/view/frontend/redirect.phtml b/app/code/community/Phoenix/Moneybookers/view/frontend/redirect.phtml index 5278afd2660..5ce2ebdf968 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/redirect.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/redirect.phtml @@ -20,7 +20,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/code/core/Mage/Admin/Helper/Data.php b/app/code/core/Mage/Admin/Helper/Data.php index 0bc10b5f8b3..16efad6d994 100644 --- a/app/code/core/Mage/Admin/Helper/Data.php +++ b/app/code/core/Mage/Admin/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) */ diff --git a/app/code/core/Mage/Admin/Model/Acl.php b/app/code/core/Mage/Admin/Model/Acl.php index aa5a2da6998..57ad0e01ff7 100644 --- a/app/code/core/Mage/Admin/Model/Acl.php +++ b/app/code/core/Mage/Admin/Model/Acl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Acl/Resource.php b/app/code/core/Mage/Admin/Model/Acl/Resource.php index c0b6542a52c..54ce97615e0 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Resource.php +++ b/app/code/core/Mage/Admin/Model/Acl/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Acl/Role/Generic.php b/app/code/core/Mage/Admin/Model/Acl/Role/Generic.php index 83b0d9f6b21..232e528f4c6 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Role/Generic.php +++ b/app/code/core/Mage/Admin/Model/Acl/Role/Generic.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Acl/Role/Group.php b/app/code/core/Mage/Admin/Model/Acl/Role/Group.php index 5bf94647c9c..4afcea59df5 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Role/Group.php +++ b/app/code/core/Mage/Admin/Model/Acl/Role/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Acl/Role/Registry.php b/app/code/core/Mage/Admin/Model/Acl/Role/Registry.php index e3e8f2086db..41c56f9d4d3 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Role/Registry.php +++ b/app/code/core/Mage/Admin/Model/Acl/Role/Registry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Acl/Role/User.php b/app/code/core/Mage/Admin/Model/Acl/Role/User.php index f68c266be4e..728b20b199b 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Role/User.php +++ b/app/code/core/Mage/Admin/Model/Acl/Role/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Config.php b/app/code/core/Mage/Admin/Model/Config.php index 04830f2cb97..6dcd1c41f50 100644 --- a/app/code/core/Mage/Admin/Model/Config.php +++ b/app/code/core/Mage/Admin/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,6 +101,9 @@ class Mage_Admin_Model_Config extends Varien_Simplexml_Config } foreach ($children as $res) { + if (1 == $res->disabled) { + continue; + } $this->loadAclResources($acl, $res, $resourceName); } return $this; diff --git a/app/code/core/Mage/Admin/Model/Observer.php b/app/code/core/Mage/Admin/Model/Observer.php index 1a6742665f1..89de6db9211 100644 --- a/app/code/core/Mage/Admin/Model/Observer.php +++ b/app/code/core/Mage/Admin/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 @@ */ class Mage_Admin_Model_Observer { + const FLAG_NO_LOGIN = 'no-login'; /** * Handler for controller_action_predispatch event * @@ -51,7 +52,8 @@ class Mage_Admin_Model_Observer 'forgotpassword', 'resetpassword', 'resetpasswordpost', - 'logout' + 'logout', + 'refresh' // captcha refresh ); if (in_array($requestedActionName, $openActions)) { $request->setDispatched(true); @@ -64,7 +66,7 @@ class Mage_Admin_Model_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/Resource/Acl.php b/app/code/core/Mage/Admin/Model/Resource/Acl.php index 92d45d22cc1..c5b8d578521 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Acl.php +++ b/app/code/core/Mage/Admin/Model/Resource/Acl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Permissions/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Permissions/Collection.php index c4222f94a15..1781a2294cd 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Permissions/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Permissions/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Role.php b/app/code/core/Mage/Admin/Model/Resource/Role.php index 73728a22db2..3e8112bf3fb 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Role.php +++ b/app/code/core/Mage/Admin/Model/Resource/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Role/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Role/Collection.php index 2fef922f2cd..5e5191981b8 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Role/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Role/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Roles.php b/app/code/core/Mage/Admin/Model/Resource/Roles.php index 7241563db2c..eef0f4cf724 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Roles.php +++ b/app/code/core/Mage/Admin/Model/Resource/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php index 5d856ed1a1f..08b07eead7b 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php index e5dab9a4a51..1ee78cdfba9 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Rules.php b/app/code/core/Mage/Admin/Model/Resource/Rules.php index c636ba0740c..ea4d2149394 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Rules.php +++ b/app/code/core/Mage/Admin/Model/Resource/Rules.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Rules/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Rules/Collection.php index 16f49880769..ece1b0dc1b0 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Rules/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Rules/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/User.php b/app/code/core/Mage/Admin/Model/Resource/User.php index 04d52fac1fd..274db25183a 100755 --- a/app/code/core/Mage/Admin/Model/Resource/User.php +++ b/app/code/core/Mage/Admin/Model/Resource/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/User/Collection.php b/app/code/core/Mage/Admin/Model/Resource/User/Collection.php index 37ba2c50a7c..07065b0c03f 100755 --- a/app/code/core/Mage/Admin/Model/Resource/User/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/User/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Role.php b/app/code/core/Mage/Admin/Model/Role.php index ff22a35b071..c2f8d283cb0 100644 --- a/app/code/core/Mage/Admin/Model/Role.php +++ b/app/code/core/Mage/Admin/Model/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Roles.php b/app/code/core/Mage/Admin/Model/Roles.php index 90386a9afc1..62ebfcfadc5 100644 --- a/app/code/core/Mage/Admin/Model/Roles.php +++ b/app/code/core/Mage/Admin/Model/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,42 +53,86 @@ class Mage_Admin_Model_Roles extends Mage_Core_Model_Abstract */ protected $_eventPrefix = 'admin_roles'; + /** + * Constructor + */ protected function _construct() { $this->_init('Mage_Admin_Model_Resource_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('Mage_Admin_Model_Resource_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 = 'Mage_Adminhtml') { @@ -99,7 +143,7 @@ class Mage_Admin_Model_Roles extends Mage_Core_Model_Abstract $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 @@ class Mage_Admin_Model_Roles extends Mage_Core_Model_Abstract } } + //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/Rules.php b/app/code/core/Mage/Admin/Model/Rules.php index 98c4572c5ac..18510a62648 100644 --- a/app/code/core/Mage/Admin/Model/Rules.php +++ b/app/code/core/Mage/Admin/Model/Rules.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Session.php b/app/code/core/Mage/Admin/Model/Session.php index 21e6eeb370d..87b119e050c 100644 --- a/app/code/core/Mage/Admin/Model/Session.php +++ b/app/code/core/Mage/Admin/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/User.php b/app/code/core/Mage/Admin/Model/User.php index 5d5107adb35..68f3d61bbf9 100644 --- a/app/code/core/Mage/Admin/Model/User.php +++ b/app/code/core/Mage/Admin/Model/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -317,6 +317,10 @@ class Mage_Admin_Model_User extends Mage_Core_Model_Abstract $result = false; try { + Mage::dispatchEvent('admin_user_authenticate_before', array( + 'username' => $username, + 'user' => $this + )); $this->loadByUsername($username); $sensitive = ($config) ? $username == $this->getUsername() : true; @@ -384,7 +388,10 @@ class Mage_Admin_Model_User extends Mage_Core_Model_Abstract */ public function loadByUsername($username) { - $this->setData($this->getResource()->loadByUsername($username)); + $data = $this->getResource()->loadByUsername($username); + if ($data !== false) { + $this->setData($data); + } return $this; } @@ -533,7 +540,7 @@ class Mage_Admin_Model_User extends Mage_Core_Model_Abstract throw Mage::exception('Mage_Core', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Invalid password reset token.')); } $this->setRpToken($newResetPasswordLinkToken); - $currentDate = Varien_Date::now(true); + $currentDate = Varien_Date::now(); $this->setRpTokenCreatedAt($currentDate); return $this; @@ -555,7 +562,7 @@ class Mage_Admin_Model_User extends Mage_Core_Model_Abstract $tokenExpirationPeriod = Mage::helper('Mage_Admin_Helper_Data')->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/data/admin_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Admin/data/admin_setup/data-install-1.6.0.0.php index 235194f62aa..e72af399b2c 100644 --- a/app/code/core/Mage/Admin/data/admin_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Admin/data/admin_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/etc/config.xml b/app/code/core/Mage/Admin/etc/config.xml index cf108ed6cae..94990102f3d 100644 --- a/app/code/core/Mage/Admin/etc/config.xml +++ b/app/code/core/Mage/Admin/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/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 ed2bbfe49f6..139bdb89320 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 @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ 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/mysql4-upgrade-1.6.0.0-1.6.1.0.php index 9333601b894..e859d612159 100644 --- 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/mysql4-upgrade-1.6.0.0-1.6.1.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Helper/Data.php b/app/code/core/Mage/AdminNotification/Helper/Data.php index 739dfb2ca1b..03c809d4720 100644 --- a/app/code/core/Mage/AdminNotification/Helper/Data.php +++ b/app/code/core/Mage/AdminNotification/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Model/Feed.php b/app/code/core/Mage/AdminNotification/Model/Feed.php index c31860923d0..8abf3a6a85a 100644 --- a/app/code/core/Mage/AdminNotification/Model/Feed.php +++ b/app/code/core/Mage/AdminNotification/Model/Feed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Model/Inbox.php b/app/code/core/Mage/AdminNotification/Model/Inbox.php index 5bf8eac7486..ad0388bfa1b 100644 --- a/app/code/core/Mage/AdminNotification/Model/Inbox.php +++ b/app/code/core/Mage/AdminNotification/Model/Inbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Model/Observer.php b/app/code/core/Mage/AdminNotification/Model/Observer.php index a8889e2efee..23eaea6dbcf 100644 --- a/app/code/core/Mage/AdminNotification/Model/Observer.php +++ b/app/code/core/Mage/AdminNotification/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php b/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php index bc063aaa821..4cda5110275 100755 --- a/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php +++ b/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Model/Resource/Inbox/Collection.php b/app/code/core/Mage/AdminNotification/Model/Resource/Inbox/Collection.php index 27e3efb5660..e6a25b0bfb4 100755 --- a/app/code/core/Mage/AdminNotification/Model/Resource/Inbox/Collection.php +++ b/app/code/core/Mage/AdminNotification/Model/Resource/Inbox/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Model/Survey.php b/app/code/core/Mage/AdminNotification/Model/Survey.php index 727e2ae9577..60c9c050a77 100644 --- a/app/code/core/Mage/AdminNotification/Model/Survey.php +++ b/app/code/core/Mage/AdminNotification/Model/Survey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/etc/adminhtml.xml b/app/code/core/Mage/AdminNotification/etc/adminhtml.xml index fcbccd651f3..5b832ebd0e7 100644 --- a/app/code/core/Mage/AdminNotification/etc/adminhtml.xml +++ b/app/code/core/Mage/AdminNotification/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/AdminNotification/etc/config.xml b/app/code/core/Mage/AdminNotification/etc/config.xml index 48f895a52c2..ca235e0c651 100644 --- a/app/code/core/Mage/AdminNotification/etc/config.xml +++ b/app/code/core/Mage/AdminNotification/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/AdminNotification/etc/system.xml b/app/code/core/Mage/AdminNotification/etc/system.xml index 1b84bb524e1..25c3d665814 100644 --- a/app/code/core/Mage/AdminNotification/etc/system.xml +++ b/app/code/core/Mage/AdminNotification/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/AdminNotification/sql/adminnotification_setup/install-1.6.0.0.php b/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/install-1.6.0.0.php index 4cab117cbdd..ddf4acb5a0a 100644 --- a/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Abstract.php index 8f35c49e540..6c74c6351c2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/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/Api/Buttons.php b/app/code/core/Mage/Adminhtml/Block/Api/Buttons.php index 46e025c8f5a..4211fcf00ca 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Buttons.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/Editroles.php b/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php index d8efed82977..35fda6fe972 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/Grid/Role.php b/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php index eb8427e7bb3..a1c429c4c3d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/Role.php b/app/code/core/Mage/Adminhtml/Block/Api/Role.php index 5ca3f0389ad..233c1cb7403 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/Role/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php index 475dfcb11cd..2631695500a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/Roles.php b/app/code/core/Mage/Adminhtml/Block/Api/Roles.php index db7a76b33ed..808487f9f48 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/Tab/Roleinfo.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Roleinfo.php index 02f01cc3263..e44c43ebfb1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Roleinfo.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/Tab/Rolesedit.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php index aa6b9d0ec9b..2975b5b8970 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/Tab/Rolesusers.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php index 7171f0dcae7..b807d26da58 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/User.php b/app/code/core/Mage/Adminhtml/Block/Api/User.php index 4867b31b716..f7178573d2f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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 @@ class Mage_Adminhtml_Block_Api_User extends Mage_Adminhtml_Block_Widget_Grid_Con parent::__construct(); } + /** + * Prepare output HTML + * + * @return string + */ + protected function _toHtml() + { + Mage::dispatchEvent('api_user_html_before', array('block' => $this)); + return parent::_toHtml(); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php index b03c2e10f40..4a16f75a3a7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/User/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Form.php index 273d8308dba..0b379121b30 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/User/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Main.php index 1526533aefb..23d6191bb27 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/User/Edit/Tab/Roles.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php index e26862298e4..24540a34d6f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/User/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tabs.php index 5fb0a9b5f01..2b8da75ce38 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Api/User/Grid.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Grid.php index 16c5bea7c0c..97f58f6afe4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/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/Backup.php b/app/code/core/Mage/Adminhtml/Block/Backup.php index 6f4423b08ff..18b3a26f741 100644 --- a/app/code/core/Mage/Adminhtml/Block/Backup.php +++ b/app/code/core/Mage/Adminhtml/Block/Backup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,14 +31,14 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ - 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 @@ class Mage_Adminhtml_Block_Backup extends Mage_Adminhtml_Block_Template $this->setChild('createButton', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button') ->setData(array( - 'label' => Mage::helper('Mage_Backup_Helper_Data')->__('Create Backup'), - 'onclick' => "window.location.href='" . $this->getUrl('*/*/create') . "'", + 'label' => Mage::helper('Mage_Backup_Helper_Data')->__('Database Backup'), + 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_DB . "')", 'class' => 'task' )) ); + $this->setChild('createSnapshotButton', + $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button') + ->setData(array( + 'label' => Mage::helper('Mage_Backup_Helper_Data')->__('System Backup'), + 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT . "')", + 'class' => '' + )) + ); + $this->setChild('createMediaBackupButton', + $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button') + ->setData(array( + 'label' => Mage::helper('Mage_Backup_Helper_Data')->__('Database and Media Backup'), + 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_MEDIA . "')", + 'class' => '' + )) + ); $this->setChild('backupsGrid', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Backup_Grid') ); + + $this->setChild('dialogs', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Backup_Dialogs')); } public function getCreateButtonHtml() @@ -61,8 +79,38 @@ class Mage_Adminhtml_Block_Backup extends Mage_Adminhtml_Block_Template 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 00000000000..bb8dd2029bf --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php @@ -0,0 +1,53 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Adminhtml rollback dialogs block + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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 9c1970073bf..dad58e2aa47 100644 --- a/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Backup/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) */ @@ -51,8 +51,29 @@ class Mage_Adminhtml_Block_Backup_Grid extends Mage_Adminhtml_Block_Widget_Grid 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('Mage_Adminhtml_Helper_Data')->__('Delete'), + 'url' => $this->getUrl('*/*/massDelete'), + 'confirm' => Mage::helper('Mage_Backup_Helper_Data')->__('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() { @@ -62,45 +83,58 @@ class Mage_Adminhtml_Block_Backup_Grid extends Mage_Adminhtml_Block_Widget_Grid 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Time'), 'index' => 'date_object', 'type' => 'datetime', + 'width' => 200 + )); + + $this->addColumn('display_name', array( + 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Name'), + 'index' => 'display_name', + 'filter' => false, + 'sortable' => true, + 'width' => 350 )); $this->addColumn('size', array( 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Size, Bytes'), 'index' => 'size', 'type' => 'number', - 'sortable' => false, + 'sortable' => true, 'filter' => false )); $this->addColumn('type', array( 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Type'), 'type' => 'options', - 'options' => array('db' => Mage::helper('Mage_Backup_Helper_Data')->__('DB')), - 'index' =>'type' + 'options' => Mage::helper('Mage_Backup_Helper_Data')->getBackupTypes(), + 'index' => 'type', + 'width' => 300 )); $this->addColumn('download', array( 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Download'), - 'format' => '<a href="' . $this->getUrl('*/*/download', array('time' => '$time', 'type' => '$type')) .'">gz</a> <small>('.$url7zip.')</small>', + 'format' => '<a href="' . $this->getUrl('*/*/download', array('time' => '$time', 'type' => '$type')) + . '">$extension</a> <small>('.$url7zip.')</small>', 'index' => 'type', 'sortable' => false, 'filter' => false )); - $this->addColumn('action', array( - 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Action'), - 'type' => 'action', - 'width' => '80px', - 'filter' => false, - 'sortable' => false, - 'actions' => array(array( - 'url' => $this->getUrl('*/*/delete', array('time' => '$time', 'type' => '$type')), - 'caption' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete'), - 'confirm' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Are you sure you want to do this?') - )), - 'index' => 'type', - 'sortable' => false - )); + if (Mage::helper('Mage_Backup_Helper_Data')->isRollbackAllowed()){ + $this->addColumn('action', array( + 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Action'), + 'type' => 'action', + 'width' => '80px', + 'filter' => false, + 'sortable' => false, + 'actions' => array(array( + 'url' => '#', + 'caption' => Mage::helper('Mage_Backup_Helper_Data')->__('Rollback'), + 'onclick' => 'return backup.rollback(\'$type\', \'$time\');' + )), + 'index' => 'type', + 'sortable' => false + )); + } return $this; } diff --git a/app/code/core/Mage/Adminhtml/Block/Cache.php b/app/code/core/Mage/Adminhtml/Block/Cache.php index 7e91468d7c3..cd98aacd9c5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cache.php +++ b/app/code/core/Mage/Adminhtml/Block/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/Block/Cache/Additional.php b/app/code/core/Mage/Adminhtml/Block/Cache/Additional.php index e22931a1d98..45838b407d0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cache/Additional.php +++ b/app/code/core/Mage/Adminhtml/Block/Cache/Additional.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php b/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php index a4c14debd79..bf74757f6de 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Cache/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/Cache/Notifications.php b/app/code/core/Mage/Adminhtml/Block/Cache/Notifications.php index 3cb64e2862c..6fc5c8f9d2e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cache/Notifications.php +++ b/app/code/core/Mage/Adminhtml/Block/Cache/Notifications.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php index a804a383b62..d1f31abad59 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/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/Catalog/Category/Checkboxes/Tree.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Checkboxes/Tree.php index 2277c4f8216..0db2e8028dd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Checkboxes/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Checkboxes/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/Catalog/Category/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php index 1eb19e60428..9b42349804a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/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/Catalog/Category/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit/Form.php index 2c04e2c0350..99fbb442e51 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/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/Catalog/Category/Helper/Image.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Image.php index 19ddf2b64c6..c29d1eb4ce7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Image.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/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/Catalog/Category/Helper/Pricestep.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php index 83597772155..addd5efdf4d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php index ba9543926d3..77723bca792 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php index 012e84e3c6f..8b32d7a5f39 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/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/Catalog/Category/Tab/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php index 3f7f5f3ff22..f95592d9cfa 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,8 @@ class Mage_Adminhtml_Block_Catalog_Category_Tab_Attributes extends Mage_Adminhtm $form->addValues($this->getCategory()->getData()); + Mage::dispatchEvent('adminhtml_catalog_category_edit_prepare_form', array('form'=>$form)); + $form->setFieldNameSuffix('general'); $this->setForm($form); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Design.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Design.php index f60c209cdaf..223c90e8a69 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Design.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/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) */ class Mage_Adminhtml_Block_Catalog_Category_Tab_Design extends Mage_Adminhtml_Block_Catalog_Form diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php index 3f0ab2aab88..866972f700c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/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) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php index a826bb636f5..0645b1182b2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/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/Catalog/Category/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php index f0ebc3ceb40..690df6c4f3a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/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/Catalog/Category/Tree.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php index 218836465ef..09c1c33fb29 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/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/Catalog/Category/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Widget/Chooser.php index 63fb88bf906..8795d35ed9b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/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/Catalog/Form.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form.php index 4beeda55020..3258b54b0e1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/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/Catalog/Form/Renderer/Attribute/Urlkey.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Attribute/Urlkey.php index a2c60ba7267..d6620f5a61d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Attribute/Urlkey.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Attribute/Urlkey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/DateFieldsOrder.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/DateFieldsOrder.php index b6e94bcf592..1c3f91607f8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/DateFieldsOrder.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/DateFieldsOrder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 <core@magentocommerce.com> */ -class Mage_Adminhtml_Block_Catalog_Form_Renderer_Config_DateFieldsOrder extends Mage_Adminhtml_Block_System_Config_Form_Field +class Mage_Adminhtml_Block_Catalog_Form_Renderer_Config_DateFieldsOrder + extends Mage_Adminhtml_Block_System_Config_Form_Field { protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) @@ -43,7 +44,7 @@ class Mage_Adminhtml_Block_Catalog_Form_Renderer_Config_DateFieldsOrder extends ); $element->setValues($_options) - ->setStyle('width:70px;') + ->setClass('select-date') ->setName($element->getName() . '[]'); if ($element->getValue()) { $values = explode(',', $element->getValue()); @@ -56,6 +57,6 @@ class Mage_Adminhtml_Block_Catalog_Form_Renderer_Config_DateFieldsOrder extends $_parts[] = $element->setValue(isset($values[1]) ? $values[1] : null)->getElementHtml(); $_parts[] = $element->setValue(isset($values[2]) ? $values[2] : null)->getElementHtml(); - return implode(' / ', $_parts); + return implode(' <span>/</span> ', $_parts); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/YearRange.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/YearRange.php index 01825609f05..1cb3b55ec42 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/YearRange.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/YearRange.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ 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 c1c037356ab..64d9bf059cd 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 @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg.php index d7875486827..98758aa32b9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg/Content.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg/Content.php index 09b672c08ad..3771e6d50fa 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg/Content.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php index dfa9b2a8164..0c4d72eb06a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/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/Catalog/Product/Attribute.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute.php index d74d8b1684b..f8394342e05 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/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/Block/Catalog/Product/Attribute/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php index 536d128f609..10dbbc8aca7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/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/Catalog/Product/Attribute/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Form.php index 2cce45dc082..33d804ea8e3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/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/Catalog/Product/Attribute/Edit/Tab/Front.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Front.php index 705bf5a8304..37716de504e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Front.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Front.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php index e2669552a2c..2ef8b05f4e1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/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/Catalog/Product/Attribute/Edit/Tab/Options.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Options.php index cd27d2dac69..3af4de12265 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/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/Catalog/Product/Attribute/Edit/Tab/System.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/System.php index cbcc14110ff..eddd31325e3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/System.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/System.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php index 27608d7c7c6..5be21368edc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/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/Catalog/Product/Attribute/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Grid.php index dd4813e5d9a..f2545cfbf04 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/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/Catalog/Product/Attribute/New/Product/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Attributes.php index 65343384a0e..a8ee27db74a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Attributes.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php index d60eb01f097..f2d709176c3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Grid.php index a3ecc79ecfd..906047aed0f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/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/Catalog/Product/Attribute/Set/Main.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php index eeaa644fb29..32446600eb7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/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/Catalog/Product/Attribute/Set/Main/Formattribute.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formattribute.php index 41b54c51eca..9f4d4063112 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formattribute.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formattribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php index 22e9480aef7..99bc887bd00 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ 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 e2fc74ccb49..9bc9872ebfe 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 @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Attribute.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Attribute.php index 5f3a8e7b4a4..f8076dbd393 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Attribute.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/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/Block/Catalog/Product/Attribute/Set/Main/Tree/Group.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Group.php index a1709c68a23..64054a1d636 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/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/Catalog/Product/Attribute/Set/Toolbar/Add.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php index d01770f7668..f88d94ad344 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/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/Catalog/Product/Attribute/Set/Toolbar/Main.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main.php index d2d6e64a93e..35249d1728d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/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/Catalog/Product/Attribute/Set/Toolbar/Main/Filter.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main/Filter.php index 18be72a97d6..f7ccf2cc16c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main/Filter.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main/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/Catalog/Product/Composite/Configure.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php index 04a3a2f8841..9c0d3e22610 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Error.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Error.php index 8ce3965558a..16e3e24342e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Error.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Error.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset.php index ad622feda89..09707c6d161 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/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/Catalog/Product/Composite/Fieldset/Configurable.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Configurable.php index 38b89043664..55a1ef946e7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Configurable.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/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/Catalog/Product/Composite/Fieldset/Grouped.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Grouped.php index d2134ed7f33..518e2e55a32 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Grouped.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/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/Catalog/Product/Composite/Fieldset/Options.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php index 018e84473db..4c0ed1e572c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/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/Catalog/Product/Composite/Fieldset/Qty.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Qty.php index fd9bc26c04d..9f713afe29a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Qty.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/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/Catalog/Product/Composite/Update/Result.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Update/Result.php index f1ddbd71e01..587a64a09d5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Update/Result.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Update/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php index 6bbd6f99254..07e298ef379 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php index 8a68f84cda9..3de983aff69 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/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/Catalog/Product/Edit/Action/Attribute.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute.php index 5c50466e3cd..86c49731811 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute.php +++ b/app/code/core/Mage/Adminhtml/Block/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/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 308e3749531..5249a57b00e 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 @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 +44,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Action_Attribute_Tab_Attributes protected function _prepareForm() { - $this->setFormExcludedFieldList(array('tier_price','gallery', 'media_gallery', 'recurring_profile')); + $this->setFormExcludedFieldList(array( + 'tier_price','gallery', 'media_gallery', 'recurring_profile', 'group_price' + )); Mage::dispatchEvent('adminhtml_catalog_product_form_prepare_excluded_field_list', array('object'=>$this)); $form = new Varien_Data_Form(); @@ -79,9 +81,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Action_Attribute_Tab_Attributes { return array( 'price' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price'), + 'weight' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight'), 'image' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image'), - 'boolean' => Mage::getConfig() - ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean') + 'boolean' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean') ); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Inventory.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Inventory.php index a4629d51677..cce1db62b87 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Inventory.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Inventory.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Websites.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Websites.php index 90b73bc9e38..37df2746433 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Websites.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Websites.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tabs.php index f4a9020de85..73084ceeffe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/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/Catalog/Product/Edit/Js.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Js.php index ee9a816bca6..902c4aa8ae8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Js.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/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/Catalog/Product/Edit/Tab/Ajax/Serializer.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Ajax/Serializer.php index a053a3455bb..f76b8583faa 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Ajax/Serializer.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Ajax/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/Catalog/Product/Edit/Tab/Alerts.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts.php index 52e84df03cf..7cd8cadd3b6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php index 907dbcf6735..816c19d7c05 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/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/Catalog/Product/Edit/Tab/Alerts/Stock.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php index 368b490ea3e..3f7dc31b189 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ 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 4ce3b463182..6f843771fea 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 @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,69 +29,79 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_Catalog_Product_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('Mage_Catalog_Helper_Data')->isModuleEnabled('Mage_Cms')) { - if (Mage::getSingleton('Mage_Cms_Model_Wysiwyg_Config')->isEnabled()) { - $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); - } + if (Mage::helper('Mage_Catalog_Helper_Data')->isModuleEnabled('Mage_Cms') + && Mage::getSingleton('Mage_Cms_Model_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('Mage_Catalog_Helper_Data')->__($group->getAttributeGroupName()), - 'class'=>'fieldset-wide', + $fieldset = $form->addFieldset('group_fields' . $group->getId(), array( + 'legend' => Mage::helper('Mage_Catalog_Helper_Data')->__($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('Mage_Adminhtml_Block_Catalog_Form_Renderer_Attribute_Urlkey') ); } - if ($tierPrice = $form->getElement('tier_price')) { + $tierPrice = $form->getElement('tier_price'); + if ($tierPrice) { $tierPrice->setRenderer( $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier') ); } - if ($recurringProfile = $form->getElement('recurring_profile')) { + $groupPrice = $form->getElement('group_price'); + if ($groupPrice) { + $groupPrice->setRenderer( + $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group') + ); + } + + $recurringProfile = $form->getElement('recurring_profile'); + if ($recurringProfile) { $recurringProfile->setRenderer( $this->getLayout()->createBlock('Mage_Adminhtml_Block_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('Mage_Admin_Model_Session')->isAllowed('catalog/attributes/attributes')) { - $headerBar = $this->getLayout()->createBlock( - 'Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes_Create' - ); + && Mage::getSingleton('Mage_Admin_Model_Session')->isAllowed('catalog/attributes/attributes') + ) { + $headerBar = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes_Create'); $headerBar->getConfig() ->setTabId('group_' . $group->getId()) @@ -101,9 +111,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Admi ->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 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Admi } $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 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Admi 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,32 +140,33 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Admi $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('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price'), - 'gallery' => Mage::getConfig() - ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery'), - 'image' => Mage::getConfig() - ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image'), - 'boolean' => Mage::getConfig() - ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean'), - 'textarea' => Mage::getConfig() - ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Helper_Form_Wysiwyg') + 'price' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price'), + 'weight' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight'), + 'gallery' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery'), + 'image' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image'), + 'boolean' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean'), + 'textarea' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Helper_Form_Wysiwyg') ); $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/Attributes/Create.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes/Create.php index be4631cef21..7af6caf9c03 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes/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/Catalog/Product/Edit/Tab/Categories.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php index 407652c13a9..a3584bac8d2 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 @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php index 1ba22bc77f6..aa7cdacd65e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php index ff16577268c..76bc7d6ca2e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php index 4533d5aa59e..09835149070 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/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/Catalog/Product/Edit/Tab/Options/Option.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php index 6e34b95280f..4317e806088 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Abstract.php index ae56830fc11..adc6187f6c1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/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/Catalog/Product/Edit/Tab/Options/Type/Date.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Date.php index 2f15647420d..1c589e59ea7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/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/Catalog/Product/Edit/Tab/Options/Type/File.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/File.php index d9cc45812b4..0ed86370b05 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/File.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/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/Catalog/Product/Edit/Tab/Options/Type/Select.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Select.php index 6833acc351a..0b54dcafd14 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Select.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/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/Catalog/Product/Edit/Tab/Options/Type/Text.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Text.php index 6f90cddf78d..6692161ea78 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Text.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/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/Catalog/Product/Edit/Tab/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price.php index 64cc63ca24c..93efce32f22 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/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/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 00000000000..289b2fc9de5 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php @@ -0,0 +1,97 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Adminhtml group price item renderer + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Adminhtml_Block_Widget_Button') + ->setData(array( + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('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 00000000000..520c7140fda --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php @@ -0,0 +1,348 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Adminhtml group price item abstract renderer + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Catalog_Helper_Data')->isModuleEnabled('Mage_Customer')) { + return array(); + } + $collection = Mage::getModel('Mage_Customer_Model_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('Mage_Catalog_Helper_Data')->__('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/Recurring.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Recurring.php index 4f05528eafa..9c4a89597f7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Recurring.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Recurring.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ 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 e442a00b866..a663bb93d4e 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 @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,33 +32,11 @@ * @author Magento Core Team <core@magentocommerce.com> */ 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 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier } /** - * 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('Mage_Catalog_Helper_Data')->__('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 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier 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('Mage_Catalog_Helper_Data')->isModuleEnabled('Mage_Customer')) { - return array(); - } - $collection = Mage::getModel('Mage_Customer_Model_Group')->getCollection(); - $this->_customerGroups = array( - Mage_Customer_Model_Group::CUST_GROUP_ALL => Mage::helper('Mage_Catalog_Helper_Data')->__('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('Mage_Catalog_Helper_Data')->__('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 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier { $button = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button') ->setData(array( - 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Tier'), - 'onclick' => 'return tierPriceControl.addItem()', - 'class' => 'add' + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Tier'), + 'onclick' => 'return tierPriceControl.addItem()', + 'class' => 'add' )); $button->setName('add_tier_price_item_button'); @@ -290,93 +107,4 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier 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/Related.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php index f8762fa05c6..d08609e1903 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Reviews.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Reviews.php index 5028c63a45b..bbab4ff9c12 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Reviews.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/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/Catalog/Product/Edit/Tab/Settings.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Settings.php index c55c28a3c32..3708c2cc69b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Settings.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Settings.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ 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 7b90c9308eb..12d2d5d8f6c 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 @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,28 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config extends Mage_Ad */ 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('Mage_Catalog_Helper_Data')->isPriceGlobal() && $this->isReadonly()); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php index c67361f2b38..50e98d66eee 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/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/Catalog/Product/Edit/Tab/Super/Config/Grid/Filter/Inventory.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Filter/Inventory.php index 872b1b4f03d..152a028ada5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Filter/Inventory.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Filter/Inventory.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php index 142b3e5892f..68d0e037325 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/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/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Inventory.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Inventory.php index 94657b2ba9f..41ef013c12b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Inventory.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Inventory.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ 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 94ee9b249ae..a64d57ac00b 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 @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 <core@magentocommerce.com> */ -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 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple extends 'additional' => array('name', 'sku', 'visibility', 'status') ); - $availableTypes = array('text', 'select', 'multiselect', 'textarea', 'price'); + $availableTypes = array('text', 'select', 'multiselect', 'textarea', 'price', 'weight'); $attributes = Mage::getModel('Mage_Catalog_Model_Product') ->setTypeId(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) @@ -70,10 +71,12 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple extends // 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()->getUsedProductAttributeIds($this->_getProduct()))) + && !in_array($attribute->getId(), + $this->_getProduct()->getTypeInstance()->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,8 +115,8 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple extends } /* Configurable attributes */ - $product = $this->_getProduct(); - foreach ($product->getTypeInstance()->getUsedProductAttributes($product) as $attribute) { + $usedAttributes = $this->_getProduct()->getTypeInstance()->getUsedProductAttributes($this->_getProduct()); + foreach ($usedAttributes as $attribute) { $attributeCode = $attribute->getAttributeCode(); $fieldset->addField( 'simple_product_' . $attributeCode, 'select', array( 'label' => $attribute->getFrontend()->getLabel(), @@ -177,8 +180,6 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple extends ) )); - - $this->setForm($form); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php index 0d70649d9a3..4633b752270 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/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/Catalog/Product/Edit/Tab/Super/Settings.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php index 40bb1d39907..09f400bd374 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag.php index c334f4f9a46..49a246f592d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/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/Catalog/Product/Edit/Tab/Tag/Customer.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag/Customer.php index fcb99623cf8..c4b190ffce5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/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/Catalog/Product/Edit/Tab/Upsell.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php index 17574602866..561657d2f99 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php index 7fde6fc37f2..a767c223c5a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php index 0c397e3299a..50212c27663 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/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/Catalog/Product/Edit/Tabs/Configurable.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/Configurable.php index bf4042a49b3..e8c6e29e6eb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/Configurable.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/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/Catalog/Product/Edit/Tabs/Grouped.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/Grouped.php index 7928edc7ffc..e2c4c92ec0d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/Grouped.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/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/Catalog/Product/Frontend/Product/Watermark.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Frontend/Product/Watermark.php index 977647226aa..03219a6c5cc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Frontend/Product/Watermark.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Frontend/Product/Watermark.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ 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 655beefc602..a29eb868e89 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/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/Catalog/Product/Helper/Form/Apply.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Apply.php index b112559572d..70afc08ccaa 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Apply.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Apply.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Boolean.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Boolean.php index 4018eeaac59..c5e7c79dacc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Boolean.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/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/Catalog/Product/Helper/Form/Config.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Config.php index 340a8482d73..22030ded817 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Config.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/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/Block/Catalog/Product/Helper/Form/Gallery.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php index 472b0ea5b80..6d045fe0391 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 @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php index 1b392e63d7e..ce96be325c0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,8 @@ class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery_Content extends M ) )); + Mage::dispatchEvent('catalog_product_gallery_prepare_layout', array('block' => $this)); + return parent::_prepareLayout(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Image.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Image.php index 2397aadeab0..9116ea3b197 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Image.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/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/Catalog/Product/Helper/Form/Msrp/Enabled.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Enabled.php index 02358d5e42a..4e7538b607e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Enabled.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/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/Block/Catalog/Product/Helper/Form/Msrp/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Price.php index af67119cdfd..708476ca2da 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/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/Catalog/Product/Helper/Form/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php index 395c1162969..1f6a85c9836 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/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/Catalog/Product/Helper/Form/Weight.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php new file mode 100644 index 00000000000..fe682362a62 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php @@ -0,0 +1,46 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Product form weight field helper + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight extends Varien_Data_Form_Element_Text +{ + /** + * Validation classes for weight field which corresponds to DECIMAL(12,4) SQL type + * + * @param array $attributes + */ + public function __construct(array $attributes = array()) + { + parent::__construct($attributes); + $this->addClass('validate-number validate-zero-or-greater validate-number-range number-range-0-99999999.9999'); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Price.php index 6c5f8a7ee4e..198960c3b14 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/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/Catalog/Product/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php index 212f42ea188..ac05ed6a54f 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 @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 @@ class Mage_Adminhtml_Block_Catalog_Product_Widget_Chooser extends Mage_Adminhtml 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/Product/Widget/Chooser/Container.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser/Container.php index 66aac1d76d2..d5b5f47ea2e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser/Container.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser/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/Catalog/Search.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search.php index 8f7e48fa9ec..b4fc9e5971f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/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/Catalog/Search/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit.php index e1554378fcb..8f74dc337ee 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/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/Catalog/Search/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php index c6bf3ee9bed..f40c59fda37 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 @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,6 +93,7 @@ class Mage_Adminhtml_Block_Catalog_Search_Edit_Form extends Mage_Adminhtml_Block 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Store'), 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(true, false), 'required' => true, + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); } else { @@ -104,48 +105,41 @@ class Mage_Adminhtml_Block_Catalog_Search_Edit_Form extends Mage_Adminhtml_Block if ($model->getId()) { $fieldset->addField('num_results', 'text', array( - 'name' => 'num_results', - 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of results<br/>(For the last time placed)'), - 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of results<br/>(For the last time placed)'), - 'required' => true, + 'name' => 'num_results', + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of results'), + 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of results (For the last time placed)'), + 'note' => Mage::helper('Mage_Catalog_Helper_Data')->__('For the last time placed.'), + 'required' => true, )); $fieldset->addField('popularity', 'text', array( - 'name' => 'popularity', - 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of Uses'), - 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of Uses'), - 'required' => true, + 'name' => 'popularity', + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of Uses'), + 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of Uses'), + 'required' => true, )); } - $afterElementHtml = '<p class="nm"><small>' - . Mage::helper('Mage_Catalog_Helper_Data')->__('(Will make search for the query above return results for this search.)') - . '</small></p>'; - $fieldset->addField('synonym_for', 'text', array( - 'name' => 'synonym_for', - 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Synonym For'), - 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Synonym For'), - 'after_element_html' => $afterElementHtml, + 'name' => 'synonym_for', + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Synonym For'), + 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Synonym For'), + 'note' => Mage::helper('Mage_Catalog_Helper_Data')->__('Will make search for the query above return results for this search.'), )); - $afterElementHtml = '<p class="nm"><small>' - . Mage::helper('Mage_Catalog_Helper_Data')->__('ex. http://domain.com') - . '</small></p>'; - $fieldset->addField('redirect', 'text', array( - 'name' => 'redirect', - 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Redirect URL'), - 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Redirect URL'), - 'class' => 'validate-url', - 'after_element_html' => $afterElementHtml, + 'name' => 'redirect', + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Redirect URL'), + 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Redirect URL'), + 'class' => 'validate-url', + 'note' => Mage::helper('Mage_Catalog_Helper_Data')->__('ex. http://domain.com'), )); $fieldset->addField('display_in_terms', 'select', array( - 'name' => 'display_in_terms', - 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Display in Suggested Terms'), - 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Display in Suggested Terms'), - 'values' => $yesno, + 'name' => 'display_in_terms', + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Display in Suggested Terms'), + 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Display in Suggested Terms'), + 'values' => $yesno, )); $form->setValues($model->getData()); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php index 9314dd373d4..50fcd748bdb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/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/Checkout/Agreement.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php index fd67f8e45c8..285182d782a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 @@ class Mage_Adminhtml_Block_Checkout_Agreement extends Mage_Adminhtml_Block_Widge public function __construct() { $this->_controller = 'checkout_agreement'; - $this->_headerText = Mage::helper('Mage_Checkout_Helper_Data')->__('Manage Checkout Terms and Conditions'); + $this->_headerText = Mage::helper('Mage_Checkout_Helper_Data')->__('Manage Terms and Conditions'); $this->_addButtonLabel = Mage::helper('Mage_Checkout_Helper_Data')->__('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 f2027f3bfd1..c3d82f468fb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/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) */ @@ -60,7 +60,7 @@ class Mage_Adminhtml_Block_Checkout_Agreement_Edit extends Mage_Adminhtml_Block_ return Mage::helper('Mage_Checkout_Helper_Data')->__('Edit Terms and Conditions'); } else { - return Mage::helper('Mage_Checkout_Helper_Data')->__('New Condition'); + return Mage::helper('Mage_Checkout_Helper_Data')->__('New Terms and Conditions'); } } } diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit/Form.php index 2aa29468c44..2c31643f723 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/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) */ @@ -105,6 +105,7 @@ class Mage_Adminhtml_Block_Checkout_Agreement_Edit_Form extends Mage_Adminhtml_B 'title' => Mage::helper('Mage_Checkout_Helper_Data')->__('Store View'), 'required' => true, 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(false, true), + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Grid.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Grid.php index e281739c5d9..60b18d51298 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/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_Checkout_Agreement_Grid extends Mage_Adminhtml_Block_Widget_Grid diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Block.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block.php index 49accfc4677..98817622fba 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/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/Cms/Block/Edit.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php index 47c90aff5a3..74105ce18fd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block/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/Cms/Block/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php index c1b19e9724b..692aa99419f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block/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) */ @@ -60,7 +60,9 @@ class Mage_Adminhtml_Block_Cms_Block_Edit_Form extends Mage_Adminhtml_Block_Widg { $model = Mage::registry('cms_block'); - $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post')); + $form = new Varien_Data_Form( + array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post') + ); $form->setHtmlIdPrefix('block_'); @@ -97,6 +99,7 @@ class Mage_Adminhtml_Block_Cms_Block_Edit_Form extends Mage_Adminhtml_Block_Widg 'title' => Mage::helper('Mage_Cms_Helper_Data')->__('Store View'), 'required' => true, 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(false, true), + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Grid.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Grid.php index 6e20ce047d7..f536fc69589 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block/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/Cms/Block/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Widget/Chooser.php index 549458253b8..64d196d5a55 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block/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/Cms/Page.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page.php index c7d8f665b1a..e0aba177d7a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page.php +++ b/app/code/core/Mage/Adminhtml/Block/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) */ 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 1ed1213f18b..e8a68e02e33 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/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/Cms/Page/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Form.php index e8a169b96d9..da640674352 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/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/Cms/Page/Edit/Tab/Content.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Content.php index b1bacfe1d7e..6cc4f6b7463 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Content.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php index 659ebc18474..ef65d01fb63 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/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) */ class Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Design diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Main.php index ed971e140ab..9ad0f070552 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/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) */ @@ -91,7 +91,8 @@ class Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Main 'title' => Mage::helper('Mage_Cms_Helper_Data')->__('Store View'), 'required' => true, 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(false, true), - 'disabled' => $isElementDisabled + 'disabled' => $isElementDisabled, + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php index ec7f5b97974..c03cb54f4ba 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tabs.php index 11e9214a327..b75241e2dbb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/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/Cms/Page/Grid.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid.php index 80a3ad68370..b3694b8d1fd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/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/Cms/Page/Grid/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid/Renderer/Action.php index e609ad1cd0a..fefdff0aadf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/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/Cms/Page/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Widget/Chooser.php index 1d50d2fc86e..cfc1c1cf5a3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/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/Cms/Wysiwyg/Images/Content.php b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content.php index 2079f2dd91d..12049ea8163 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Files.php b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Files.php index 7479c76f52e..5fea94f344c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Files.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Files.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Newfolder.php b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Newfolder.php index 1d1f906a80d..6b8c2418dd6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Newfolder.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Newfolder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Uploader.php b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Uploader.php index cca705291ba..e166fc285bd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Uploader.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/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/Cms/Wysiwyg/Images/Tree.php b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Tree.php index 677dba04f83..c952baebbf5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/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/Customer.php b/app/code/core/Mage/Adminhtml/Block/Customer.php index 3b60b571a7d..055c081bc41 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/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/Customer/Edit.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit.php index e1852770429..64e61a605eb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/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/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Form.php index 8501358f2ad..9041686ab5a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/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/Edit/Renderer/Attribute/Group.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php new file mode 100644 index 00000000000..335b153fd91 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php @@ -0,0 +1,105 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Renderer for customer group ID + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Customer_Helper_Data')->__($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('Mage_Customer_Helper_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/Renderer/Newpass.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Newpass.php index dacc11ac686..3469e23b686 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Newpass.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Newpass.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @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/Renderer/Region.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Region.php index dccb8100a2e..f20ca90f20f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Region.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/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/Block/Customer/Edit/Tab/Account.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php index f39b7938deb..b247209c968 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) */ @@ -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,62 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc $customer = Mage::registry('current_customer'); - /* @var $customerForm Mage_Customer_Model_Form */ + /** @var $customerForm Mage_Customer_Model_Form */ $customerForm = Mage::getModel('Mage_Customer_Model_Form'); $customerForm->setEntity($customer) ->setFormCode('adminhtml_customer') ->initDefaultValues(); - $fieldset = $form->addFieldset('base_fieldset', - array('legend'=>Mage::helper('Mage_Customer_Helper_Data')->__('Account Information')) - ); + $fieldset = $form->addFieldset('base_fieldset', array( + 'legend' => Mage::helper('Mage_Customer_Helper_Data')->__('Account Information') + )); $attributes = $customerForm->getAttributes(); foreach ($attributes as $attribute) { + /* @var $attribute Mage_Eav_Model_Entity_Attribute */ + $attribute->setFrontendLabel(Mage::helper('Mage_Customer_Helper_Data')->__($attribute->getFrontend()->getLabel())); $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('Mage_Adminhtml_Block_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( + '<script type="text/javascript">' + . " + var {$prefix}_websites = " . Mage::helper('Mage_Core_Helper_Data')->jsonEncode($websites) ."; + Validation.add( + 'validate-website-has-store', + '" . Mage::helper('Mage_Customer_Helper_Data')->__('Please select a website which contains store view') . "', + function(v, elem){ + return {$prefix}_websites[elem.value] == true; + } + ); + Element.observe('{$prefix}website_id', 'change', function(){ + Validation.validate($('{$prefix}website_id')) + }.bind($('{$prefix}website_id'))); + " + . '</script>' + ); + } $customerStoreId = null; if ($customer->getId()) { @@ -119,10 +153,10 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc if ($customer->getId()) { if (!$customer->isReadonly()) { - // add password management fieldset + // Add password management fieldset $newFieldset = $form->addFieldset( 'password_fieldset', - array('legend'=>Mage::helper('Mage_Customer_Helper_Data')->__('Password Management')) + array('legend' => Mage::helper('Mage_Customer_Helper_Data')->__('Password Management')) ); // New customer password $field = $newFieldset->addField('new_password', 'text', @@ -136,7 +170,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc $this->getLayout()->createBlock('Mage_Adminhtml_Block_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'); @@ -149,8 +183,8 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc ))->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', @@ -175,7 +209,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc ); $field->setRenderer($this->getLayout()->createBlock('Mage_Adminhtml_Block_Customer_Edit_Renderer_Newpass')); - // prepare send welcome email checkbox + // Prepare send welcome email checkbox $fieldset->addField('sendemail', 'checkbox', array( 'label' => Mage::helper('Mage_Customer_Helper_Data')->__('Send Welcome Email'), 'name' => 'sendemail', @@ -191,7 +225,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc } } - // 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/Addresses.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php index 5e9c7b6ee31..fe00e65c877 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,6 +128,8 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Addresses extends Mage_Adminhtml_Bl ->processStreetAttribute($attributes['street']); } foreach ($attributes as $attribute) { + /* @var $attribute Mage_Eav_Model_Entity_Attribute */ + $attribute->setFrontendLabel(Mage::helper('Mage_Customer_Helper_Data')->__($attribute->getFrontend()->getLabel())); $attribute->unsIsVisible(); } $this->_setFieldset($attributes, $fieldset); 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 5ea7e00bf93..1eb4a4fefbf 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) */ @@ -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/Carts.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Carts.php index 3ad7c84cebd..e71cc9a2c9f 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 9cb071e4417..a89fa69e287 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 f5f7a75558f..7cd5e2656dd 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 5533d2ab7b8..d8d3925f416 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 ee732c60a0b..c5339919cc7 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 96188255fb9..faa9f535f32 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 220f9ff656e..f59e6312901 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 c07a0e60fd2..c3f6db54273 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 2a6d75dced0..d4a540ea944 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 2f880f81621..34a5c15acc7 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 d1766cd7a45..7d38b8c7033 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 829aac5863a..1fa39a2597f 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) */ @@ -58,9 +58,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_View_Accordion extends Mage_Adminht // prepare title for cart $title = Mage::helper('Mage_Customer_Helper_Data')->__('Shopping Cart - %d item(s)', $cartItemsCount); if (count($customer->getSharedWebsiteIds()) > 1) { - $title = Mage::helper('Mage_Customer_Helper_Data')->__('Shopping Cart of %1$s - %2$d item(s)', - $website->getName(), $cartItemsCount - ); + $title = Mage::helper('Mage_Customer_Helper_Data')->__('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/Edit/Tab/View/Cart.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php index 30e8d1abdb3..8d3db643da2 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 7291c25e26f..739fcc0b490 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 80b6fa19515..54852514128 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 7bb95072bc2..24d3387ff4e 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 d5034784cc9..17c02c167a1 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) */ 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 5fbe1d7295c..bcbb23b3080 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) */ 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 677449514d7..3b9d22ee264 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 aecd88f1cb5..74d90c4fc3c 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 0d8de4a8b43..e296fec73ca 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 0217933433b..02b71d3804d 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 2492a542894..52de6839e34 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 587f4625388..7986d9c7703 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 f78530258c8..cf77d4cccfb 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 8663e9dae6c..9d0bb5d53ff 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 f94b7cb929c..a681e699e33 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 422f16dd093..0db3c67f369 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 aa8e2ba81d9..6a046ca73e3 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) */ @@ -51,8 +51,7 @@ class Mage_Adminhtml_Block_Customer_Group_Edit_Form extends Mage_Adminhtml_Block 'name' => 'code', 'label' => Mage::helper('Mage_Customer_Helper_Data')->__('Group Name'), 'title' => Mage::helper('Mage_Customer_Helper_Data')->__('Group Name'), - 'note' => Mage::helper('Mage_Customer_Helper_Data')->__('Maximum length must be less then %s symbols', - Mage_Customer_Model_Group::GROUP_CODE_MAX_LENGTH), + 'note' => Mage::helper('Mage_Customer_Helper_Data')->__('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/Group/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php index 8114257a017..f343754b86f 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 bdc1092695f..a780c57a807 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 cdbcac97d32..95e7e382f34 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 12bc28285d7..b25f28c0273 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 a86421137a8..de30d6d84e0 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 70200957b84..45b0cb70073 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 1cb7bab9efb..70853370d70 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/Renderer/Vat.php b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php new file mode 100644 index 00000000000..9847fc918dc --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php @@ -0,0 +1,93 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * VAT ID element renderer + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Customer_Sales_Order_Address_Form_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/address/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(); + + $countryElementId = $form->getElement('country_id')->getHtmlId(); + $validateUrl = Mage::getSingleton('Mage_Adminhtml_Model_Url') + ->getUrl('*/customer_system_config_validatevat/validateAdvanced'); + + $vatValidateOptions = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array( + 'vatElementId' => $vatElementId, + 'countryElementId' => $countryElementId, + 'groupIdHtmlId' => 'group_id', + 'validateUrl' => $validateUrl, + 'vatValidMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('The VAT ID is valid. The current Customer Group will be used.'), + 'vatValidAndGroupChangeMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('Based on the VAT ID, the customer would belong to the Customer Group %s.') . "\n" + . Mage::helper('Mage_Customer_Helper_Data')->__('The customer is currently assigned to Customer Group %s.') . ' ' + . Mage::helper('Mage_Customer_Helper_Data')->__('Would you like to change the Customer Group for this order?'), + 'vatInvalidMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('The VAT ID entered (%s) is not a valid VAT ID.'), + 'vatValidationFailedMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('There was an error validating the VAT ID. Please try again later.'), + )); + + $optionsVarName = $this->getJsVariablePrefix() . 'VatParameters'; + $beforeHtml = '<script type="text/javascript">var ' . $optionsVarName . ' = ' . $vatValidateOptions + . ';</script>'; + $this->_validateButton = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')->setData(array( + 'label' => Mage::helper('Mage_Customer_Helper_Data')->__('Validate VAT Number'), + 'before_html' => $beforeHtml, + '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 new file mode 100644 index 00000000000..215fec69331 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Customer/System/Config/Validatevat.php @@ -0,0 +1,79 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Adminhtml VAT ID validation block + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Customer_Helper_Data')->__($originalData['button_label']), + 'html_id' => $element->getHtmlId(), + 'ajax_url' => Mage::getSingleton('Mage_Adminhtml_Model_Url')->getUrl('*/customer_system_config_validatevat/validate') + )); + + return $this->_toHtml(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard.php b/app/code/core/Mage/Adminhtml/Block/Dashboard.php index 9c750ff6500..d3ca02a9933 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 93ccbd1bd4a..1f134e5e0c1 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 9117b436bd9..27440af4949 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 390e2704fe2..0de6169097d 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 fff9a3a967b..c5734233236 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 f101d7440da..17abc4ddcb7 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 5df46ebdb36..09f70ee1028 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 cb81cb0c63d..9df2dc29f33 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 687cb6975e3..76cc1dc2134 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 528d24b17b4..531ad5a8731 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 6b89b01c5ef..932bd74e6ad 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 6827c49a2fb..4f18eaa23fe 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 c55c472b553..ad5169c640c 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 0910b9d2873..61e93f6d1ae 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 f10f8013b3f..38ef358038f 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 1310b90ab59..89cd8626549 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 d5cf584e8e3..f5ff92b2682 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 b458d4f506b..0a1eef69dd8 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 e43b36db65e..3c24ab0e44b 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 eeeb652814d..e0b9db46609 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 7f07527f76d..f946792abc7 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 dab8a3ca2e2..6ab1974691d 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 ad90e5c413c..84765e87220 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 061a8c0f922..7835decad2a 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) */ @@ -195,11 +195,12 @@ class Mage_Adminhtml_Block_Media_Uploader extends Mage_Adminhtml_Block_Widget } /** - * 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) diff --git a/app/code/core/Mage/Adminhtml/Block/Messages.php b/app/code/core/Mage/Adminhtml/Block/Messages.php index 06dffe7f0a5..0ff5da661b8 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 395e171a20b..74f73e4a7f3 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 fa5832ae02d..faa1ababdb8 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 bb10bace3a6..82043530b98 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 8e4d0238e59..1a45eb91dc3 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 4afed56549b..80d8a5826d6 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 467f985c4a8..169f616cd90 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 5a049f3359d..448e8277e44 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 4403a3ae18d..811e5c9e227 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 ba15789b729..1641b417017 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 bd1cb9d683a..90e969bdd54 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 5939a0c203d..9fbc38a8e61 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 95e360c6e15..ffc107093e0 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 a96d08bd7d6..d3efd3aee10 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 b154ea84339..9a3a1b9a8cb 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 9a24ff92bb3..7fbc843ca04 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 66e841e03c0..1cfdc93dc10 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 33dcc6efc23..dd1967206bd 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 67d062a8ac6..5d345991224 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 63b5760ac12..e4cddbed458 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 bb5e60268f7..8f497d66d5b 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 fddc1967d1a..9ddcb00afa7 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 8f5bb82d786..ad90b211907 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 8feb49de795..fc89ae09a74 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 ef39ea765f9..5b7d506dffd 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 94aafac8ca9..a41455c40a2 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 3bdc2f24d61..eccb17d690e 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 eec12534645..e24d4fe76cb 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 6243ddf0305..5b0f34580dd 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 bce8cb6a78f..bb34441c938 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 e7a2d1c3d8a..44d65654385 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 9459a83045b..7e524804d6d 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 b53b53f01d3..5401ca36344 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 d95bf115e97..a906da0d6fa 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 bba13e15d48..5673b22ecec 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) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Page.php b/app/code/core/Mage/Adminhtml/Block/Page.php index 308aa0745cc..4b4e66d360e 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 53c95b17eb4..9a7282f0570 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 d146d043dae..b654a150f94 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 4e0a05826e3..4751e991680 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 cf7fcc6acb7..d4036a8c0a3 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 4b9c4a99566..0ae1c050999 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 acfca95d572..b670116a6a1 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 f8147b8ff90..d2f1eb7aaad 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/Grid/Role.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php index ab3cf3b5864..d27fd8067ac 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 82f4d069e53..5e86970cea8 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 b7ae80b7a3c..6c43b2fb35d 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 1458283d01a..52fee442a6f 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 949593c76c8..dfda51c8974 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 ca91a6017a3..7c00eea95e2 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 2c90761e477..288dbd23810 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 88f8bdbb5a5..db6289e7955 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 735a0280c83..43d93ab1282 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/User.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User.php index 12176e87325..1f4c302683b 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 @@ class Mage_Adminhtml_Block_Permissions_User extends Mage_Adminhtml_Block_Widget_ 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 0298f781d9e..5dd3aa5acdf 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 30a834336f1..9dee15e7551 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 29ccc8249c1..d87cdf44111 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 7ee6c07a7c4..0d9f8061267 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 f2c98e04788..1758bdc2af0 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 4b6d78a307c..f92b9b03d8f 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/Users.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Users.php index 5ed922866af..3d7fb972b97 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 81c302f3444..6743578dc20 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 4f9489bb1d3..2cd67b1d921 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 20c8a95dc94..eac54f7fbd8 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 51bc2dc972f..476bfc7f9cd 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 5935a962943..8d344d5b2a3 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 db96bcf4fbb..640b44008b9 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 68a118d4ae2..93a7eb8fa30 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 01685ff866b..120c51482a6 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 bfec8b8d441..4a753879f3c 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 @@ class Mage_Adminhtml_Block_Poll_Edit_Tab_Form extends Mage_Adminhtml_Block_Widge 'required' => true, 'name' => 'store_ids[]', 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(), - 'value' => Mage::registry('poll_data')->getStoreIds() + 'value' => Mage::registry('poll_data')->getStoreIds(), + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_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 29720ea02af..5686acbb973 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 fc35b18dcd3..62b12e5812f 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 644aaffc5e5..719c6600288 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 6438342ff1a..ddd75e0a051 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 cc7efdff6b9..aaeb523be9f 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 <core@magentocommerce.com> + * 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,33 +43,24 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit extends Mage_Adminhtml_Block_Widge parent::__construct(); - $this->_updateButton('save', 'label', Mage::helper('Mage_CatalogRule_Helper_Data')->__('Save Rule')); - $this->_updateButton('delete', 'label', Mage::helper('Mage_CatalogRule_Helper_Data')->__('Delete Rule')); - - $rule = Mage::registry('current_promo_catalog_rule'); - - if (!$rule || !$rule->isDeleteable()) { - $this->_removeButton('delete'); - } + $this->_addButton('save_apply', array( + 'class' => 'save', + 'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Save and Apply'), + 'onclick' => "$('rule_auto_apply').value=1; editForm.submit()", + )); - if (!$rule || !$rule->isReadonly()) { - $this->_addButton('save_apply', array( - 'class'=>'save', - 'label'=>Mage::helper('Mage_CatalogRule_Helper_Data')->__('Save and Apply'), - 'onclick'=>"$('rule_auto_apply').value=1; editForm.submit()", - )); - $this->_addButton('save_and_continue', array( - 'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('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('Mage_CatalogRule_Helper_Data')->__('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'); 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 559df8e80b0..a8d3203f3cf 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 34cee5950f2..5cfdd3dee02 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 c97bbb087c3..6335dc445a7 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 94dd87dbdf9..d7676cfbb0c 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 0c5ac36d6d9..d1df446b14a 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 <core@magentocommerce.com> + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form @@ -57,7 +56,7 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main } /** - * 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 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main $form->setHtmlIdPrefix('rule_'); - $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('Mage_CatalogRule_Helper_Data')->__('General Information'))); + $fieldset = $form->addFieldset('base_fieldset', + array('legend '=> Mage::helper('Mage_CatalogRule_Helper_Data')->__('General Information')) + ); $fieldset->addField('auto_apply', 'hidden', array( 'name' => 'auto_apply', @@ -121,34 +122,21 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main ), )); - 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('Mage_CatalogRule_Helper_Data')->__('Websites'), 'title' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Websites'), - 'required' => true, - 'values' => Mage::getSingleton('Mage_Adminhtml_Model_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('Mage_Adminhtml_Model_System_Store')->getWebsiteValuesForForm() )); - $model->setWebsiteIds(Mage::app()->getStore(true)->getWebsiteId()); - } - - $customerGroups = Mage::getResourceModel('Mage_Customer_Model_Resource_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('Mage_CatalogRule_Helper_Data')->__('NOT LOGGED IN'))); } $fieldset->addField('customer_group_ids', 'multiselect', array( @@ -156,7 +144,7 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main 'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Customer Groups'), 'title' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Customer Groups'), 'required' => true, - 'values' => $customerGroups, + 'values' => Mage::getResourceModel('Mage_Customer_Model_Resource_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 007f8e1018c..acaa5dc92b6 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 6050519c40e..50a4e6e974a 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 <core@magentocommerce.com> + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> */ 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 @@ class Mage_Adminhtml_Block_Promo_Catalog_Grid extends Mage_Adminhtml_Block_Widge $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_Resource_Rule_Collection */ $collection = Mage::getModel('Mage_CatalogRule_Model_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( @@ -96,9 +113,29 @@ class Mage_Adminhtml_Block_Promo_Catalog_Grid extends Mage_Adminhtml_Block_Widge ), )); - return parent::_prepareColumns(); + if (!Mage::app()->isSingleStoreMode()) { + $this->addColumn('rule_website', array( + 'header' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Website'), + 'align' =>'left', + 'index' => 'website_ids', + 'type' => 'options', + 'sortable' => false, + 'options' => Mage::getSingleton('Mage_Adminhtml_Model_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 c574c2e9e0a..d18fdd616e5 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 6e0582d23fa..39b76c15d21 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 <core@magentocommerce.com> + * 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,30 +43,18 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit extends Mage_Adminhtml_Block_Widget_ parent::__construct(); - $this->_updateButton('save', 'label', Mage::helper('Mage_SalesRule_Helper_Data')->__('Save Rule')); - $this->_updateButton('delete', 'label', Mage::helper('Mage_SalesRule_Helper_Data')->__('Delete Rule')); - - $rule = Mage::registry('current_promo_quote_rule'); - - if (!$rule || !$rule->isDeleteable()) { - $this->_removeButton('delete'); - } - - if ($rule && $rule->isReadonly()) { - $this->_removeButton('save'); - $this->_removeButton('reset'); - } else { - $this->_addButton('save_and_continue', array( - 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('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('Mage_SalesRule_Helper_Data')->__('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'); @@ -78,6 +66,11 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit extends Mage_Adminhtml_Block_Widget_ } } + /** + * 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 2115c3941c3..468c63a2714 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 d085c232e30..44139c3263c 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 e4e7ecf1a6f..0cf071b6976 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 new file mode 100644 index 00000000000..2f778e2188b --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php @@ -0,0 +1,88 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * "Manage Coupons Codes" Tab + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_SalesRule_Helper_Data')->__('Manage Coupon Codes'); + } + + /** + * Prepare title for tab + * + * @return string + */ + public function getTabTitle() + { + return Mage::helper('Mage_SalesRule_Helper_Data')->__('Manage Coupon 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 00000000000..78a5d4fdabd --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Form.php @@ -0,0 +1,147 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Coupons generation parameters form + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_SalesRule_Helper_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('Mage_SalesRule_Helper_Data')->__('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('Mage_SalesRule_Helper_Data')->__('Coupon Qty'), + 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Coupon Qty'), + 'required' => true, + 'class' => 'validate-digits validate-greater-than-zero' + )); + + $fieldset->addField('length', 'text', array( + 'name' => 'length', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Length'), + 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Length'), + 'required' => true, + 'note' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Excluding prefix, suffix and separators.'), + 'value' => $couponHelper->getDefaultLength(), + 'class' => 'validate-digits validate-greater-than-zero' + )); + + $fieldset->addField('format', 'select', array( + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Format'), + 'name' => 'format', + 'options' => $couponHelper->getFormatsList(), + 'required' => true, + 'value' => $couponHelper->getDefaultFormat() + )); + + $fieldset->addField('prefix', 'text', array( + 'name' => 'prefix', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Prefix'), + 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Prefix'), + 'value' => $couponHelper->getDefaultPrefix() + )); + + $fieldset->addField('suffix', 'text', array( + 'name' => 'suffix', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Suffix'), + 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Suffix'), + 'value' => $couponHelper->getDefaultSuffix() + )); + + $fieldset->addField('dash', 'text', array( + 'name' => 'dash', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Dash Every X Characters'), + 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Dash Every X Characters'), + 'note' => Mage::helper('Mage_SalesRule_Helper_Data')->__('If empty no separation.'), + 'value' => $couponHelper->getDefaultDashInterval(), + 'class' => 'validate-digits' + )); + + $idPrefix = $form->getHtmlIdPrefix(); + $generateUrl = $this->getGenerateUrl(); + + $fieldset->addField('generate_button', 'note', array( + 'text' => $this->getButtonHtml( + Mage::helper('Mage_SalesRule_Helper_Data')->__('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 00000000000..104f0707ed8 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php @@ -0,0 +1,146 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Coupon codes grid + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_SalesRule_Model_Resource_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('Mage_SalesRule_Helper_Data')->__('Coupon Code'), + 'index' => 'code' + )); + + $this->addColumn('created_at', array( + 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Created On'), + 'index' => 'created_at', + 'type' => 'datetime', + 'align' => 'center', + 'width' => '160' + )); + + $this->addColumn('used', array( + 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Used'), + 'index' => 'times_used', + 'width' => '100', + 'type' => 'options', + 'options' => array( + Mage::helper('Mage_Adminhtml_Helper_Data')->__('No'), + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Yes') + ), + 'renderer' => 'adminhtml/promo_quote_edit_tab_coupons_grid_column_renderer_used', + 'filter_condition_callback' => array( + Mage::getResourceModel('Mage_SalesRule_Model_Resource_Coupon_Collection'), 'addIsUsedFilterCallback' + ) + )); + + $this->addColumn('times_used', array( + 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Times Used'), + 'index' => 'times_used', + 'width' => '50', + 'type' => 'number', + )); + + $this->addExportType('*/*/exportCouponsCsv', Mage::helper('Mage_Customer_Helper_Data')->__('CSV')); + $this->addExportType('*/*/exportCouponsXml', Mage::helper('Mage_Customer_Helper_Data')->__('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()->setHideFormElement(true); + + $this->getMassactionBlock()->addItem('delete', array( + 'label'=> Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete'), + 'url' => $this->getUrl('*/*/couponsMassDelete', array('_current' => true)), + 'confirm' => Mage::helper('Mage_SalesRule_Helper_Data')->__('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 100755 index 00000000000..42a6e3341b9 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid/Column/Renderer/Used.php @@ -0,0 +1,42 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Coupon codes grid "Used" column renderer + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Adminhtml_Helper_Data')->__('No') : Mage::helper('Mage_Adminhtml_Helper_Data')->__('Yes'); + } +} \ No newline at end of file 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 672aec25cf2..361689760f5 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 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Labels 'legend' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Store View Specific Labels'), 'table_class' => 'form-list stores-tree', )); + $renderer = $this->getLayout()->createBlock('Mage_Adminhtml_Block_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 0d0062c1676..90c16d4e8a9 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 <core@magentocommerce.com> + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form @@ -57,7 +56,7 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main } /** - * Returns status flag about this tab can be showen or not + * Returns status flag about this tab can be showed or not * * @return true */ @@ -80,14 +79,11 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main { $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('Mage_SalesRule_Helper_Data')->__('General Information')) + $fieldset = $form->addFieldset('base_fieldset', + array('legend' => Mage::helper('Mage_SalesRule_Helper_Data')->__('General Information')) ); if ($model->getId()) { @@ -124,39 +120,41 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main '0' => Mage::helper('Mage_SalesRule_Helper_Data')->__('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('Mage_CatalogRule_Helper_Data')->__('Websites'), - 'title' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Websites'), - 'required' => true, - 'values' => Mage::getSingleton('Mage_Adminhtml_Model_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 + )); + $model->setWebsiteIds($websiteId); + } else { + $fieldset->addField('website_ids', 'multiselect', array( + 'name' => 'website_ids[]', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Websites'), + 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Websites'), + 'required' => true, + 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getWebsiteValuesForForm() )); - $model->setWebsiteIds(Mage::app()->getStore(true)->getWebsiteId()); } - $customerGroups = Mage::getResourceModel('Mage_Customer_Model_Resource_Group_Collection') - ->load()->toOptionArray(); - + $customerGroups = Mage::getResourceModel('Mage_Customer_Model_Resource_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('Mage_SalesRule_Helper_Data')->__('NOT LOGGED IN'))); + array_unshift($customerGroups, array( + 'value' => 0, + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('NOT LOGGED IN')) + ); } $fieldset->addField('customer_group_ids', 'multiselect', array( @@ -164,7 +162,7 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Customer Groups'), 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Customer Groups'), 'required' => true, - 'values' => $customerGroups, + 'values' => Mage::getResourceModel('Mage_Customer_Model_Resource_Group_Collection')->toOptionArray(), )); $couponTypeFiled = $fieldset->addField('coupon_type', 'select', array( @@ -180,6 +178,18 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main 'required' => true, )); + $autoGenerationCheckbox = $fieldset->addField('use_auto_generation', 'checkbox', array( + 'name' => 'use_auto_generation', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Use Auto Generation'), + 'note' => Mage::helper('Mage_SalesRule_Helper_Data')->__('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('Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main_Renderer_Checkbox') + ); + $usesPerCouponFiled = $fieldset->addField('uses_per_coupon', 'text', array( 'name' => 'uses_per_coupon', 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Uses per Coupon'), @@ -230,6 +240,8 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main $form->setValues($model->getData()); + $autoGenerationCheckbox->setValue(1); + if ($model->isReadonly()) { foreach ($fieldset->getElements() as $element) { $element->setReadonly(true, true); @@ -245,11 +257,16 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main ->createBlock('Mage_Adminhtml_Block_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 00000000000..b922bb526e3 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php @@ -0,0 +1,59 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Renderer for specific checkbox that is used on Rule Information tab in Shopping cart price rules + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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( + '<label for="%s"><b>%s</b></label><p class="note">%s</p>', + $element->getHtmlId(), $element->getLabel(), $element->getNote() + ); + $html = '<td class="label"> </td>'; + $html .= '<td class="value">' . $elementHtml . '</td>'; + + return $html; + } + +} 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 9f607f0aca7..181bc26fa88 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 567ec36a8d7..a4df9920404 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 <core@magentocommerce.com> + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> */ 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 @@ class Mage_Adminhtml_Block_Promo_Quote_Grid extends Mage_Adminhtml_Block_Widget_ $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_Resource_Rule_Collection */ $collection = Mage::getModel('Mage_SalesRule_Model_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 @@ class Mage_Adminhtml_Block_Promo_Quote_Grid extends Mage_Adminhtml_Block_Widget_ ), )); + if (!Mage::app()->isSingleStoreMode()) { + $this->addColumn('rule_website', array( + 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Website'), + 'align' =>'left', + 'index' => 'website_ids', + 'type' => 'options', + 'sortable' => false, + 'options' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getWebsiteOptionHash(), + 'width' => 200, + )); + } + $this->addColumn('sort_order', array( 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('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 28cb4c78eda..d70740a5e16 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) */ @@ -103,6 +103,10 @@ class Mage_Adminhtml_Block_Promo_Widget_Chooser extends Mage_Adminhtml_Block_Wid $collection = Mage::getModel('Mage_SalesRule_Model_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/Promo/Widget/Chooser/Daterange.php b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Daterange.php index 5ae0037b444..609dab77415 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 4a089f14aac..f6be73d2200 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 d2ae17ea99a..6cb2d330fa8 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 9a05c7a3b49..85c5d7111ed 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 81f6a10e89f..cb0bd8203ff 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) */ @@ -111,7 +111,8 @@ class Mage_Adminhtml_Block_Rating_Edit_Tab_Form extends Mage_Adminhtml_Block_Wid 'label' => Mage::helper('Mage_Rating_Helper_Data')->__('Visible In'), // 'required' => true, 'name' => 'stores[]', - 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm() + 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(), + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); if (Mage::registry('rating_data')) { 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 b61ee1561d4..6cdd867bd2e 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 d901c44568c..bd103b980e3 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 5fb9ac1cd36..5c9ff3a609b 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) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php b/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php index 2c70205bd7c..e967b81f8ec 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 224f1e951f1..a1f5160b8d5 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 612ce308266..cf16cab47e8 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 bed85b8b3fb..47a237f87e8 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 c5c35bc497e..0c608c302e1 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 ec70acc122b..509b8abc47a 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 0e837b93bc5..9ee9c64ab1c 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 500a4029e9a..3ed8fa38db7 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 adc0e5328bc..2b4ac463f47 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 ac2fc45c891..48b985c245b 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) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php index 225dd82f645..b400c00f55a 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 5b131bfe6ed..7373473d67e 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) */ @@ -159,9 +159,11 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid ->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,12 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid ->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); + $this->_addCustomFilter($totalsCollection, $filterData); + foreach ($totalsCollection as $item) { $this->setTotals($item); break; @@ -208,9 +213,11 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid ->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 +237,11 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid ->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,7 +261,7 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid } return $this->_currentCurrencyCode; } - + /** * Get currency rate (base to given currency) * @@ -263,4 +272,30 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid { 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/Column/Renderer/Blanknumber.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php index 112f47439e1..d6d780e24c3 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 c22a7d3ba04..6a11bd9ad51 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 69c0840d0c9..bc444bbef06 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 a2b4a875190..447e9baa6e6 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 ad56636771d..2cc8d48efe8 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 89fc2fda0c6..449973aeac1 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 9be7e57be3a..4f76093eb96 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 55c91fa73a5..e2cba3fd031 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 cb0f6f5aa3c..62dffc57693 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 6e8882f7fbc..1cc0007e8e7 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 21af16014b4..ce636758120 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 f24df812255..5fbd939c573 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/Sold.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php index 53e8db8d04c..cff4cd59ce0 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 bf501f4f66a..ffb05118922 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 b3be762a007..d0416921e86 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) */ @@ -39,6 +39,22 @@ class Mage_Adminhtml_Block_Report_Product_Viewed extends Mage_Adminhtml_Block_Wi $this->_controller = 'report_product_viewed'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Most Viewed'); parent::__construct(); + $this->setTemplate('report/grid/container.phtml'); $this->_removeButton('add'); + $this->addButton('filter_form_submit', array( + 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('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 0977aff8419..44f3d36e282 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) */ @@ -31,49 +31,94 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -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 = 'Mage_Reports_Model_Resource_Product_Viewed_Collection'; + + /** + * Init grid parameters + */ public function __construct() { parent::__construct(); - $this->setId('gridViewedProducts'); - } - - protected function _prepareCollection() - { - parent::_prepareCollection(); - $this->getCollection()->initReport('Mage_Reports_Model_Resource_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('Mage_Reports_Helper_Data')->__('Product Name'), - 'index' =>'name', - 'total' =>Mage::helper('Mage_Reports_Helper_Data')->__('Subtotal') + $this->addColumn('period', array( + 'header' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Period'), + 'index' => 'period', + 'width' => 100, + 'sortable' => false, + 'period_type' => $this->getPeriodType(), + 'renderer' => 'Mage_Adminhtml_Block_Report_Sales_Grid_Column_Renderer_Date', + 'totals_label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total'), + 'html_decorators' => array('nobr'), + )); + + $this->addColumn('product_name', array( + 'header' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Product Name'), + 'index' => 'product_name', + 'type' => 'string', + 'sortable' => false )); - $this->addColumn('price', array( - 'header' => Mage::helper('Mage_Reports_Helper_Data')->__('Price'), - 'width' => '120px', + if ($this->getFilterData()->getStoreIds()) { + $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds())); + } + $currencyCode = $this->getCurrentCurrencyCode(); + + $this->addColumn('product_price', array( + 'header' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Price'), 'type' => 'currency', - 'currency_code' => $this->getCurrentCurrencyCode(), - 'index' => 'price', + 'currency_code' => $currencyCode, + 'index' => 'product_price', + 'sortable' => false, + 'rate' => $this->getRate($currencyCode), )); - $this->addColumn('views', array( - 'header' =>Mage::helper('Mage_Reports_Helper_Data')->__('Number of Views'), - 'width' =>'120px', - 'align' =>'right', - 'index' =>'views', - 'total' =>'sum' + $this->addColumn('views_num', array( + 'header' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Number of Views'), + 'index' => 'views_num', + 'type' => 'number', + 'total' => 'sum', + 'sortable' => false )); - $this->addExportType('*/*/exportViewedCsv', Mage::helper('Mage_Reports_Helper_Data')->__('CSV')); - $this->addExportType('*/*/exportViewedExcel', Mage::helper('Mage_Reports_Helper_Data')->__('Excel XML')); + + $this->addExportType('*/*/exportViewedCsv', Mage::helper('Mage_Adminhtml_Helper_Data')->__('CSV')); + $this->addExportType('*/*/exportViewedExcel', Mage::helper('Mage_Adminhtml_Helper_Data')->__('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.php b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php index 60567210c34..196c6988e52 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 f7be00082f7..9b375d6192f 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) */ @@ -97,7 +97,13 @@ class Mage_Adminhtml_Block_Report_Refresh_Statistics_Grid extends Mage_Adminhtml 'report' => Mage::helper('Mage_Sales_Helper_Data')->__('Bestsellers'), 'comment' => Mage::helper('Mage_Sales_Helper_Data')->__('Products Bestsellers Report'), 'updated_at' => $this->_getUpdatedAt(Mage_Reports_Model_Flag::REPORT_BESTSELLERS_FLAG_CODE) - ) + ), + array( + 'id' => 'viewed', + 'report' => Mage::helper('Mage_Sales_Helper_Data')->__('Most Viewed'), + 'comment' => Mage::helper('Mage_Sales_Helper_Data')->__('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/Review/Customer.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php index bc201f71918..0bb956516b4 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 6e2323e8642..26e1d3c9e69 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 3e19ffa3d99..acb8f2b9a3c 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 35632c83aaa..6e1e82c1fc6 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 20cfdee1172..c57fc871f85 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 70be59cf594..4afc2bb6b3f 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 e6524384f18..ae10b5da67c 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 b97e66e2aff..b45547a81a1 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 42a8f5cb52d..44c5f28f567 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 7e8c3ee54d4..a3cc2790123 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) */ @@ -71,6 +71,12 @@ class Mage_Adminhtml_Block_Report_Sales_Coupons_Grid extends Mage_Adminhtml_Bloc 'index' => 'coupon_code' )); + $this->addColumn('rule_name', array( + 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Shopping Cart Price Rule'), + 'sortable' => false, + 'index' => 'rule_name' + )); + $this->addColumn('coupon_uses', array( 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Number of Uses'), 'sortable' => false, @@ -150,4 +156,24 @@ class Mage_Adminhtml_Block_Report_Sales_Coupons_Grid extends Mage_Adminhtml_Bloc 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/Grid/Column/Renderer/Date.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php index 704fddc6e72..d51584421b7 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 17fa760cbca..84bc0cb5e2e 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 6b6afca3192..5797984df02 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 7c0f6f3ce05..1005f3489f5 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 9319edc3c89..a6ead9d2860 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 23accdffb75..5453ce4d97e 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 7019851792e..9288f97e78d 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 35f35212bcd..dc3bca9836b 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 531b3461e3e..37bc997b4b3 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 15319f6909e..9ce1f72896f 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 a444ed8b59f..b68c9ca514c 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 9b36108be24..fd4e6e9f32f 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 d40e25418b6..de5cb6a32da 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 7755a89d314..74534f9c42a 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 e41de634aaf..b148285d056 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 b4f7aac251f..adf338ef44d 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 503278abbd9..00cea8f443a 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 1fbf809d4eb..d53272dc0c5 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 be7259c7a50..1ccb4542187 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 d737209ad63..2d8984c8062 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 cfe9cadb282..60562550a92 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 58ae3eaaf11..f6ab7795b86 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 4c64041c7b2..e667ae47121 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 bee076d4009..f6427c30aa0 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 dd74f4eb521..9932ee540e6 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 5dcdd87ce19..96d816861c8 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 c0fa5b17f5a..f8c9b57ce5f 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 fb2b8da234a..2bb3f0f50d1 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 50f5e949753..cddb0869fa2 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 134b817a544..8564f6325e2 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 2f15b9a6cf2..857ad36fb74 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 d15ecd7a2b1..f1a9f41284b 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 25b1cea1e69..254e39c280a 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 7495871b8ea..5096863702c 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 683bf4094a2..e237d79ad80 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) */ @@ -54,8 +54,7 @@ class Mage_Adminhtml_Block_Review_Add_Form extends Mage_Adminhtml_Block_Widget_F 'label' => Mage::helper('Mage_Review_Helper_Data')->__('Product Rating'), 'required' => true, 'text' => '<div id="rating_detail">' - . $this->getLayout()->createBlock('Mage_Adminhtml_Block_Review_Rating_Detailed')->toHtml() - . '</div>', + . $this->getLayout()->createBlock('Mage_Adminhtml_Block_Review_Rating_Detailed')->toHtml() . '</div>', )); $fieldset->addField('status_id', 'select', array( @@ -73,7 +72,8 @@ class Mage_Adminhtml_Block_Review_Add_Form extends Mage_Adminhtml_Block_Widget_F 'label' => Mage::helper('Mage_Review_Helper_Data')->__('Visible In'), 'required' => true, 'name' => 'select_stores[]', - 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm() + 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(), + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_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 b88b1609656..9c821c72e6e 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 84b82b15b1b..9e98750af83 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) */ @@ -58,11 +58,7 @@ class Mage_Adminhtml_Block_Review_Edit_Form extends Mage_Adminhtml_Block_Widget_ )); if ($customer->getId()) { - $customerText = Mage::helper('Mage_Review_Helper_Data')->__('<a href="%1$s" onclick="this.target=\'blank\'">%2$s %3$s</a> <a href="mailto:%4$s">(%4$s)</a>', - $this->getUrl('*/customer/edit', array('id' => $customer->getId(), 'active_tab'=>'review')), - $this->escapeHtml($customer->getFirstname()), - $this->escapeHtml($customer->getLastname()), - $this->escapeHtml($customer->getEmail())); + $customerText = Mage::helper('Mage_Review_Helper_Data')->__('<a href="%1$s" onclick="this.target=\'blank\'">%2$s %3$s</a> <a href="mailto:%4$s">(%4$s)</a>', $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('Mage_Review_Helper_Data')->__('Guest'); @@ -85,8 +81,8 @@ class Mage_Adminhtml_Block_Review_Edit_Form extends Mage_Adminhtml_Block_Widget_ 'label' => Mage::helper('Mage_Review_Helper_Data')->__('Detailed Rating'), 'required' => true, 'text' => '<div id="rating_detail">' - . $this->getLayout()->createBlock('Mage_Adminhtml_Block_Review_Rating_Detailed')->toHtml() - . '</div>', + . $this->getLayout()->createBlock('Mage_Adminhtml_Block_Review_Rating_Detailed')->toHtml() + . '</div>', )); $fieldset->addField('status_id', 'select', array( @@ -104,7 +100,8 @@ class Mage_Adminhtml_Block_Review_Edit_Form extends Mage_Adminhtml_Block_Widget_ 'label' => Mage::helper('Mage_Review_Helper_Data')->__('Visible In'), 'required' => true, 'name' => 'stores[]', - 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm() + 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(), + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_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 6be785f4114..68b91465bdd 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 @@ class Mage_Adminhtml_Block_Review_Grid extends Mage_Adminhtml_Block_Widget_Grid $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 @@ class Mage_Adminhtml_Block_Review_Grid extends Mage_Adminhtml_Block_Widget_Grid 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('Mage_Review_Helper_Data')->__('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('Mage_Review_Helper_Data')->__('Are you sure?') )); @@ -227,7 +239,10 @@ class Mage_Adminhtml_Block_Review_Grid extends Mage_Adminhtml_Block_Widget_Grid array_unshift($statuses, array('label'=>'', 'value'=>'')); $this->getMassactionBlock()->addItem('update_status', array( 'label' => Mage::helper('Mage_Review_Helper_Data')->__('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,12 +268,15 @@ class Mage_Adminhtml_Block_Review_Grid extends Mage_Adminhtml_Block_Widget_Grid 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(); } } -} +} \ No newline at end of file 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 7e9bbf7087a..1aa24f50bef 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 8c9b77e3bbd..8414a101057 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 930bed3c476..72e595e6804 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) */ 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 0bdfe306fc4..00512541127 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 db64b9a94ff..6f14ada7cc9 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 62209d61e4d..03595184c74 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/Creditmemo.php b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php index f86d390cf4c..a0c606f32b8 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 1f1ae7ff878..e87763b7b93 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 7d7b0cfe01b..5ac099b9e75 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 f31944adeb8..e43ff053c81 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 11c3967157e..d02f569b6eb 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 ef0d0196a7e..d6181335a82 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 7550357243b..320111ec41c 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 a216d92eebc..849a342a898 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 6a5294d9cc8..3e85a97fa74 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 e7d281dc703..19ac5d6b048 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 6f17e08eba5..7ec8e74241c 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 2af514c0dae..d07c8bb425f 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 12696b7b068..cfab3669406 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 e992f1bbede..f2da47b838f 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 bcb4b98255b..6397dd7239d 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 d2534e65c61..9c5c17cfacc 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 4d95c20ff2d..33c7984ff86 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) */ @@ -56,6 +56,8 @@ class Mage_Adminhtml_Block_Sales_Order_Create extends Mage_Adminhtml_Block_Widge } $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)) { @@ -122,4 +124,14 @@ class Mage_Adminhtml_Block_Sales_Order_Create extends Mage_Adminhtml_Block_Widge 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/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Abstract.php index 55bae951fce..71a4e34e820 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 c67abe60f3b..ecbea6b539c 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,6 +62,7 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Billing_Address */ protected function _prepareForm() { + $this->setJsVariablePrefix('billingAddress'); parent::_prepareForm(); $this->_form->addFieldNameSuffix('order[billing_address]'); 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 55b55bcfa64..b342f5faf1e 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 8f9af3bf45f..a3c16612174 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 050693a6654..d6fd2d777ec 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 5b4cfb38741..93ce6e82c13 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 5d25132133d..ac37cfe6efc 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 b598a0b3387..81903b3b289 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 f2b39121dd6..ea55e7b62f9 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 66ec5c963b1..8cbd45ab686 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 2f52276bdca..007d0f70eba 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 3d04629278d..547ff84a8bd 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 @@ abstract class Mage_Adminhtml_Block_Sales_Order_Create_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 636361558f3..b4d009cd945 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 515237c8615..9d6d0f57e1e 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 <core@magentocommerce.com> */ -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 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Form_Address extends Mage_Adminhtm 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('Mage_Core_Helper_Data')->jsonEncode($data); } @@ -169,6 +172,15 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Form_Address extends Mage_Adminhtm ); } + // Set custom renderer for VAT field if needed + $vatIdElement = $this->_form->getElement('vat_id'); + if ($vatIdElement && $this->getDisplayVatValidationButton() !== false) { + $vatIdElement->setRenderer( + $this->getLayout()->createBlock('Mage_Adminhtml_Block_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 19a94e05f4f..6d2fd6a0ef9 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 714f3c3acab..eb6c30d1412 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 da7a157ad20..bc4163f3bc1 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 2bfa33bb7d3..6916e636e34 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 <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ 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('Mage_Sales_Helper_Data')->__('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('Mage_Sales_Helper_Data')->__('Add Products'), - 'onclick' => "order.productGridShow(this)", - 'class' => 'add', - ); - return $this->getLayout()->createBlock('Mage_Adminhtml_Block_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('Mage_Adminhtml_Block_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 90540c0856b..83d021a8346 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) */ 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 cfa1cc3c759..b0769e4d9dc 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 125712a85eb..302cc8d9429 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 bc67073ca88..b84e140f8b0 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 623a7cb0547..e2bebac3e43 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 31c4067c2a1..f49908d5e98 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 1b9a2e207ac..647959a771e 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/Price.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Price.php index 2ba1493ea66..49c7e653896 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 <core@magentocommerce.com> */ -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 29ec38c87b9..4f3db1504fd 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 206279dd546..98ee55f9b32 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 3e7b68329b6..24f7277e740 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 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Address */ 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 f66bd6be841..7e3aa7e7061 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 8c2edc39038..fb67af04aa0 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 90a42573d93..689b4ac7cfd 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 7a6d76ddf63..c34c0a148bc 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 cdba1633a02..7c6a203b1ee 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) */ @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -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,24 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Cart extends Mage_Adminhtm { 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() + { + $deleteAllConfirmString = Mage::helper('Mage_Sales_Helper_Data')->__('Are you sure you want to delete all items from shopping cart?'); + $button = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')->setData(array( + 'label' => Mage::helper('Mage_Sales_Helper_Data')->__('Clear Shopping Cart'), + 'onclick' => 'order.clearShoppingCart(\'' . $deleteAllConfirmString . '\')', + 'style' => 'float: right;' + )); + $this->setChild('empty_customer_cart_button', $button); + + return parent::_prepareLayout(); + } } 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 3db14aba451..fa648b92cb3 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 3915111e463..2de07b73f12 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 eb1c63e9127..b2441db7fea 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 ec4e1112742..db4b111deca 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 2da79490650..5b1146583b7 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 1ae558edeb0..973be1af501 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 4006b547618..4d3a1ef1923 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 f18ecbedd91..323f0d1710a 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 5302951eff5..b287f80c49f 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 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Totals extends Mage_Adminhtml_Bloc $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 a4dfd54a69c..954752fa4d9 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 4ba00af27bd..82b1279a48e 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 f1b2d9f8ff8..e2a7d6b794e 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 8067f28ba91..da3885c390e 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 7e3ede85d2e..d870fef58cb 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 934a90ba120..c21d1eec121 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 9ca77ed307e..da376ed16ea 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 ef91eea22ae..b158afce4bb 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) */ @@ -67,20 +67,12 @@ class Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create extends Mage_Adminhtml_ public function getHeaderText() { if ($this->getCreditmemo()->getInvoice()) { - $header = Mage::helper('Mage_Sales_Helper_Data')->__('New Credit Memo for Invoice #%s', - $this->getCreditmemo()->getInvoice()->getIncrementId() - ); + $header = Mage::helper('Mage_Sales_Helper_Data')->__('New Credit Memo for Invoice #%s', $this->getCreditmemo()->getInvoice()->getIncrementId()); } else { - $header = Mage::helper('Mage_Sales_Helper_Data')->__('New Credit Memo for Order #%s', - $this->getCreditmemo()->getOrder()->getRealOrderId() - ); + $header = Mage::helper('Mage_Sales_Helper_Data')->__('New Credit Memo for Order #%s', $this->getCreditmemo()->getOrder()->getRealOrderId()); } - /*$header = Mage::helper('Mage_Sales_Helper_Data')->__('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; } @@ -91,4 +83,4 @@ class Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create extends Mage_Adminhtml_ array('order_id' => $this->getCreditmemo() ? $this->getCreditmemo()->getOrderId() : null) ); } -} +} \ No newline at end of file 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 42f51abe56e..6faee9e4a6c 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 b103c01d878..5e564020d65 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 1858cfd3a05..e7ad2d8423b 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 8c4b79cd01b..ed434c5102b 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 5a4b2364ae8..27cbdb7fd7f 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 fbade9489ab..236535dbd8d 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 eea699be8dd..7c0033050e8 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 c2cc67c19b0..322044c11d2 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 91e411ab643..a81933f2822 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 aa3a7341eaf..f0cbb24f175 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 e6332e90498..4722b59e6e8 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 43ed5147c50..6d860d55fba 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 543a4cbadf8..3ddca10d5fb 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 2461dfd0c03..af6f2c59859 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 a132b246f59..371728fe716 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 c3bb5d9eeeb..510ae32ad6e 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 870c3906026..47b29fb3bff 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 0a3ed08628f..1cc3ecb4f6f 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 5f98ec54984..aa90eeb03be 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 fee5f6c70a3..49dffcb542c 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 8340be7b75d..5de4d370581 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 8c97862ec4c..2b3e2fb7b77 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 @@ class Mage_Adminhtml_Block_Sales_Order_Shipment_Create_Items extends Mage_Adminh */ 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 9760ec275fd..3835aca15cb 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 69fc4dbf092..20d93cda900 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) */ 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 0876b950178..9dea4d955af 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_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/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php index 5d2122cb732..aeae658c077 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 74b0ef0eb3f..27e7b3e853f 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 ebe389ee518..d4c9935462a 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 c663c939615..07c04195c34 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 @@ class Mage_Adminhtml_Block_Sales_Order_Shipment_View_Form extends Mage_Adminhtml /** * 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 02ed083cd1a..8023a12b4ac 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 3845b591c81..f2d40d0edc8 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 6e0ea63a4e0..79b1703fe12 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 43e96e70434..31667725049 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 7ad9eac26be..2bd5cc4672b 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 fa6555fb9e2..cc2535138ce 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 a168cc83334..b6b8dbe8628 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 9d72ca0b939..00d17b8357b 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 1ee76e7b8e8..3a0b65aa7fe 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 680a263ad7d..bc2b79a60c4 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) */ 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 c166b8850b8..35e371bed28 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 7a3bbf5b70f..591dc74dec1 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 3efd8cbe195..88a7433308c 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 704193f3335..acfe53235de 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 6973726b88a..ad29f707314 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) */ 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 3b4ab895237..6eedbaa4a2f 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 a35c4bf1bc6..a2b4856cdd7 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 1e71c04e742..2f0482dae3f 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 929bf5c4b2f..c443a089af7 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) */ 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 3423562b6ee..47c3572563f 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 1225b0dec6e..f23511b3edf 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 debf3e7d777..efcac73c629 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 0f8b9256f49..5487b05b606 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 b2131fbd7ec..b88dfe21739 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 95c4c7cc999..f8fece3e7de 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 9a420c24b3a..c29481f2241 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 cfa913424c2..04a41b14224 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 aabb99f4636..a4fbacc8711 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 423bc75b3fb..9fb61ff9b2b 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 d4d9f326517..0f6258573dc 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 bd44b33aac0..41c0518bdc2 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 ef06d49a6c6..8fac4a2a100 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 c814dff6173..63624c56a8d 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 5be551236bb..f06e8c9053d 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 8476e5622f5..8ad17f2feec 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 de3e9e042cf..bad4781fff7 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) */ @@ -78,10 +78,7 @@ class Mage_Adminhtml_Block_Sales_Transactions_Detail extends Mage_Adminhtml_Bloc */ public function getHeaderText() { - return Mage::helper('Mage_Sales_Helper_Data')->__("Transaction # %s | %s", - $this->_txn->getTxnId(), - $this->formatDate($this->_txn->getCreatedAt(), Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true) - ); + return Mage::helper('Mage_Sales_Helper_Data')->__("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 cf50e6b008b..c844e1bd5e9 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 b290c5bd915..6500065dc48 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 4ca852ed61c..272811022f8 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 6d799081a2d..1828ebfee07 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 10d2a120835..bb9e211a23d 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 408b95ffa1c..13a7ce2773f 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) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php index bc7580d5b26..6beaf53884e 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 38b4ace6788..56ec63bf185 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 28bc6dc0081..4feee719d22 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 e19f43feadd..426d7109af6 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 8dced149576..6e22b106231 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 <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ 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 @@ class Mage_Adminhtml_Block_Store_Switcher extends Mage_Adminhtml_Block_Template } return $this->_hasDefaultOption; } + + /** + * Return url for store switcher hint + * + * @return string + */ + public function getHintUrl() + { + if (null === $this->_hintUrl) { + $this->_hintUrl = Mage::helper('Mage_Core_Helper_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 = '<a' + . ' href="'. $this->escapeUrl($url) . '"' + . ' onclick="this.target=\'_blank\'"' + . ' title="' . $this->__('What is this?') . '"' + . ' class="link-storeScope">' + . $this->__('What is this?') + . '</a>'; + } + 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 00000000000..f5ce3250ab5 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset.php @@ -0,0 +1,83 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Form fieldset renderer + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Adminhtml_Block_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 7af6ff68982..5b13145fc57 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 c260898796c..df5f16fd56b 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 7179a595aa5..b1bcf6d04ea 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 a4ce57ab203..565a9703217 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 1630ada314a..db2339f17f3 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 8f66e08e17a..006d82e14e1 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 353ea0a710b..bdd5a49a716 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 @@ class Mage_Adminhtml_Block_System_Config_Form extends Mage_Adminhtml_Block_Widge 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 @@ class Mage_Adminhtml_Block_System_Config_Form extends Mage_Adminhtml_Block_Widge . '/' . $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 37d0c348ba7..989a7cbac36 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 02c3ff64500..3e3d263ca06 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 fcd7e9e7837..f51bd9ab6cc 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 877563bff5c..05d9c92bea8 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 07a24da5992..6727c50c6b7 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 30676a93876..1b3188340b3 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 801918ac603..f6405a23278 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 3898f913d16..a70f81b0807 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 395c5ed4d98..db3f2e551b4 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 35a63d6c177..fae00ccbaa2 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 e2d053f4acc..630dc0c10fb 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 2cdcb8a0adb..a669dc0e09f 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 e1c3e33c3eb..576da571c14 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 f654e7217c6..0456c29e0f2 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 9a35d44b62d..2e9137cff19 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 @@ class Mage_Adminhtml_Block_System_Config_Form_Fieldset_Modules_DisableOutput $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 52ce47a4c08..95f72e21dd4 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 4491298fe60..a6a6aa0a277 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 @@ class Mage_Adminhtml_Block_System_Config_Switcher extends Mage_Adminhtml_Block_T return $options; } + /** + * Return store switcher hint html + * + * @return mixed + */ + public function getHintHtml() + { + return Mage::getBlockSingleton('Mage_Adminhtml_Block_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 ef417f0c6d9..c43bc232d9a 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 559e5d58b5b..fdd8628adc4 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 @@ class Mage_Adminhtml_Block_System_Config_Tabs extends Mage_Adminhtml_Block_Widge $configFields = Mage::getSingleton('Mage_Adminhtml_Model_Config'); $sections = $configFields->getSections($current); $tabs = (array)$configFields->getTabs()->children(); - + $sections = (array)$sections; @@ -99,7 +99,7 @@ class Mage_Adminhtml_Block_System_Config_Tabs extends Mage_Adminhtml_Block_Widge 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 f0b813f0359..9720b100b70 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 aee6289a93d..3e4d29a6129 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 f55accf7d55..78696eab00f 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 d44555aa541..f3fcc140094 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 c2004f64d9e..841364335f7 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 8bed5325e22..65814db4136 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 211c1a18342..2bb3d75326b 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 5d1f1181809..8ab719ae28d 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 3b109a83d22..af280f7a45f 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 695189a305a..0026ed34135 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 8df5ffc212f..c86333f3bce 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 b11dffbe13e..14932689ff4 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 208336617bf..38569d0d636 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 c826762e8c8..00f1cd2dbc4 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 f307e8847b0..2b133249131 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 6e726f4d227..10b18855f6a 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 172c90d37d4..bea1e3ef1a3 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 8b640949e02..24ff410a659 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 61ebcc27002..b73da08cc22 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 8d674f3dce4..4a27d0791af 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 af2a377d5fd..baeaa6ba125 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 d5412d8183f..79ab475febd 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 882c00c37a3..d4cbaa4ace3 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 84d42f0ac7e..30669ce4a56 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 c7d1ae6d83c..c2eeef9176d 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 49ab98861eb..6a955ceb21e 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 2f053310cf9..caa6ee7063e 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 78210fe058f..f2905b1e8b3 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 889a7d656fd..6ddf5a0a2c2 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 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 b897516bdca..bd4c59f2c05 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 66a4639c50d..9f7d1c8dcdb 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 e1cffa68ccf..2921fb58b3c 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 a186a0a9df5..44d3eab20db 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 1b0435a0fbe..aeb14a9192e 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) */ 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 2b86d2e4108..cb49590a0c2 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 dd52f4ef980..131656f62bd 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) */ @@ -32,19 +32,20 @@ * @author Magento Core Team <core@magentocommerce.com> */ -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('Mage_Adminhtml_Helper_Data')->__($label)); + foreach (self::$_types as $code => $label) { + $result[] = array('value' => $code, 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__($label)); } return $result; @@ -57,8 +58,6 @@ class Mage_Adminhtml_Block_System_Email_Template_Grid_Filter_Type extends Mage_A 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/Action.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Action.php index f7e800e8f02..ee494a4286d 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 374a69cce8a..7e71a41febb 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 2192abcd31d..c12fd51b5b2 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) */ @@ -32,11 +32,12 @@ * @author Magento Core Team <core@magentocommerce.com> */ -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 ccfb30def21..2ee03216e55 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) */ @@ -29,23 +29,27 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ 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('Mage_Core_Model_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('Mage_Core_Model_Input_Filter_MaliciousCode'); + $template->setTemplateText( - $this->escapeHtml($template->getTemplateText()) + $filter->filter($template->getTemplateText()) ); Magento_Profiler::start("email_template_proccessing"); @@ -53,7 +57,7 @@ class Mage_Adminhtml_Block_System_Email_Template_Preview extends Mage_Adminhtml_ $templateProcessed = $template->getProcessedTemplate($vars, true); - if($template->isPlain()) { + if ($template->isPlain()) { $templateProcessed = "<pre>" . htmlspecialchars($templateProcessed) . "</pre>"; } @@ -61,5 +65,4 @@ class Mage_Adminhtml_Block_System_Email_Template_Preview extends Mage_Adminhtml_ return $templateProcessed; } - } 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 68a46d2e748..637bdbab4d5 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 757ba812c8e..51c29058078 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 3847d6177b0..38021deacb2 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 946147f122b..8e79abc8d69 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 4323bfca727..9451223ee8f 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 4fc6b2a2a64..7bc32a689ba 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,7 +109,8 @@ class Mage_Adminhtml_Block_System_Store_Edit_Form extends Mage_Adminhtml_Block_W )); if (Mage::registry('store_action') == 'edit') { - $groups = Mage::getModel('Mage_Core_Model_Store_Group')->getCollection()->addWebsiteFilter($websiteModel->getId())->toOptionArray(); + $groups = Mage::getModel('Mage_Core_Model_Store_Group')->getCollection() + ->addWebsiteFilter($websiteModel->getId())->toOptionArray(); //array_unshift($groups, array('label'=>'', 'value'=>0)); $fieldset->addField('website_default_group_id', 'select', array( 'name' => 'website[default_group_id]', @@ -202,7 +203,8 @@ class Mage_Adminhtml_Block_System_Store_Edit_Form extends Mage_Adminhtml_Block_W )); if (Mage::registry('store_action') == 'edit') { - $stores = Mage::getModel('Mage_Core_Model_Store')->getCollection()->addGroupFilter($groupModel->getId())->toOptionArray(); + $stores = Mage::getModel('Mage_Core_Model_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 +337,8 @@ class Mage_Adminhtml_Block_System_Store_Edit_Form extends Mage_Adminhtml_Block_W $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 ea0293d8b30..20393ceea74 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 b10bd63d73d..8daf2b05ba8 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) */ 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 058d18e3ab2..4e31be80b40 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) */ 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 03b669717fd..bfe37c43b8b 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) */ 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 9f4e7873285..20ab308d32f 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 53fef744685..df71cb899e8 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 54e2b289121..cdb509e268a 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 55158565a34..6ac08491069 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 340231aba35..d381657e1be 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/Assigned/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tag/Assigned/Grid.php index b0a33d8099e..593a9ba853d 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 8648b9c538b..a9704f35c0c 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 db2ce964f2b..ec2203dd2a2 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 b0ba793c231..2e840c7b3bf 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 d1a7469abb9..abf8a4ccffe 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 219ff984233..3f17919d0d9 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 703dcbb6c09..b2b661fa0f9 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 168c9993f53..a0a461fb4d5 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/Pending.php b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Pending.php index 7bf8eafacc0..f2ca70e1530 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/Pending.php b/app/code/core/Mage/Adminhtml/Block/Tag/Pending.php index 1df8209170e..346f6218838 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 b40fa79ea2b..46b50f966cc 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 caaca3fa21b..b40c6ed554c 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 0edafe30496..975c049c384 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 7dbc36ce80d..f174dce123b 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/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Grid.php index 964103de94a..16fed2f1482 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 5dc047068ea..922aa393d83 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 4ecde13d8cc..68471b20b58 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 2260c733d2e..647900de26b 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 2a58e8adff0..61b72885fc7 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 49f01b60787..c363a752b72 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 @@ class Mage_Adminhtml_Block_Tax_Rate_Form extends Mage_Adminhtml_Block_Widget_For 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Range From'), 'value' => $rateObject->getZipFrom(), 'required' => true, + 'maxlength' => 9, 'class' => 'validate-digits' ) ); @@ -168,6 +169,7 @@ class Mage_Adminhtml_Block_Tax_Rate_Form extends Mage_Adminhtml_Block_Widget_For 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('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 56881f99d2f..f36a16eadce 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 b114afc8d02..efda945e45e 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 53563b70adc..2523b38f294 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 8a7ce77a22e..d0a2d48898e 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 b3159a52f35..983b82e8eeb 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 eb1dd23bf13..783e0d303f9 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 816a8c00e21..f8d382bc131 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 3e7fbe58ff0..e318311bfc5 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 9bed46d7947..10b6c1d8fe7 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 53860ec5916..11402c15de5 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 97eb916c082..9fb12c24b7d 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 c0d99f87c0d..1f80a2b2827 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 1a778332e46..0f10f814cb8 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 59241283bb9..80dd06a882a 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 18af1c211f2..6e7d3c28d18 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 5a0e83e5092..abc007a3b42 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 f400b556d88..62f39cc0401 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 39eb70cff23..2b51a48ef09 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) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php index 4c9da4ac78b..cf23382565e 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 372acc6c25a..faac783c5f9 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 94547f47b88..0f74b58b84a 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 d65368ba855..30af91a9ac9 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 0b15d63829b..48620bdea8d 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 9da7cc44fa3..64419881e05 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 bd74b6e2d8c..e694b938f34 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 a426379b8a2..e2c5e158a98 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 702616bb8d2..5148dbeb75f 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) */ @@ -63,7 +63,7 @@ class Mage_Adminhtml_Block_Widget_Button extends Mage_Adminhtml_Block_Widget . ' style="'.$this->getStyle() .'"' . ($this->getValue()?' value="'.$this->getValue() . '"':'') . ($this->getDisabled() ? ' disabled="disabled"' : '') - . '><span>' .$this->getLabel().'</span></button>'.$this->getAfterHtml(); + . '><span><span><span>' .$this->getLabel().'</span></span></span></button>'.$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 c11cab81610..52f927125ed 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 30ff2459f74..cfa68500e81 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) */ @@ -189,11 +189,10 @@ class Mage_Adminhtml_Block_Widget_Form extends Mage_Adminhtml_Block_Widget $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( - 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 dcc4f29f4bb..e02832dbbca 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 63cc4fe4d5e..eedbbe6316e 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 f7cebf0ed1d..2bfe984de68 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 @@ class Mage_Adminhtml_Block_Widget_Form_Element_Dependence extends Mage_Adminhtml /** * 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 @@ class Mage_Adminhtml_Block_Widget_Form_Element_Dependence extends Mage_Adminhtml */ 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 db673c9a1bf..434c123c118 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 1cceb8e2572..7883424759e 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 052538072b4..e32cd21ccaf 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 23ed3ffe460..07a3d4aa3cd 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) */ @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -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; @@ -50,4 +51,4 @@ class Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element extends Mage_Ad $this->_element = $element; return $this->toHtml(); } -} \ No newline at end of file +} diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php index ee51257a667..eeb36359424 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 * @@ -543,8 +550,8 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget 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() @@ -589,11 +596,12 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget $columnId = 'massaction'; $massactionColumn = $this->getLayout()->createBlock('Mage_Adminhtml_Block_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()) { @@ -1262,7 +1270,7 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget } /** - * Retrive massaction row identifier field + * Retrieve massaction row identifier field * * @return string */ @@ -1283,6 +1291,28 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget 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/Column.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php index eefc5b82d9c..5683600eda4 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 bb447d990a8..0e3015813d9 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 66becacbc87..448d5c6032d 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 d9efe38ce3c..ed5d7b808bc 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 f22ea97bbfd..a41f5680077 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 95fd4bc79a1..66275f4db38 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 b50aaed12bf..3458a3f62d1 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 ee80e33778a..5b25af02bc4 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 4201689a44a..951b56b4d47 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 066b9dfa7e5..a2c3106ceae 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 fef6047733d..4d90615ada2 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 656080838e1..1b54ddc9e8b 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 bdb6f9d7a94..641b01599a4 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) */ 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 705fd08f226..533d326fa4a 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 d9da6f8abb1..5489b48aba9 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 37b6cf692f9..be35373185c 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) */ 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 cb87475d7ef..732c9e3f1d7 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) */ 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 49422240ce4..81a4ada485c 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) */ 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 09c0114ae03..bb1dae1bd08 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) */ 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 46ecb86d098..3f76302ef91 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,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @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/Currency.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php index 49908ee95e3..f27ec269e4b 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) */ 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 1a465781b29..9e4a6a8286e 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) */ 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 a661960d4ca..863c0731fc0 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) */ 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 c4883f6d7cd..395ecaf20e3 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) */ 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 73c218b846b..baaa488a313 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) */ 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 4c94be98a64..d24a31938a7 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,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @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/Longtext.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Longtext.php index 71102ba8eb1..ae76e300998 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) */ 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 2fe160f04e4..ea9f3c65316 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) */ 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 829d655bdc4..5fd161105df 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) */ 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 815a9d28c63..6c0238bcdc2 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) */ 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 a01bbd51bed..c647cf71ccc 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) */ 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 82ac6e7ead1..f7a17e77a23 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) */ 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 f8337e3d576..f63c5dcd394 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) */ 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 314011fd352..21e53e8e78b 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) */ 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 ea4808aabae..691bf7416c2 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) */ 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 0eaaa1765ef..ce991d3739b 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) */ 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 4f6f5a66f5b..c91d4cf4f73 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 ff8b246b071..51a2db9cb46 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 15cc44447af..ae845927376 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 <core@magentocommerce.com> @@ -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 @@ abstract class Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract extends Mage if($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) { $selected = explode(',', $selected); return join(',', $selected); -// return Mage::helper('Mage_Core_Helper_Data')->jsonEncode($selected); } else { return ''; -// return '[]'; } } @@ -221,13 +224,14 @@ abstract class Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract extends Mage 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 @@ abstract class Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract extends Mage if(!empty($gridIds)) { return join(",", $gridIds); - //return Mage::helper('Mage_Core_Helper_Data')->jsonEncode($gridIds); } return ''; - //return '[]'; } public function getHtmlId() @@ -288,4 +290,3 @@ abstract class Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract extends Mage 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 494054c8415..7a640229621 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 e6042f8bf8e..f6a27990c44 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 d07a8dd253f..222c39f82cc 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 b085660a421..9de0d775db8 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 a11b346b7b9..716b4173a1d 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 d02f84d2601..2597095aaca 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/View/Container.php b/app/code/core/Mage/Adminhtml/Block/Widget/View/Container.php index 0c4072f1313..e20f5d74d75 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 efbfd9c351c..e6e3d2cbc03 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) */ 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 00000000000..adcebaf55cc --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php @@ -0,0 +1,124 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Admin abstract reports controller + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Admin_Model_Session'); + } + return $this->_adminSession; + } + + /** + * Add report breadcrumbs + * + * @return Mage_Adminhtml_Controller_Report_Abstract + */ + public function _initAction() + { + $this->loadLayout() + ->_addBreadcrumb(Mage::helper('Mage_Reports_Helper_Data')->__('Reports'), Mage::helper('Mage_Reports_Helper_Data')->__('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('Mage_Adminhtml_Helper_Data')->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('Mage_Reports_Model_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('Mage_Adminhtml_Model_Session')->addNotice(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Last updated: %s. To refresh last day\'s <a href="%s">statistics</a>, click <a href="%s">here</a>.', $updatedAt, $refreshStatsLink, $directRefreshLink)); + return $this; + } +} diff --git a/app/code/core/Mage/Adminhtml/Controller/Sales/Creditmemo.php b/app/code/core/Mage/Adminhtml/Controller/Sales/Creditmemo.php index a3db9bac1b0..4765143f443 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 5b899ba9b74..5f713086ece 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 9683ec828ad..c64b21fd1ee 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 aec29c1ea29..62a57f0379d 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 6ccfb65b639..bd9225aebf4 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 9ae0bc4854d..2fd481c7114 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 9c16f029078..688e9e244f2 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 745a8553cf5..3bcbb4241e5 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 7b851d3e7a4..66c59d0e405 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 d395d20a498..6119ac7c2a2 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 096cba611cd..bb19399e097 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 0fa97d28d11..3792f5ee02d 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 e3ddc85c746..9b30e7f8e62 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 9e274513c13..523da5baca4 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 <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ 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 90291d8e846..572ce277439 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 120aaf12821..4e639d046fe 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 8a55f0636b1..9517f4b7001 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 50c7afc4ec8..01b8cb121e4 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 @@ class Mage_Adminhtml_Model_Config_Data extends Varien_Object $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 6488fe75ac8..d8976ffd318 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 4b05d4d6c37..2d0cdbfcf48 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 a17ada6516c..e791ee74790 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 f53e8c78ea7..627c10c5a37 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 deec68f06b6..2e10b422a51 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 06aef2f20b2..b679b993c95 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 276dc2ab73a..099aa335fcd 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 8bd77568132..44b86db696f 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 296cd74bf87..9b1013bcd0f 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) */ @@ -71,9 +71,7 @@ class Mage_Adminhtml_Model_Sales_Order foreach ($order->getAllItems() as $item) { if (!$productCollection->getItemById($item->getProductId())) { $this->_getSession()->addError( - Mage::helper('Mage_Adminhtml_Helper_Data')->__('The item %s (SKU %s) does not exist in the catalog anymore.', - $item->getName(), - $item->getSku() + Mage::helper('Mage_Adminhtml_Helper_Data')->__('The item %s (SKU %s) does not exist in the catalog anymore.', $item->getName(), $item->getSku() )); $hasBadItems = true; } @@ -87,4 +85,3 @@ class Mage_Adminhtml_Model_Sales_Order } } - 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 92bf730c98d..26dc8d39a48 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 <core@magentocommerce.com> */ -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('Mage_Adminhtml_Model_Session_Quote'); @@ -233,7 +240,22 @@ class Mage_Adminhtml_Model_Sales_Order_Create extends Varien_Object */ 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; } /** @@ -633,6 +655,9 @@ class Mage_Adminhtml_Model_Sales_Order_Create extends Varien_Object $this->removeItem($itemId, $from); } } + if (isset($data['empty_customer_cart']) && (int)$data['empty_customer_cart'] == 1) { + $this->getCustomerCart()->removeAllItems()->collectTotals()->save(); + } return $this; } 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 99c7a104837..4ce4b49c867 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 2f58b22b4c1..f9d7d9bb7d0 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 b06896883f1..a860a55c4cb 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 eb93779a7a4..77a33e85018 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 401136d2394..7ebb30e7ad8 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 d8bf31246f2..8ff13b2d3f5 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 57a4a5fee56..e7abd834904 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) */ 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 5c02fa82b4b..e1475539175 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 5b033370680..6060269ae0b 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 c0b48d180a5..42c3fc4a1b8 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) */ 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 1f23c85a2c1..6c3523528d4 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) */ 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 5b5040bd18b..bcdcc7e0b4e 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 1318d6b05fe..e422d45a384 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 5186d288fe0..8d3df8a603e 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 6a3204fc5f4..f9f6af5e63d 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 1e1f57a984a..d54f4121f98 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 ecb19cc3e26..92c220973c3 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 0b43edb3aff..80ac66c3b43 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 25c14e4b3bf..c8e8deabf3d 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 8456d0d9554..d244be362bf 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 71a9ed14a24..dcbac27fd83 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 07e3105efd4..3c315bbe064 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 54af420d708..25200d6ab9e 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 9a47c77fdc1..b14d0f5d931 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 new file mode 100644 index 00000000000..06eaed74281 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.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_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Auto-assign customer group Model + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Core_Helper_Data')->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 c64ddee4d11..3e3ead27555 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) */ 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 e5b2cabb2bd..a549a002efb 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 dc7488f9a29..83d5b132fda 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 42430935f1c..7c472a0b7ab 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 21c08ca4b0e..a1648d1c033 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/Email/Address.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Address.php index 65548f8fcc9..80a458feccb 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/Sender.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Sender.php index fb58b920526..56d87bd5719 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 f7a08ca013b..14a1129a27f 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 44642951370..bf8c5bee0e2 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,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.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/Filename.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php index 95a11f853ab..83a0c76ccb5 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 ad148be31cd..02c402377c3 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 dfa5d057e51..89894e871d6 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) */ 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 f393bd4d2a2..575dffbb0c8 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/Locale.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php index aeefd0d8e05..30a0c8061a6 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) */ @@ -48,8 +48,11 @@ class Mage_Adminhtml_Model_System_Config_Backend_Locale extends Mage_Core_Model_ $values = explode(',', $this->getValue()); $exceptions = array(); + foreach ($collection as $data) { $match = false; + $scopeName = Mage::helper('Mage_Adminhtml_Helper_Data')->__('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 @@ class Mage_Adminhtml_Model_System_Config_Backend_Locale extends Mage_Core_Model_ break; } - $exceptions[] = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Currency "%s" is used as %s in %s.', - $currencyName, - $fieldName, - $scopeName - ); + $exceptions[] = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Currency "%s" is used as %s in %s.', $currencyName, $fieldName, $scopeName); } } } 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 b280ecbe842..048fa75f838 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) */ 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 5ef3d4bcc37..a2e85090949 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 d627818b581..3c22b87e925 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 7061fa7abb0..50a2e1df575 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 a0c513250a7..c3ae44f80d0 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 3012bb38430..64a0632c3f7 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 26c60859f03..3355f1776c6 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 83f8d185952..df16b1a1e3a 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 feb9065fe9e..91fe5ff23f2 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 6eb50a972f8..dc7c042260f 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 b3674526433..793f0cc96d2 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 c20160b0bb4..877d20f2b7a 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 f4d51d76687..95ed09a1f58 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 c01da5d67c8..f92dd2d7ba4 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 7c69ef9161a..e19c2ea81e5 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 47b52a07f1c..fadd44c9a53 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) */ 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 449d9301f64..bf12e42c5b1 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 05bc9fd390f..c99eb155663 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 c0f151116bc..7caeb03bd5d 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 d2937baa09e..bf66a4285a6 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 35b74e5b62b..cdc3000b295 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 833277380e0..594837eeb4b 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 8df61bbecf0..0769b1d537a 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 cf0d386bd12..20494281f94 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 e045b3503b8..2408f979b09 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 88045ca2ace..107c8986834 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 5129e7b527a..4e18f373a30 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 7ac4be48931..538f7ad8005 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 f2b8048d935..f1e4a7be5f3 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 e14c92cc494..432b30ad75b 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 b24ed935a92..44d0862e437 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 bb2b913d8be..b15df5aac2b 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 00000000000..f37e323ad3f --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Address/Type.php @@ -0,0 +1,48 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Source model of customer address types + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Adminhtml_Helper_Data')->__('Billing Address'), + Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING => Mage::helper('Mage_Adminhtml_Helper_Data')->__('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 46f829933d4..c67aa416a64 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 00000000000..0b168734c1b --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group/Multiselect.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_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +class Mage_Adminhtml_Model_System_Config_Source_Customer_Group_Multiselect +{ + /** + * Customer groups options array + * + * @var null|array + */ + protected $_options; + + /** + * Retrieve customer groups as array + * + * @return array + */ + public function toOptionArray() + { + if (!$this->_options) { + $this->_options = Mage::getResourceModel('Mage_Customer_Model_Resource_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 b4d62ce4288..b0d9bee836d 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 04b993ddcd3..dba7cb508ec 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 11090da9b51..2b63840fac3 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 1109dec13e2..e9ce071f07a 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,18 +20,17 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 { public function toOptionArray() { - $hlp = Mage::helper('Mage_Adminhtml_Helper_Data'); 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('Mage_Adminhtml_Helper_Data')->__('Always (during development)')), + array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_ONCE, 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Only Once (version upgrade)')), + array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_NEVER, 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Never (production)')), ); } 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 94848aa1f90..1882c960145 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 57eac63173e..b877438992f 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 a806cad68ee..4918cbe6c2b 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 f5c0eea54ab..442bd95f492 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 6f766f806bf..160978f1be9 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 2b174aa591f..ecdd2004b74 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/Locale.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale.php index e892ba8f619..f2d2ab830c0 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 ac26271a5d1..cb509591d26 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 0635ed83396..ab5b2dfadfe 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 e346ec59111..ff1a617b394 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 0e409f7f9f8..9a319c11346 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 66d041f336b..d5905b739b8 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 6aca0a43557..9ad6c4d5f9a 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 6ea6a559877..6811eb8d969 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 55a42316c7b..0fa4aa56617 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 d18071c8c1c..4f87b182f37 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 7a51d1c77cb..7a71d272de4 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 76852c533f7..42892359248 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 8c59feadea6..350f10a4e4d 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 d321d0234f4..ad11e10bf7b 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 9173aafeec6..4fc42b8451e 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 3d2a3a5c32c..a23ba7937f1 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 72b6573f192..c171c71a3c5 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 1522bde835b..1b569153398 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) */ 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 e1256e06d94..ae3a07fc5de 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 69d2bf44d3a..9563ca278e7 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 @@ class Mage_Adminhtml_Model_System_Config_Source_Product_Options_Type array('value' => '', 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('-- Please select --')) ); + $helper = Mage::helper('Mage_Catalog_Helper_Data'); + 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 @@ class Mage_Adminhtml_Model_System_Config_Source_Product_Options_Type $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 97c24d8f696..8e22dbf982a 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 5f03696f04a..2654b32fdbe 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 0fd6a7e6af0..81bf95798b6 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/Allspecificcountries.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allspecificcountries.php index 3e19f9ebe75..5c3b9728a87 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 c1c352119e9..c16ec105968 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 c399fd08b47..c0a039be5e5 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 a6f7beee6fa..649085ff44c 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 81e39b8989d..c2670add3d8 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 810e217f4e0..75d7a2750c0 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 53280ce3519..f847b9651e9 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 ba4520305b6..327166b01da 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 e29597965d3..2a6f595d8d1 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 891655c603e..48c735ea4d8 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 9d5dd6c2017..43e15984d57 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 597c9a61031..a647f6d60db 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 5f340701768..a18dc4c7c7d 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 d3c30777f66..1cd91b35bff 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 1a7701829d1..3b2d6026e99 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 921d976d5db..5144aed6def 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 e41c7263b6f..ac4bf40ae55 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) */ @@ -488,7 +488,7 @@ class Mage_Adminhtml_Model_System_Store extends Varien_Object 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/Model/Url.php b/app/code/core/Mage/Adminhtml/Model/Url.php index b6f4c52c7a5..01b9fe6b8f3 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 6556682fda2..fa1ac333fae 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 4d1c6e339e4..183f9d4f574 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 e6fc444f908..faffad63918 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 e696bedb675..f15798160ab 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 800dc53079f..6c379bd7c27 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 d12527f8769..8a826f78195 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 @@ class Mage_Adminhtml_Catalog_CategoryController extends Mage_Adminhtml_Controlle ->setLastEditedCategory($category->getId()); // $this->_initLayoutMessages('Mage_Adminhtml_Model_Session'); $this->loadLayout(); - $this->getResponse()->setBody(Mage::helper('Mage_Core_Helper_Data')->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('Mage_Core_Helper_Data')->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 8152355a71a..4d7366bace4 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) */ @@ -159,8 +159,7 @@ class Mage_Adminhtml_Catalog_Product_Action_AttributeController extends Mage_Adm } $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 f931ee02454..3db2d854392 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) */ @@ -185,7 +185,8 @@ class Mage_Adminhtml_Catalog_Product_AttributeController extends Mage_Adminhtml_ $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('Mage_Catalog_Helper_Data')->__('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/Product/DatafeedsController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/DatafeedsController.php index 6168cc499c3..178df4f1390 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 bebc327ebc5..8aa70f916ad 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 @@ class Mage_Adminhtml_Catalog_Product_GalleryController extends Mage_Adminhtml_Co Mage::getSingleton('Mage_Catalog_Model_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 aabfb08c6f2..2dd43295ea2 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 d2089a0e397..29c540a5d07 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) */ 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 2e8e7bc61c1..939a9316d61 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 20dd441e93f..322d2a54bb3 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 a9c04062b85..a305ce08b92 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) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php index eb1acc6bce4..26a3a8bcc49 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) */ @@ -178,9 +178,7 @@ class Mage_Adminhtml_Catalog_SearchController extends Mage_Adminhtml_Controller_ $model->delete(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were deleted', count($searchIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were deleted', count($searchIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_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 bd1b2cf6454..584997bdd10 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) */ @@ -54,11 +54,13 @@ class Mage_Adminhtml_Checkout_AgreementController extends Mage_Adminhtml_Control $id = $this->getRequest()->getParam('id'); $agreementModel = Mage::getModel('Mage_Checkout_Model_Agreement'); - $hlp = Mage::helper('Mage_Checkout_Helper_Data'); + if ($id) { $agreementModel->load($id); if (!$agreementModel->getId()) { - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($hlp->__('This condition no longer exists.')); + Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError( + Mage::helper('Mage_Checkout_Helper_Data')->__('This condition no longer exists.') + ); $this->_redirect('*/*/'); return; } @@ -74,7 +76,12 @@ class Mage_Adminhtml_Checkout_AgreementController extends Mage_Adminhtml_Control 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('Mage_Checkout_Helper_Data')->__('Edit Condition') + : Mage::helper('Mage_Checkout_Helper_Data')->__('New Condition'), + $id ? Mage::helper('Mage_Checkout_Helper_Data')->__('Edit Condition') + : Mage::helper('Mage_Checkout_Helper_Data')->__('New Condition') + ) ->_addContent( $this->getLayout() ->createBlock('Mage_Adminhtml_Block_Checkout_Agreement_Edit') 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 b4f1356aa82..d5133d5fb89 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 f62c7cfba06..ae7bfc9eec6 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 16cf4a07cdf..4980db54ee5 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 8f738ca13b4..ae5f9cc32cc 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 60b139f5b42..5b1bf2d3c0a 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 f3381bfc165..caf3e505e00 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 1eede469659..3c7eadc7c34 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/GroupController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php index 6823962aa55..0d48c0a2a22 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 b375799915c..e08ec599a01 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 new file mode 100644 index 00000000000..7d8d7831049 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php @@ -0,0 +1,91 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * VAT validation controller + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Customer_Helper_Data')->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('Mage_Core_Helper_Data'); + + $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('Mage_Customer_Helper_Data')->getCustomerGroupIdBasedOnVatNumber( + $this->getRequest()->getParam('country'), $result, $storeId + ); + + $body = $coreHelper->jsonEncode(array( + 'valid' => $valid, + 'group' => $groupId, + 'success' => $success + )); + $this->getResponse()->setBody($body); + } +} 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 7c8b79fb8db..86822d08579 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 618f62885bb..df2e4801712 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) */ @@ -86,7 +86,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action public function gridAction() { $this->loadLayout(); - $this->getResponse()->setBody($this->getLayout()->createBlock('Mage_Adminhtml_Block_Customer_Grid')->toHtml()); + $this->renderLayout(); } /** @@ -186,21 +186,27 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action { $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('Mage_Customer_Model_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,27 +218,36 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $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('Mage_Customer_Model_Form'); $addressForm->setFormCode('adminhtml_customer_address')->ignoreInvisible(false); foreach (array_keys($data['address']) as $index) { $address = $customer->getAddressItemById($index); if (!$address) { - $address = Mage::getModel('Mage_Customer_Model_Address'); + $address = Mage::getModel('Mage_Customer_Model_Address'); } $requestScope = sprintf('address/%s', $index); $formData = $addressForm->setEntity($address) ->extractData($this->getRequest(), $requestScope); - $errors = $addressForm->validateData($formData); + + // 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) { foreach ($errors as $error) { $this->_getSession()->addError($error); @@ -257,7 +272,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action } } - // default billing and shipping + // Default billing and shipping if (isset($data['account']['default_billing'])) { $customer->setData('default_billing', $data['account']['default_billing']); } @@ -268,7 +283,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $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); @@ -286,7 +301,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $isNewCustomer = $customer->isObjectNew(); try { $sendPassToEmail = false; - // force new customer active + // Force new customer confirmation if ($isNewCustomer) { $customer->setPassword($data['account']['password']); $customer->setForceConfirmed(true); @@ -303,14 +318,13 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $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); } } @@ -334,8 +348,8 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action if ($redirectBack) { $this->_redirect('*/*/edit', array( - 'id' => $customer->getId(), - '_current'=>true + 'id' => $customer->getId(), + '_current' => true )); return; } @@ -409,8 +423,8 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action ->loadByCustomer(Mage::registry('current_customer')); Mage::register('subscriber', $subscriber); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter_Grid')->toHtml()); + $this->loadLayout() + ->renderLayout(); } public function wishlistAction() @@ -470,10 +484,9 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action } } - $this->getResponse()->setBody( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_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(); } /** @@ -534,11 +547,11 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action public function tagGridAction() { $this->_initCustomer(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_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() @@ -639,9 +652,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $customer->save(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were updated.', count($customersIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were updated.', count($customersIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); @@ -663,9 +674,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $customer->save(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were updated.', count($customersIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were updated.', count($customersIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); @@ -689,9 +698,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action ->delete(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were deleted.', count($customersIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were deleted.', count($customersIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); @@ -714,9 +721,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $customer->save(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were updated.', count($customersIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were updated.', count($customersIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_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 b08448c4fdf..1c19a6bd568 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 e269689391f..043f37dea93 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) */ @@ -76,14 +76,10 @@ class Mage_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action 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('admin/login', $data); + $this->loadLayout(); + $this->renderLayout(); } /** @@ -217,40 +213,36 @@ class Mage_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action if (!empty($email) && !empty($params)) { // Validate received data to be an email address - if (!Zend_Validate::is($email, 'EmailAddress')) { - $this->_getSession()->addError($this->__('Invalid email address.')); - $this->_outTemplate('forgotpassword'); - return; - } - $collection = Mage::getResourceModel('Mage_Admin_Model_Resource_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('Mage_Admin_Model_User')->load($item->getId()); - if ($user->getId()) { - $newResetPasswordLinkToken = Mage::helper('Mage_Admin_Helper_Data')->generateResetPasswordLinkToken(); - $user->changeResetPasswordLinkToken($newResetPasswordLinkToken); - $user->save(); - $user->sendPasswordResetConfirmationEmail(); + if (Zend_Validate::is($email, 'EmailAddress')) { + $collection = Mage::getResourceModel('Mage_Admin_Model_Resource_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('Mage_Admin_Model_User')->load($item->getId()); + if ($user->getId()) { + $newResetPasswordLinkToken = Mage::helper('Mage_Admin_Helper_Data')->generateResetPasswordLinkToken(); + $user->changeResetPasswordLinkToken($newResetPasswordLinkToken); + $user->save(); + $user->sendPasswordResetConfirmationEmail(); + } + break; } - break; } + $this->_getSession() + ->addSuccess(Mage::helper('Mage_Adminhtml_Helper_Data')->__('If there is an account associated with %s you will receive an email with a link to reset your password.', Mage::helper('Mage_Adminhtml_Helper_Data')->escapeHtml($email))); + $this->_redirect('*/*/login'); + return; + } else { + $this->_getSession()->addError($this->__('Invalid email address.')); } - $this->_getSession() - ->addSuccess(Mage::helper('Mage_Adminhtml_Helper_Data')->__('If there is an account associated with %s you will receive an email with a link to reset your password.', Mage::helper('Mage_Adminhtml_Helper_Data')->escapeHtml($email))); - $this->_redirect('*/*/login'); - return; } elseif (!empty($params)) { $this->_getSession()->addError(Mage::helper('Mage_Adminhtml_Helper_Data')->__('The email address is empty.')); } - - $data = array( - 'email' => $email - ); - $this->_outTemplate('admin/forgotpassword', $data); + $this->loadLayout(); + $this->renderLayout(); } /** diff --git a/app/code/core/Mage/Adminhtml/controllers/JsonController.php b/app/code/core/Mage/Adminhtml/controllers/JsonController.php index 63441b834b9..a6c9216e69f 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 ed99b068485..b1845ab1dff 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 4f20ef9921e..f635125d6fb 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 058db895ee0..c558026b1ff 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 a5eb1aca82d..3fbd4f20ed7 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 9a5538c87b3..8036960e43b 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) */ @@ -102,9 +102,7 @@ class Mage_Adminhtml_Newsletter_SubscriberController extends Mage_Adminhtml_Cont $subscriber->unsubscribe(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were updated', count($subscribersIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were updated', count($subscribersIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); @@ -127,9 +125,7 @@ class Mage_Adminhtml_Newsletter_SubscriberController extends Mage_Adminhtml_Cont $subscriber->delete(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were deleted', count($subscribersIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were deleted', count($subscribersIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); diff --git a/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php b/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php index 337864afac6..497702674b0 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 f4bb81de633..9b697988e14 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 99a505f282c..564499ad955 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) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php index cffcb101a8d..b79561ad5cc 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 diff --git a/app/code/core/Mage/Adminhtml/controllers/Poll/AnswerController.php b/app/code/core/Mage/Adminhtml/controllers/Poll/AnswerController.php index bd614f58d13..9157e592b39 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 39705e9aafd..73cddfeed8a 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 65467c83905..64b48457531 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) */ @@ -137,11 +137,10 @@ class Mage_Adminhtml_Promo_CatalogController extends Mage_Adminhtml_Controller_A $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); @@ -277,17 +276,15 @@ class Mage_Adminhtml_Promo_CatalogController extends Mage_Adminhtml_Controller_A */ public function applyRulesAction() { + $errorMessage = Mage::helper('Mage_CatalogRule_Helper_Data')->__('Unable to apply rules.'); try { Mage::getModel('Mage_CatalogRule_Model_Rule')->applyAll(); Mage::app()->removeCache('catalog_rules_dirty'); - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_CatalogRule_Helper_Data')->__('The rules have been applied.') - ); + $this->_getSession()->addSuccess(Mage::helper('Mage_CatalogRule_Helper_Data')->__('The rules have been applied.')); + } catch (Mage_Core_Exception $e) { + $this->_getSession()->addError($errorMessage . ' ' . $e->getMessage()); } catch (Exception $e) { - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError( - Mage::helper('Mage_CatalogRule_Helper_Data')->__('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 a117e62f947..7de8f01ed9f 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) */ @@ -32,9 +32,14 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act $this->_title($this->__('Promotions'))->_title($this->__('Shopping Cart Price Rules')); Mage::register('current_promo_quote_rule', Mage::getModel('Mage_SalesRule_Model_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,21 +115,12 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act { if ($this->getRequest()->getPost()) { try { + /** @var $model Mage_SalesRule_Model_Rule */ $model = Mage::getModel('Mage_SalesRule_Model_Rule'); Mage::dispatchEvent( '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('Mage_Adminhtml_Helper_Data'); - $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) { @@ -159,6 +155,9 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act unset($data['rule']); $model->loadPost($data); + $useAutoGeneration = (int)!empty($data['use_auto_generation']); + $model->setUseAutoGeneration($useAutoGeneration); + $session->setPageData($model->getData()); $model->save(); @@ -172,12 +171,20 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act 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('Mage_CatalogRule_Helper_Data')->__('An error occurred while saving the rule data. Please review the log and try again.')); Mage::logException($e); Mage::getSingleton('Mage_Adminhtml_Model_Session')->setPageData($data); - $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('rule_id'))); + $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('rule_id'))); return; } } @@ -264,6 +271,128 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act $this->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('Mage_Adminhtml_Block_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('Mage_Adminhtml_Block_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('Mage_SalesRule_Model_Resource_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('Mage_SalesRule_Helper_Data')->__('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('Mage_SalesRule_Helper_Data')->__('Not valid data provided'); + } else { + $generator->setData($data); + $generator->generatePool(); + $generated = $generator->getGeneratedCount(); + $this->_getSession()->addSuccess(Mage::helper('Mage_SalesRule_Helper_Data')->__('%s Coupon(s) generated successfully', $generated)); + $this->_initLayoutMessages('Mage_Adminhtml_Model_Session'); + $result['messages'] = $this->getLayout()->getMessagesBlock()->getGroupedHtml(); + } + } catch (Mage_Core_Exception $e) { + $result['error'] = $e->getMessage(); + } catch (Exception $e) { + $result['error'] = Mage::helper('Mage_SalesRule_Helper_Data')->__('An error occurred while generating coupons. Please review the log and try again.'); + Mage::logException($e); + } + } + $this->getResponse()->setBody(Mage::helper('Mage_Core_Helper_Data')->jsonEncode($result)); + } + /** * Chooser source action */ @@ -276,6 +405,10 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act $this->getResponse()->setBody($chooserBlock->toHtml()); } + /** + * Returns result of current user permission check on resource and privilege + * @return boolean + */ protected function _isAllowed() { return Mage::getSingleton('Mage_Admin_Model_Session')->isAllowed('promo/quote'); diff --git a/app/code/core/Mage/Adminhtml/controllers/Promo/WidgetController.php b/app/code/core/Mage/Adminhtml/controllers/Promo/WidgetController.php index 2d704b6db0b..3ab0ee97318 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 cc1d5174b91..5182793342d 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 5d4747d9d4f..44691f3b52d 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) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/CustomerController.php b/app/code/core/Mage/Adminhtml/controllers/Report/CustomerController.php index d9ff764ae91..20438ca5d36 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 a7bd792c400..394d43ab12f 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) */ @@ -32,21 +32,17 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -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('Mage_Reports_Helper_Data')->__('Reports'), Mage::helper('Mage_Reports_Helper_Data')->__('Reports')) - ->_addBreadcrumb(Mage::helper('Mage_Reports_Helper_Data')->__('Products'), Mage::helper('Mage_Reports_Helper_Data')->__('Products')); + parent::_initAction(); + $this->_addBreadcrumb(Mage::helper('Mage_Reports_Helper_Data')->__('Products'), Mage::helper('Mage_Reports_Helper_Data')->__('Products')); return $this; } @@ -101,15 +97,23 @@ class Mage_Adminhtml_Report_ProductController extends Mage_Adminhtml_Controller_ */ 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('Mage_Reports_Helper_Data')->__('Most Viewed'), Mage::helper('Mage_Reports_Helper_Data')->__('Most Viewed')) - ->_addContent($this->getLayout()->createBlock('Mage_Adminhtml_Block_Report_Product_Viewed')) - ->renderLayout(); + ->_setActiveMenu('report/products/viewed') + ->_addBreadcrumb(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Products Most Viewed Report'), Mage::helper('Mage_Adminhtml_Helper_Data')->__('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(); } /** @@ -119,10 +123,9 @@ class Mage_Adminhtml_Report_ProductController extends Mage_Adminhtml_Controller_ public function exportViewedCsvAction() { $fileName = 'products_mostviewed.csv'; - $content = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Report_Product_Viewed_Grid') - ->getCsv(); - - $this->_prepareDownloadResponse($fileName, $content); + $grid = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Report_Product_Viewed_Grid'); + $this->_initReportAction($grid); + $this->_prepareDownloadResponse($fileName, $grid->getCsvFile()); } /** @@ -132,10 +135,9 @@ class Mage_Adminhtml_Report_ProductController extends Mage_Adminhtml_Controller_ public function exportViewedExcelAction() { $fileName = 'products_mostviewed.xml'; - $content = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Report_Product_Viewed_Grid') - ->getExcel($fileName); - - $this->_prepareDownloadResponse($fileName, $content); + $grid = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Report_Product_Viewed_Grid'); + $this->_initReportAction($grid); + $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); } /** diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/ReviewController.php b/app/code/core/Mage/Adminhtml/controllers/Report/ReviewController.php index 3494c5cb9d5..0bd28bf18cc 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 6b21f87f440..0b2b0f0e41f 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) */ @@ -29,49 +29,19 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ -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('Mage_Reports_Helper_Data')->__('Reports'), Mage::helper('Mage_Reports_Helper_Data')->__('Reports')) - ->_addBreadcrumb(Mage::helper('Mage_Reports_Helper_Data')->__('Sales'), Mage::helper('Mage_Reports_Helper_Data')->__('Sales')); - return $this; - } - - public function _initReportAction($blocks) - { - if (!is_array($blocks)) { - $blocks = array($blocks); - } - - $requestData = Mage::helper('Mage_Adminhtml_Helper_Data')->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('Mage_Reports_Helper_Data')->__('Sales'), Mage::helper('Mage_Reports_Helper_Data')->__('Sales')); return $this; } @@ -103,7 +73,7 @@ class Mage_Adminhtml_Report_SalesController extends Mage_Adminhtml_Controller_Ac $this->_showLastExecutionTime(Mage_Reports_Model_Flag::REPORT_BESTSELLERS_FLAG_CODE, 'bestsellers'); $this->_initAction() - ->_setActiveMenu('report/sales/bestsellers') + ->_setActiveMenu('report/products/bestsellers') ->_addBreadcrumb(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Products Bestsellers Report'), Mage::helper('Mage_Adminhtml_Helper_Data')->__('Products Bestsellers Report')); $gridBlock = $this->getLayout()->getBlock('report_sales_bestsellers.grid'); @@ -139,22 +109,6 @@ class Mage_Adminhtml_Report_SalesController extends Mage_Adminhtml_Controller_Ac $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); } - protected function _showLastExecutionTime($flagCode, $refreshCode) - { - $flag = Mage::getModel('Mage_Reports_Model_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('Mage_Adminhtml_Model_Session')->addNotice(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Last updated: %s. To refresh last day\'s <a href="%s">statistics</a>, click <a href="%s">here</a>.', $updatedAt, $refreshStatsLink, $directRefreshLink)); - return $this; - } - /** * Refresh statistics for last 25 hours * @@ -449,17 +403,4 @@ class Mage_Adminhtml_Report_SalesController extends Mage_Adminhtml_Controller_Ac break; } } - - /** - * Retrieve admin session model - * - * @return Mage_Admin_Model_Session - */ - protected function _getSession() - { - if (is_null($this->_adminSession)) { - $this->_adminSession = Mage::getSingleton('Mage_Admin_Model_Session'); - } - return $this->_adminSession; - } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/ShopcartController.php b/app/code/core/Mage/Adminhtml/controllers/Report/ShopcartController.php index 7c9e049840a..0240fd481f4 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 927b1099841..87414581338 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) */ @@ -99,13 +99,14 @@ class Mage_Adminhtml_Report_StatisticsController extends Mage_Adminhtml_Controll } $aliases = array( - 'sales' => 'Mage_Sales_Model_Resource_Report_Order', - 'tax' => 'Mage_Tax_Model_Resource_Report_Tax', - 'shipping' => 'Mage_Sales_Model_Resource_Report_Shipping', - 'invoiced' => 'Mage_Sales_Model_Resource_Report_Invoiced', - 'refunded' => 'Mage_Sales_Model_Resource_Report_Refunded', - 'coupons' => 'Mage_SalesRule_Model_Resource_Report_Rule', + 'sales' => 'Mage_Sales_Model_Resource_Report_Order', + 'tax' => 'Mage_Tax_Model_Resource_Report_Tax', + 'shipping' => 'Mage_Sales_Model_Resource_Report_Shipping', + 'invoiced' => 'Mage_Sales_Model_Resource_Report_Invoiced', + 'refunded' => 'Mage_Sales_Model_Resource_Report_Refunded', + 'coupons' => 'Mage_SalesRule_Model_Resource_Report_Rule', 'bestsellers' => 'Mage_Sales_Model_Resource_Report_Bestsellers', + 'viewed' => 'Mage_Sales_Model_Resource_Report_Product_Viewed', ); $out = array(); foreach ($codes as $code) { diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/TagController.php b/app/code/core/Mage/Adminhtml/controllers/Report/TagController.php index a4a07753c67..5f3afbedfd7 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 215cc14b531..a8d5af09ee3 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 419f924f2c6..b51fe96cba7 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 0339059a059..9760fd1a79d 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 c9c14966fdf..57cca433f10 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 6b815042f3c..75ca991988b 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 1a1f7da7461..acfd358fc7e 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 0aec3763f3c..735aa175636 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) */ @@ -131,6 +131,14 @@ class Mage_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Control */ 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 */ @@ -279,7 +287,8 @@ class Mage_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Control $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.')); } @@ -611,4 +620,14 @@ class Mage_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Control 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 5f7d91b52b2..780d64da8dd 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 fe038cb4c70..be3d5c1c783 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) */ @@ -52,13 +52,21 @@ class Mage_Adminhtml_Sales_Order_EditController extends Mage_Adminhtml_Sales_Ord $orderId = $this->getRequest()->getParam('order_id'); $order = Mage::getModel('Mage_Sales_Model_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('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); + $this->_redirect('*/sales_order/view', array('order_id' => $orderId)); + } catch (Exception $e) { + Mage::getSingleton('Mage_Adminhtml_Model_Session')->addException($e, $e->getMessage()); + $this->_redirect('*/sales_order/view', array('order_id' => $orderId)); } } @@ -74,7 +82,7 @@ class Mage_Adminhtml_Sales_Order_EditController extends Mage_Adminhtml_Sales_Ord ->_setActiveMenu('sales/order') ->renderLayout(); } - + /** * Acl check for admin * @@ -83,5 +91,5 @@ class Mage_Adminhtml_Sales_Order_EditController extends Mage_Adminhtml_Sales_Ord protected function _isAllowed() { return Mage::getSingleton('Mage_Admin_Model_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 274e0bc070c..05278cf0fbf 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 80a659193ed..c7dba1e4292 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) */ @@ -220,9 +220,12 @@ class Mage_Adminhtml_Sales_Order_ShipmentController extends Mage_Adminhtml_Contr $this->_saveShipment($shipment); $shipment->sendEmail(!empty($data['send_email']), $comment); - $this->_getSession()->addSuccess($isNeedCreateLabel ? - $this->__('The shipment has been created. The shipping label has been created.') : - $this->__('The shipment has been created.')); + + $shipmentCreatedMessage = $this->__('The shipment has been created.'); + $labelCreatedMessage = $this->__('The shipping label has been created.'); + + $this->_getSession()->addSuccess($isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage + : $shipmentCreatedMessage); Mage::getSingleton('Mage_Adminhtml_Model_Session')->getCommentText(true); } catch (Mage_Core_Exception $e) { if ($isNeedCreateLabel) { @@ -708,4 +711,4 @@ class Mage_Adminhtml_Sales_Order_ShipmentController extends Mage_Adminhtml_Contr ->toHtml() ); } -} +} \ No newline at end of file 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 0bf610d5230..fded5b638ea 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 23472dda968..b49c257c42b 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 756bf19ee8c..c09b76df946 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) */ @@ -722,10 +722,17 @@ class Mage_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Controller_Act $addressId = $this->getRequest()->getParam('address_id'); $address = Mage::getModel('Mage_Sales_Model_Order_Address') ->getCollection() + ->addFilter('entity_id', $addressId) ->getItemById($addressId); 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 d401fb77ef1..5ef0e55d881 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 1117d13a0a0..0678cbc57ee 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 9316a7fdf5c..e3666be4ac5 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) */ @@ -110,13 +110,15 @@ class Mage_Adminhtml_Sales_TransactionsController extends Mage_Adminhtml_Control ->setOrder($txn->getOrder()) ->importTransactionInfo($txn); $txn->save(); - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess(Mage::helper('Mage_Adminhtml_Helper_Data') - ->__('The transaction details have been updated.')); + Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( + Mage::helper('Mage_Adminhtml_Helper_Data')->__('The transaction details have been updated.') + ); } catch (Mage_Core_Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); } catch (Exception $e) { - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError(Mage::helper('Mage_Adminhtml_Helper_Data') - ->__('Unable to update transaction details.')); + Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError( + Mage::helper('Mage_Adminhtml_Helper_Data')->__('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/SitemapController.php b/app/code/core/Mage/Adminhtml/controllers/SitemapController.php index a58707276c1..be5b6e27eed 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 ee2a8377240..276c05b4576 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 400c5694369..b417c7c9d2b 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 9542b8b1bff..cc173fdad32 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) */ @@ -66,43 +66,105 @@ class Mage_Adminhtml_System_BackupController extends Mage_Adminhtml_Controller_A /** * Create backup action + * + * @return Mage_Adminhtml_Controller_Action */ public function createAction() { + if (!$this->getRequest()->isAjax()) { + return $this->getUrl('*/*/index'); + } + + $response = new Varien_Object(); + + /** + * @var Mage_Backup_Helper_Data $helper + */ + $helper = Mage::helper('Mage_Backup_Helper_Data'); + try { - $backupDb = Mage::getModel('Mage_Backup_Model_Db'); - $backup = Mage::getModel('Mage_Backup_Model_Backup') + $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()) - ->setType('db') - ->setPath(Mage::getBaseDir("var") . DS . "backups"); + ->setBackupsDir($helper->getBackupsDir()); + + $backupManager->setName($this->getRequest()->getParam('backup_name')); - Mage::register('backup_model', $backup); + Mage::register('backup_manager', $backupManager); - $backupDb->createBackup($backup); - $this->_getSession()->addSuccess(Mage::helper('Mage_Adminhtml_Helper_Data')->__('The backup has been created.')); + if ($this->getRequest()->getParam('maintenance_mode')) { + $turnedOn = $helper->turnOnMaintenanceMode(); + + if (!$turnedOn) { + $response->setError( + Mage::helper('Mage_Backup_Helper_Data')->__("Warning! System couldn't put store on the maintenance mode.") . ' ' + . Mage::helper('Mage_Backup_Helper_Data')->__("Please deselect the sufficient check-box, if you want to continue backup's creation") + ); + $backupManager->setErrorMessage(Mage::helper('Mage_Backup_Helper_Data')->__("System couldn't put store on the maintenance mode")); + return $this->getResponse()->setBody($response->toJson()); + } + } + + 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); + + $response->setRedirectUrl($this->getUrl('*/*/index')); + } catch (Mage_Backup_Exception_NotEnoughFreeSpace $e) { + $errorMessage = Mage::helper('Mage_Backup_Helper_Data')->__('Not enough free space to create backup.'); + } catch (Mage_Backup_Exception_NotEnoughPermissions $e) { + Mage::log($e->getMessage()); + $errorMessage = Mage::helper('Mage_Backup_Helper_Data')->__('Not enough permissions to create backup.'); + } catch (Exception $e) { + Mage::log($e->getMessage()); + $errorMessage = Mage::helper('Mage_Backup_Helper_Data')->__('An error occurred while creating the backup.'); } - catch (Exception $e) { - $this->_getSession()->addException($e, Mage::helper('Mage_Adminhtml_Helper_Data')->__('An error occurred while creating the backup.')); + + if (!empty($errorMessage)) { + $response->setError($errorMessage); + $backupManager->setErrorMessage($errorMessage); } - $this->_redirect('*/*'); + + if ($this->getRequest()->getParam('maintenance_mode')) { + $helper->turnOffMaintenanceMode(); + } + + $this->getResponse()->setBody($response->toJson()); } /** * Download backup action + * + * @return Mage_Adminhtml_Controller_Action */ public function downloadAction() { - $backup = Mage::getModel('Mage_Backup_Model_Backup') - ->setTime((int)$this->getRequest()->getParam('time')) - ->setType($this->getRequest()->getParam('type')) - ->setPath(Mage::getBaseDir("var") . DS . "backups"); /* @var $backup Mage_Backup_Model_Backup */ + $backup = Mage::getModel('Mage_Backup_Model_Backup')->loadByTimeAndType( + $this->getRequest()->getParam('time'), + $this->getRequest()->getParam('type') + ); - if (!$backup->exists()) { - $this->_redirect('*/*'); + if (!$backup->getTime() || !$backup->exists()) { + return $this->_redirect('*/*'); } - $fileName = 'backup-' . date('YmdHis', $backup->getTime()) . '.sql.gz'; + $fileName = Mage::helper('Mage_Backup_Helper_Data')->generateBackupDownloadName($backup); $this->_prepareDownloadResponse($fileName, null, 'application/octet-stream', $backup->getSize()); @@ -113,29 +175,187 @@ class Mage_Adminhtml_System_BackupController extends Mage_Adminhtml_Controller_A } /** - * Delete backup action + * Rollback Action + * + * @return Mage_Adminhtml_Controller_Action */ - public function deleteAction() + public function rollbackAction() { + if (!Mage::helper('Mage_Backup_Helper_Data')->isRollbackAllowed()){ + return $this->_forward('denied'); + } + + if (!$this->getRequest()->isAjax()) { + return $this->getUrl('*/*/index'); + } + + $helper = Mage::helper('Mage_Backup_Helper_Data'); + $response = new Varien_Object(); + try { - $backup = Mage::getModel('Mage_Backup_Model_Backup') - ->setTime((int)$this->getRequest()->getParam('time')) - ->setType($this->getRequest()->getParam('type')) - ->setPath(Mage::getBaseDir("var") . DS . "backups") - ->deleteFile(); + /* @var $backup Mage_Backup_Model_Backup */ + $backup = Mage::getModel('Mage_Backup_Model_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($backup->getTime()) + ->setBackupsDir($helper->getBackupsDir()) + ->setName($backup->getName(), false) + ->setResourceModel(Mage::getResourceModel('Mage_Backup_Model_Resource_Db')); + + Mage::register('backup_manager', $backupManager); + + $passwordValid = Mage::getModel('Mage_Backup_Model_Backup')->validateUserPassword( + $this->getRequest()->getParam('password') + ); - Mage::register('backup_model', $backup); + if (!$passwordValid) { + $response->setError(Mage::helper('Mage_Backup_Helper_Data')->__('Invalid Password.')); + $backupManager->setErrorMessage(Mage::helper('Mage_Backup_Helper_Data')->__('Invalid Password.')); + return $this->getResponse()->setBody($response->toJson()); + } - $this->_getSession()->addSuccess(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Backup record was deleted.')); + if ($this->getRequest()->getParam('maintenance_mode')) { + $turnedOn = $helper->turnOnMaintenanceMode(); + + if (!$turnedOn) { + $response->setError( + Mage::helper('Mage_Backup_Helper_Data')->__("Warning! System couldn't put store on the maintenance mode.") . ' ' + . Mage::helper('Mage_Backup_Helper_Data')->__("Please deselect the sufficient check-box, if you want to continue rollback processing") + ); + $backupManager->setErrorMessage(Mage::helper('Mage_Backup_Helper_Data')->__("System couldn't put store on the maintenance mode")); + return $this->getResponse()->setBody($response->toJson()); + } + } + + if ($type != Mage_Backup_Helper_Data::TYPE_DB) { + + $backupManager->setRootDir(Mage::getBaseDir()) + ->addIgnorePaths($helper->getRollbackIgnorePaths()); + + 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()); + + $response->setRedirectUrl($this->getUrl('*')); + } catch (Mage_Backup_Exception_CantLoadSnapshot $e) { + $errorMsg = Mage::helper('Mage_Backup_Helper_Data')->__('Backup file not found'); + } catch (Mage_Backup_Exception_FtpConnectionFailed $e) { + $errorMsg = Mage::helper('Mage_Backup_Helper_Data')->__('Failed to connect to FTP'); + } catch (Mage_Backup_Exception_FtpValidationFailed $e) { + $errorMsg = Mage::helper('Mage_Backup_Helper_Data')->__('Failed to validate FTP'); + } catch (Mage_Backup_Exception_NotEnoughPermissions $e) { + Mage::log($e->getMessage()); + $errorMsg = Mage::helper('Mage_Backup_Helper_Data')->__('Not enough permissions to perform rollback'); + } catch (Exception $e) { + Mage::log($e->getMessage()); + $errorMsg = Mage::helper('Mage_Backup_Helper_Data')->__('Failed to rollback'); } - catch (Exception $e) { - // Nothing + + if (!empty($errorMsg)) { + $response->setError($errorMsg); + $backupManager->setErrorMessage($errorMsg); } - $this->_redirect('*/*/'); + if ($this->getRequest()->getParam('maintenance_mode')) { + $helper->turnOffMaintenanceMode(); + } + $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'); + } + + /** @var $backupModel Mage_Backup_Model_Backup */ + $backupModel = Mage::getModel('Mage_Backup_Model_Backup'); + $resultData = new Varien_Object(); + $resultData->setIsSuccess(false); + $resultData->setDeleteResult(array()); + Mage::register('backup_manager', $resultData); + + $deleteFailMessage = Mage::helper('Mage_Backup_Helper_Data')->__('Failed to delete one or several backups.'); + + try { + $allBackupsDeleted = true; + + foreach ($backupIds as $id) { + list($time, $type) = explode('_', $id); + $backupModel + ->loadByTimeAndType($time, $type) + ->deleteFile(); + + if ($backupModel->exists()) { + $allBackupsDeleted = false; + $result = Mage::helper('Mage_Adminhtml_Helper_Data')->__('failed'); + } else { + $result = Mage::helper('Mage_Adminhtml_Helper_Data')->__('successful'); + } + + $resultData->setDeleteResult( + array_merge($resultData->getDeleteResult(), array($backupModel->getFileName() . ' ' . $result)) + ); + } + + $resultData->setIsSuccess(true); + if ($allBackupsDeleted) { + $this->_getSession()->addSuccess( + Mage::helper('Mage_Backup_Helper_Data')->__('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('Mage_Admin_Model_Session')->isAllowed('system/tools/backup'); 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 9eea567c2da..5e8ad0ff432 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 fcb622cf328..a56869bd235 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 @@ class Mage_Adminhtml_System_ConfigController extends Mage_Adminhtml_Controller_A // 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 f204abb3845..bcfecca04be 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 146459d1409..91c07695829 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 0dc2addd12e..1c90bc0abbb 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) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php b/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php index 7e9659be6e8..fedcd19c554 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 958cfb6304e..7083db6957b 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 44654754535..92378379582 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 @@ class Mage_Adminhtml_System_StoreController extends Mage_Adminhtml_Controller_Ac try { switch ($postData['store_type']) { case 'website': + $postData['website']['name'] = $this->_getHelper()->removeTags($postData['website']['name']); $websiteModel = Mage::getModel('Mage_Core_Model_Website'); if ($postData['website']['website_id']) { $websiteModel->load($postData['website']['website_id']); @@ -186,6 +187,7 @@ class Mage_Adminhtml_System_StoreController extends Mage_Adminhtml_Controller_Ac break; case 'group': + $postData['group']['name'] = $this->_getHelper()->removeTags($postData['group']['name']); $groupModel = Mage::getModel('Mage_Core_Model_Store_Group'); if ($postData['group']['group_id']) { $groupModel->load($postData['group']['group_id']); @@ -205,6 +207,7 @@ class Mage_Adminhtml_System_StoreController extends Mage_Adminhtml_Controller_Ac case 'store': $eventName = 'store_edit'; $storeModel = Mage::getModel('Mage_Core_Model_Store'); + $postData['store']['name'] = $this->_getHelper()->removeTags($postData['store']['name']); if ($postData['store']['store_id']) { $storeModel->load($postData['store']['store_id']); } @@ -498,4 +501,3 @@ class Mage_Adminhtml_System_StoreController extends Mage_Adminhtml_Controller_Ac } } - diff --git a/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php b/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php index 228f91d1d57..9c2b457669f 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) */ @@ -56,7 +56,7 @@ class Mage_Adminhtml_System_VariableController extends Mage_Adminhtml_Controller $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('Mage_Core_Model_Variable'); if ($variableId) { @@ -101,9 +101,9 @@ class Mage_Adminhtml_System_VariableController extends Mage_Adminhtml_Controller $this->_initLayout() ->_addContent($this->getLayout()->createBlock('Mage_Adminhtml_Block_System_Variable_Edit')) - ->_addJs($this->getLayout() - ->createBlock('Mage_Core_Block_Template', '', array('template' => 'system/variable/js.phtml')) - ) + ->_addJs($this->getLayout()->createBlock('Mage_Core_Block_Template', '', array( + 'template' => 'system/variable/js.phtml' + ))) ->renderLayout(); } diff --git a/app/code/core/Mage/Adminhtml/controllers/SystemController.php b/app/code/core/Mage/Adminhtml/controllers/SystemController.php index e7f56acd654..3a194ba6801 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 29db3ccb350..9a7f56cea42 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) */ @@ -82,7 +82,6 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action $this->_initAction() ->_addBreadcrumb(Mage::helper('Mage_Adminhtml_Helper_Data')->__('All Tags'), Mage::helper('Mage_Adminhtml_Helper_Data')->__('All Tags')) ->_setActiveMenu('catalog/tag/all') - ->_addContent($this->getLayout()->createBlock('Mage_Adminhtml_Block_Tag_Tag')) ->renderLayout(); } @@ -93,7 +92,7 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action public function ajaxGridAction() { $this->loadLayout(); - $this->getResponse()->setBody($this->getLayout()->createBlock('Mage_Adminhtml_Block_Tag_Tag_Grid')->toHtml()); + $this->renderLayout(); } /** @@ -103,9 +102,7 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action public function ajaxPendingGridAction() { $this->loadLayout(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_Tag_Grid_Pending')->toHtml() - ); + $this->renderLayout(); } /** @@ -172,7 +169,9 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action $model->addData($data); if (isset($postData['tag_assigned_products'])) { - $productIds = Mage::helper('Mage_Adminhtml_Helper_Js')->decodeGridSerializedInput($postData['tag_assigned_products']); + $productIds = Mage::helper('Mage_Adminhtml_Helper_Js')->decodeGridSerializedInput( + $postData['tag_assigned_products'] + ); $tagRelationModel = Mage::getModel('Mage_Tag_Model_Tag_Relation'); $tagRelationModel->addRelations($model, $productIds); } @@ -236,7 +235,6 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action $this->_initAction() ->_addBreadcrumb(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Pending Tags'), Mage::helper('Mage_Adminhtml_Helper_Data')->__('Pending Tags')) ->_setActiveMenu('catalog/tag/pending') - ->_addContent($this->getLayout()->createBlock('Mage_Adminhtml_Block_Tag_Pending')) ->renderLayout(); } @@ -271,9 +269,8 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action public function productAction() { $this->_initTag(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_Tag_Product_Grid')->toHtml() - ); + $this->loadLayout(); + $this->renderLayout(); } /** @@ -283,9 +280,8 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action public function customerAction() { $this->_initTag(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_Tag_Customer_Grid')->toHtml() - ); + $this->loadLayout(); + $this->renderLayout(); } /** 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 b47b1016e53..4528abc6246 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 0f6f1ffc44f..1d0ce11c2e4 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 e08ac92ab47..ec86c4170ee 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 @@ class Mage_Adminhtml_Tax_ClassController extends Mage_Adminhtml_Controller_Actio { if ($postData = $this->getRequest()->getPost()) { - //filtering - $postData['class_name'] = Mage::helper('Mage_Adminhtml_Helper_Data')->stripTags($postData['class_name']); - $model = Mage::getModel('Mage_Tax_Model_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 522d5103630..5fd17b64f65 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 @@ class Mage_Adminhtml_Tax_RateController extends Mage_Adminhtml_Controller_Action { $ratePost = $this->getRequest()->getPost(); if ($ratePost) { - //filter tags in titles - /** @var $helper Mage_Adminhtml_Helper_Data */ - $helper = Mage::helper('Mage_Adminhtml_Helper_Data'); - $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('Mage_Tax_Model_Calculation_Rate')->load($rateId); @@ -302,7 +292,9 @@ class Mage_Adminhtml_Tax_RateController extends Mage_Adminhtml_Controller_Action $stores = array(); $unset = array(); $storeCollection = Mage::getModel('Mage_Core_Model_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 @@ class Mage_Adminhtml_Tax_RateController extends Mage_Adminhtml_Controller_Action 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 @@ class Mage_Adminhtml_Tax_RateController extends Mage_Adminhtml_Controller_Action $titles[$id] = $v[$field]; } - //filter tags in titles - foreach ($titles as &$title) { - $title = $helper->stripTags($title); - } - $rateModel->setTitle($titles); $rateModel->save(); } @@ -482,4 +469,4 @@ class Mage_Adminhtml_Tax_RateController extends Mage_Adminhtml_Controller_Action break; } } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php index 0c95d266ed1..6f9cb234764 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) */ @@ -89,11 +89,6 @@ class Mage_Adminhtml_Tax_RuleController extends Mage_Adminhtml_Controller_Action { if ($postData = $this->getRequest()->getPost()) { - //filtering - /** @var $helper Mage_Adminhtml_Helper_Data */ - $helper = Mage::helper('Mage_Adminhtml_Helper_Data'); - $postData['code'] = $helper->stripTags($postData['code']); - $ruleModel = Mage::getSingleton('Mage_Tax_Model_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 cbbabdb9bdf..e5d5cf7259f 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 50245e92053..025cba8a08f 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 7eb6f302d2f..3656c858ad4 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) */ --> @@ -207,6 +207,12 @@ </input_types> </validator_data> </general> + <hints> + <store_switcher> + <url><![CDATA[http://www.magentocommerce.com/knowledge-base/entry/understanding-store-scopes]]></url> + <enabled>1</enabled> + </store_switcher> + </hints> </default> <stores> <admin> diff --git a/app/code/core/Mage/Adminhtml/etc/translater.xml b/app/code/core/Mage/Adminhtml/etc/translater.xml new file mode 100644 index 00000000000..8454ad559c2 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/etc/translater.xml @@ -0,0 +1,65 @@ +<?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_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<translater> + <!-- flexuploader.js --> + <flexuploader-complete translate="message" module="Mage_Adminhtml"> + <message>Complete</message> + </flexuploader-complete> + <flexuploader-security-error translate="message" module="Mage_Adminhtml"> + <message>Upload Security Error</message> + </flexuploader-security-error> + <flexuploader-http-error translate="message" module="Mage_Adminhtml"> + <message>Upload HTTP Error</message> + </flexuploader-http-error> + <flexuploader-io-error translate="message" module="Mage_Adminhtml"> + <message>Upload I/O Error</message> + </flexuploader-io-error> + <flexuploader-ssl-error translate="message" module="Mage_Adminhtml"> + <message>SSL Error: Invalid or self-signed certificate</message> + </flexuploader-ssl-error> + <flexuploader-tb translate="message" module="Mage_Adminhtml"> + <message>Tb</message> + </flexuploader-tb> + <flexuploader-gb translate="message" module="Mage_Adminhtml"> + <message>Gb</message> + </flexuploader-gb> + <flexuploader-mb translate="message" module="Mage_Adminhtml"> + <message>Mb</message> + </flexuploader-mb> + <flexuploader-kb translate="message" module="Mage_Adminhtml"> + <message>Kb</message> + </flexuploader-kb> + <flexuploader-b translate="message" module="Mage_Adminhtml"> + <message>b</message> + </flexuploader-b> + <!-- end flexuploader.js --> + <sales-order-create-addproducts translate="message" module="Mage_Adminhtml"> + <message>Add Products</message> + </sales-order-create-addproducts> +</translater> + diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin.xml index 7e313b32d1f..f10404e1549 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/admin/access_denied.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/access_denied.phtml index bf85d99eddd..fcb90c48c3f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/access_denied.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/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/code/core/Mage/Adminhtml/view/adminhtml/admin/forgotpassword.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/forgotpassword.phtml index 7bcbb183a63..8cdfb5bb611 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/forgotpassword.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/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) */ ?> @@ -39,6 +39,7 @@ <script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/adminhtml/events.js'); ?>"></script> <script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/adminhtml/form.js'); ?>"></script> <script type="text/javascript" src="<?php echo $this->getSkinUrl('scriptaculous/effects.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/captcha.js') ?>"></script> <!--[if IE]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('iestyles.css'); ?>" type="text/css" media="all" /> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('below_ie7.css'); ?>" type="text/css" media="all" /> <![endif]--> @@ -57,10 +58,11 @@ <div class="input-box forgot-password"><label for="email"><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Email Address:'); ?></label><br /> <input type="text" id="email" name="email" value="" class="required-entry input-text forgot-password validate-email" style="width:461px;" /> </div> + <?php echo $this->getChildHtml('form.additional.info'); ?> <div class="clear"></div> <div class="form-buttons"> <a class="left" href="<?php echo $this->getUrl('adminhtml', array('_nosecret' => true)); ?>">« <?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Back to Login'); ?></a> - <button class="forgot-password" onclick="loginForm.submit()" type="button"><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Retrieve Password'); ?></span></button> + <button class="forgot-password" onclick="loginForm.submit()" type="button"><span><span><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Retrieve Password'); ?></span></span></span></button> </div> </fieldset> <p class="legal"><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Magento is a trademark of Magento Inc. Copyright © %s Magento Inc.', date('Y')); ?></p> @@ -73,4 +75,3 @@ </div> </body> </html> - diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/formkey.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/formkey.phtml index 7ab082d3674..9ac18a669ee 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/formkey.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/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/code/core/Mage/Adminhtml/view/adminhtml/admin/login.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/login.phtml index a6153c6a3e0..8ad67aa44c0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/login.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/login.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,6 +38,7 @@ <script type="text/javascript" src="<?php echo $this->getSkinUrl('prototype/validation.js') ?>"></script> <script type="text/javascript" src="<?php echo $this->getSkinUrl('scriptaculous/effects.js') ?>"></script> <script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/adminhtml/form.js') ?>"></script> + <script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/captcha.js') ?>"></script> <!--[if IE]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('iestyles.css') ?>" type="text/css" media="all" /> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('below_ie7.css') ?>" type="text/css" media="all" /> <![endif]--> @@ -57,6 +58,7 @@ <input type="text" id="username" name="login[username]" value="" class="required-entry input-text" /></div> <div class="input-box input-right"><label for="login"><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Password:') ?></label><br /> <input type="password" id="login" name="login[password]" class="required-entry input-text" value="" /></div> + <?php echo $this->getChildHtml('form.additional.info'); ?> <div class="clear"></div> <div class="form-buttons"> <a class="left" href="<?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->getUrl('adminhtml/index/forgotpassword', array('_nosecret' => true)) ?>"><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Forgot your password?') ?></a> @@ -72,4 +74,3 @@ </div> </body> </html> - diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/overlay_popup.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/overlay_popup.phtml index 7a26c1d06f6..84a11c67099 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/overlay_popup.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/overlay_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) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/page.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/page.phtml index 906b448c840..30e0a13f8d9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/page.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/page.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) */ ?> @@ -43,7 +43,7 @@ <?php echo $this->getChildHtml('head') ?> </head> -<body id="html-body"<?php echo $this->getBodyClass()?'class="'.$this->getBodyClass().'"':'' ?>> +<body id="html-body"<?php echo $this->getBodyClass() ? ' class="' . $this->getBodyClass() . '"' : ''; ?>> <?php echo $this->getChildHtml('notification_window'); ?> <div class="wrapper"> <?php echo $this->getChildHtml('global_notices') ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/popup.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/popup.phtml index 874cbe1dd68..69c93163f2e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/popup.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/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) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/adminnotification.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/adminnotification.xml index 869eef8dbbf..5c4bc5d5496 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/adminnotification.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/api/role_users_grid_js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/role_users_grid_js.phtml index 838135e7459..79ffafe5fe4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/role_users_grid_js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/api/roleinfo.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/roleinfo.phtml index e74f8912349..053723aeba5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/roleinfo.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/api/roles.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/roles.phtml index 4713c7b0d10..cebb8dcb143 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/roles.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 @@ <tr> <td style="width:50%;"><h3 class="icon-head head-permissions-role"><?php echo $this->__('Roles') ?></h3></td> <td class="form-buttons"> - <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><?php echo $this->__('Add New Role') ?></span></button> + <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><span><span><?php echo $this->__('Add New Role') ?></span></span></span></button> </td> </tr> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesedit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesedit.phtml index 07c06c7b754..e031b7da666 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesedit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/api/rolesusers.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesusers.phtml index 3727f5c4ac9..e09eb58a422 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesusers.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/api/user_roles_grid_js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/user_roles_grid_js.phtml index 57a60860f8e..cc042e99e85 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/user_roles_grid_js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/api/userinfo.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/userinfo.phtml index c9be39d10b1..5290bbcf433 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/userinfo.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/api/usernroles.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/usernroles.phtml index 8106d8e6ff2..9ccb82acbfb 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/usernroles.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/backup/dialogs.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/backup/dialogs.phtml new file mode 100644 index 00000000000..7b2b8635d54 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/backup/dialogs.phtml @@ -0,0 +1,190 @@ +<?php +/** + * 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) + */ +?> +<div class="backup-dialog" style="display: none;" id="rollback-warning"> + <div class="entry-edit"> + <div class="entry-edit-head"> + <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Warning') ?></h4> + </div> + <div class="content"> + <div><?php echo $this->__('Any data created since the backup was made will be lost including admin users, customers and orders.')?></div> + <div class="question"><?php echo $this->__('Are you sure you want to proceed?')?></div> + </div> + <div class="buttons-set"> + <div class="f-right"> + <button type="button" class="scalable " onclick="backup.requestPassword()"><span><?php echo $this->__('OK')?></span></button> + <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button> + </div> + </div> + </div> +</div> + +<div class="backup-dialog" style="display: none;" id="backup-warning"> + <div class="entry-edit"> + <div class="entry-edit-head"> + <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Warning') ?></h4> + </div> + <div class="content"> + <div class="backup-messages" style="display: none;"><ul class="messages"></ul></div> + <div><?php echo $this->__("The backup's creation process will take time.")?></div> + <div><?php echo $this->__('You will need to wait when the action ends.')?></div> + <div><?php echo $this->__('Do you really want to proceed?')?></div> + </div> + <div class="buttons-set"> + <div class="f-right"> + <button type="button" class="scalable " onclick="backup.requestBackupOptions()"><span><?php echo $this->__('OK')?></span></button> + <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button> + </div> + </div> + </div> +</div> + +<div class="backup-dialog" style="display: none;" id="backup-options"> + <div class="entry-edit"> + <div class="entry-edit-head"> + <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Backup options') ?></h4> + </div> + <div class="content"> + <div class="backup-messages" style="display: none;"><ul class="messages"></ul></div> + <div><?php echo $this->__('Please specify backup creation options')?></div> + <form action="" method="post" id="backup-form" onsubmit="return backup.submitBackup();"> + <table class="form-list question" cellspacing="0"> + <tr> + <td style="padding-right: 8px;"><label for="backup_name" class="nobr"><?php echo $this->__('Backup Name')?></label></td> + <td> + <input type="text" name="backup_name" id="backup_name" class="validate-alphanum-with-spaces" style="width: 343px"/> + <p class="note"><span><?php echo $this->__('Please use only letters (a-z or A-Z), numbers (0-9) or spaces in this field.'); ?></span></p> + </td> + </tr> + <tr> + <td> </td> + <td class="maintenance-checkbox-container"> + <input type="checkbox" name="maintenance_mode" value="1" id="backup_maintenance_mode"/> + <label for="backup_maintenance_mode"><?php echo $this->__('Put store on the maintenance mode while backup creation')?></label> + </td> + </tr> + <tr id="exclude-media-checkbox-container" style="display: none;"> + <td> </td> + <td> + <input type="checkbox" name="exclude_media" value="1" id="exclude_media"/> + <label for="exclude_media"><?php echo $this->__('Exclude media folder from backup')?></label> + </td> + </tr> + </table> + </form> + </div> + <div class="buttons-set"> + <div class="f-right"> + <button type="button" class="scalable " onclick="backup.submitBackup()"><span><?php echo $this->__('OK')?></span></button> + <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button> + </div> + </div> + </div> + </div> + +<div class="backup-dialog" style="display: none;" id="rollback-request-password"> + <div class="entry-edit"> + <div class="entry-edit-head"> + <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Please enter password') ?></h4> + </div> + <div class="content"> + <div class="backup-messages" style="display: none;"><ul class="messages"></ul></div> + <div><?php echo $this->__('Please enter password to confirm rollback.')?></div> + <div><?php echo $this->__('This action cannot be undone.')?></div> + <div class="question"><?php echo $this->__('Are you sure you want to proceed?')?></div> + <form action="" method="post" id="rollback-form" onsubmit="return backup.submitRollback();"> + <div class="password-box-container"> + <table class="form-list" cellspacing="0"> + <tr> + <td style="padding-right: 8px;"><label for="password" class="nobr"><?php echo $this->__('User Password')?> <span class="required">*</span></label></td> + <td><input type="password" name="password" id="password" class="required-entry"></td> + </tr> + <tr> + <td> </td> + <td class="maintenance-checkbox-container"> + <input type="checkbox" name="maintenance_mode" value="1" id="rollback_maintenance_mode"/> + <label for="rollback_maintenance_mode"><?php echo $this->__('Put store on the maintenance mode while rollback processing')?></label> + </td> + </tr> + <tr id="use-ftp-checkbox-row" style="display: none;"> + <td> </td> + <td><input type="checkbox" name="use_ftp" value="1" id="use_ftp" onClick="backup.toggleFtpCredentialsForm();"/> <label for="use_ftp"><?php echo $this->__('Use FTP Connection')?></label></td> + </tr> + </table> + </div> + <div class="entry-edit" id="ftp-credentials-container" style="display: none;"> + <div class="entry-edit-head"> + <h4 class=""><?php echo $this->__('FTP credentials')?></h4> + </div> + <fieldset> + <table class="form-list" cellspacing="0"> + <tr> + <td class="label"><label for="ftp_host"><?php echo $this->__('FTP Host')?> <span class="required">*</span></label></td> + <td class="value"><input type="text" name="ftp_host" id="ftp_host"></td> + </tr> + <tr> + <td class="label"><label for="ftp_user"><?php echo $this->__('FTP Login')?> <span class="required">*</span></label></td> + <td class="value"><input type="text" name="ftp_user" id="ftp_user"></td> + </tr> + <tr> + <td class="label"><label for="ftp_pass"><?php echo $this->__('FTP Password')?> <span class="required">*</span></label></td> + <td class="value"><input type="password" name="ftp_pass" id="ftp_pass"></td> + </tr> + <tr> + <td class="label"><label for="ftp_path"><?php echo $this->__('Magento root directory')?></label></td> + <td class="value"><input type="text" name="ftp_path" id="ftp_path"></td> + </tr> + </table> + </fieldset> + </div> + </form> + </div> + <div class="buttons-set"> + <div class="f-right"> + <button type="button" class="scalable " onclick="backup.submitRollback()"><span><?php echo $this->__('OK')?></span></button> + <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button> + </div> + </div> + </div> +</div> + +<div id="popup-window-mask" style="display: none;"></div> + +<?php + $helper = Mage::helper('Mage_Backup_Helper_Data'); + $rollbackUrl = $this->getUrl('*/*/rollback'); + $backupUrl = $this->getUrl('*/*/create'); +?> + +<script type="text/javascript"> +//<![CDATA[ + document.observe('dom:loaded', function () { + backup = new AdminBackup(); + backup.rollbackUrl = '<?php echo $helper->jsQuoteEscape($rollbackUrl);?>'; + backup.backupUrl = '<?php echo $helper->jsQuoteEscape($backupUrl);?>'; + }); +//]]> +</script> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/backup/left.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/backup/left.phtml index 5c07412a14e..d684b1233af 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/backup/left.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/backup/left.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/code/core/Mage/Adminhtml/view/adminhtml/backup/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/backup/list.phtml index 0e2b40194c9..686a9e0abd0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/backup/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/backup/list.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,8 +28,13 @@ <table cellspacing="0"> <tr> <td style="width:50%;"><h3 class="icon-head head-backups-control"><?php echo Mage::helper('Mage_Backup_Helper_Data')->__('Backups') ?></h3></td> - <td class="form-buttons"><?php echo $this->getCreateButtonHtml(); ?></td> + <td class="form-buttons"> + <?php echo $this->getCreateSnapshotButtonHtml(); ?> + <?php echo $this->getCreateMediaBackupButtonHtml(); ?> + <?php echo $this->getCreateButtonHtml(); ?> + </td> </tr> </table> </div> <?php echo $this->getGridHtml() ?> +<?php echo $this->getDialogsHtml() ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml index 8a3333c8846..49abfdbbb11 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/checkboxes/tree.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/checkboxes/tree.phtml index e80f37103d8..18832c8a114 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/checkboxes/tree.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/checkboxes/tree.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/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit.phtml index 6453c9208ab..89d6e6900e8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit/form.phtml index 8739d513c42..c3f11437f27 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/tree.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/tree.phtml index a993a5f5623..6bcb21d5cd8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/tree.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/tree.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/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/widget/tree.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/widget/tree.phtml index 5dd3a0d85e2..4fe27d3568e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/widget/tree.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/widget/tree.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/code/core/Mage/Adminhtml/view/adminhtml/catalog/form/renderer/fieldset/element.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/form/renderer/fieldset/element.phtml index eaa1ff880df..e3305ad1cb2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/form/renderer/fieldset/element.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.js b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.js index e6aae5f63a9..2ba1d514195 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/view/adminhtml/catalog/product.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.phtml index abccdff0c47..e17878ee458 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/js.phtml index deb22a1ffcf..3a9d956706a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/new/created.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/new/created.phtml index a0ab7f942c7..00b11f381bc 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/new/created.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/new/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/options.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/options.phtml index 46980932046..f1b17645d38 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/options.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/options.phtml @@ -20,13 +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) */ ?> <?php /** - * Attribute otions control + * Attribute options control * * @see Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main.phtml index eae17b5706a..d49b59b32ff 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/attribute.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/attribute.phtml index 2acd065758f..06b9fcb86a2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/attribute.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/group.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/group.phtml index 91fe9250a42..dc4ec6d0c35 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/group.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/add.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/add.phtml index c6584ab878e..2bfd88b8729 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/add.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/main.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/main.phtml index f4419690084..a8d0cc85efe 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/main.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.js b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.js index 4d2c123796c..98d5706a987 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -213,16 +213,16 @@ ProductConfigure.prototype = { } else if (response) { response = response + ''; this.blockFormFields.update(response); - + // Add special div to hold mage data, e.g. scripts to execute on every popup show var mageData = {}; var scripts = response.extractScripts(); mageData.scripts = scripts; - + var scriptHolder = new Element('div', {'style': 'display:none'}); scriptHolder.mageData = mageData; this.blockFormFields.insert(scriptHolder); - + // Show window this._showWindow(); } @@ -694,7 +694,7 @@ ProductConfigure.prototype = { restoreConfirmedValues(this.blockFormFields.getElementsByTagName('input')); restoreConfirmedValues(this.blockFormFields.getElementsByTagName('select')); restoreConfirmedValues(this.blockFormFields.getElementsByTagName('textarea')); - + // Execute scripts if (mageData && mageData.scripts) { this.restorePhase = true; diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.phtml index ac32f74671c..93b116ea16b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 @@ <div id="product_composite_configure_form_additional" style="display:none;"></div> <div id="product_composite_configure_form_confirmed" style="display:none;"></div> <div class="buttons-set a-right"> - <button type="button" class="scalable" onclick="productConfigure.onCancelBtn()" id="product_composite_configure_form_cancel"><span><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Cancel') ?></span></button> - <button type="submit" class="scalable"><span><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('OK') ?></span></button> + <button type="button" class="scalable" onclick="productConfigure.onCancelBtn()" id="product_composite_configure_form_cancel"><span><span><span><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Cancel') ?></span></span></span></button> + <button type="submit" class="scalable"><span><span><span><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('OK') ?></span></span></span></button> </div> </div> <input type="hidden" name="as_js_varname" value="iFrameResponse" /> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/configurable.phtml index b28458c6b4c..ec879c360f8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/grouped.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/grouped.phtml index 8cda4468cc7..75d29b0725c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/grouped.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/grouped.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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options.phtml index 9c3b616522e..0e23a4e19ee 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/js.phtml index d5d6361a364..30f453aa28c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/date.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/date.phtml index d83f9a3a244..3e491c7d14e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/date.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/default.phtml index 83379385331..df324cd8045 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/file.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/file.phtml index 6e9e4b8a1a3..484534cd210 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/file.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/select.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/select.phtml index 8b9119ac771..4ee99329295 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/select.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/text.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/text.phtml index 836685a6d6b..ac193203ec6 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/text.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/qty.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/qty.phtml index 20d32b49a1d..63d0b6bfe73 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/qty.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/created.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/created.phtml index 7f5cd5e6801..0306b20a29b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/created.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit.phtml index 8d099da86a8..361cd25ba83 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/attribute.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/attribute.phtml index e3d5fd1f004..92a0348d2b9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/attribute.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/inventory.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/inventory.phtml index 2ae37985247..1ac9fb6bb73 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/inventory.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/websites.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/websites.phtml index e76829c821f..2a7a0c5f023 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/websites.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/categories.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/categories.phtml index d02a5d16067..436ebdd18a7 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/categories.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options.phtml index ab7aae28e73..5062bdd8e44 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/option.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/option.phtml index 08ea5068e45..94bb4eb1ce7 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/option.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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($('<?php echo $this->getAddButtonId() ?>')){ //validation for selected input type Validation.addAllThese([ - ['required-option-select', '<?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Select type of option') ?>', function(v, elm) { + ['required-option-select', <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('Select type of option')) ?>, function(v, elm) { if (elm.getValue() == '') { return false; } diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/date.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/date.phtml index 07f48a91c55..d97e519e3ae 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/date.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 = '<table class="border" cellpadding="0" cellspacing="0">'+ '</tr>'+ '<tr>'+ <?php if ($this->getCanReadPrice() !== false) : ?> - '<td><input type="text" class="input-text validate-zero-or-greater product-option-price" id="product_option_{{option_id}}_price" name="product[options][{{option_id}}][price]" value="{{price}}"<?php if ($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?>></td>' + + '<td><input type="text" class="input-text validate-number product-option-price" id="product_option_{{option_id}}_price" name="product[options][{{option_id}}][price]" value="{{price}}"<?php if ($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?>></td>' + '<td><?php echo $this->getPriceTypeSelectHtml() ?>{{checkboxScopePrice}}</td>' + <?php else : ?> '<input type="hidden" id="product_option_{{option_id}}_price" name="product[options][{{option_id}}][price]">' + diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/file.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/file.phtml index 674fbd701d5..34f54fd675e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/file.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 = '<table class="border" cellpadding="0" cellspacing="0">'+ '<tr class="headings">'+ <?php if ($this->getCanReadPrice() !== false) : ?> - '<th class="type-price"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Price') ?></th>' + - '<th class="type-type"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Price Type') ?></th>' + + '<th class="type-price">' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('Price')); ?> + '</th>' + + '<th class="type-type">' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('Price Type')); ?> + '</th>' + <?php endif; ?> - '<th class="type-sku"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('SKU') ?></th>'+ - '<th class="type-title"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Allowed File Extensions') ?></th>'+ - '<th class="last"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Maximum Image Size') ?></th>'+ - '</tr>'+ - '<tr>'+ + '<th class="type-sku">' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('SKU')); ?> + '</th>' + + '<th class="type-title">' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('Allowed File Extensions')); ?> + '</th>'+ + '<th class="last">' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('Maximum Image Size')); ?> + '</th>' + + '</tr>' + + '<tr>' + <?php if ($this->getCanReadPrice() !== false) : ?> '<td><input class="input-text validate-zero-or-greater" type="text" name="product[options][{{option_id}}][price]" value="{{price}}"<?php if ($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?>></td>' + - '<td><?php echo $this->getPriceTypeSelectHtml() ?></td>' + + '<td>' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode($this->getPriceTypeSelectHtml()) ?> + '</td>' + <?php else : ?> '<input type="hidden" name="product[options][{{option_id}}][price]">' + '<input type="hidden" name="product[options][{{option_id}}][price_type]" id="product_option_{{option_id}}_price_type">' + <?php endif; ?> - '<td><input type="text" class="input-text" name="product[options][{{option_id}}][sku]" value="{{sku}}"></td>'+ - '<td><input class="input-text" type="text" name="product[options][{{option_id}}][file_extension]" value="{{file_extension}}"></td>'+ - '<td class="type-last last" nowrap><input class="input-text" type="text" name="product[options][{{option_id}}][image_size_x]" value="{{image_size_x}}"> <?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('x') ?> <input class="input-text" type="text" name="product[options][{{option_id}}][image_size_y]" value="{{image_size_y}}"> <?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('px.') ?><br/><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('leave blank if its not an image') ?></td>'+ + '<td><input type="text" class="input-text" name="product[options][{{option_id}}][sku]" value="{{sku}}"></td>' + + '<td><input class="input-text" type="text" name="product[options][{{option_id}}][file_extension]" value="{{file_extension}}"></td>' + + '<td class="type-last last" nowrap><input class="input-text" type="text" name="product[options][{{option_id}}][image_size_x]" value="{{image_size_x}}">' + + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('x')) ?> + + '<input class="input-text" type="text" name="product[options][{{option_id}}][image_size_y]" value="{{image_size_y}}">' + + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('px.')) ?> + + '<br/>' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('leave blank if its not an image')) ?> + '</td>' + '</tr>'+ '</table>'; diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/select.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/select.phtml index 69644ed6899..dd526b5c55f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/select.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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', '<?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Please add rows to option.') ?>', function(v, elm) { + ['required-option-select-type-rows', <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/text.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/text.phtml index ffba61919d5..05f49df6490 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/text.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/group.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/group.phtml new file mode 100644 index 00000000000..745d20b3de2 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/group.phtml @@ -0,0 +1,169 @@ +<?php +/** + * 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) + */ +?> +<?php +/** @var $this Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group */ +$_htmlId = $this->getElement()->getHtmlId(); +$_htmlClass = $this->getElement()->getClass(); +$_htmlName = $this->getElement()->getName(); +$_readonly = $this->getElement()->getReadonly(); +$_priceValueValidation = $this->getPriceValidation('validate-zero-or-greater'); + +$_showWebsite= $this->isMultiWebsites(); +?> +<tr> + <td class="label"><?php echo $this->getElement()->getLabel(); ?></td> + <td colspan="10" class="grid tier"> + <table cellspacing="0" class="data border" id="group_prices_table"> + <?php if ($_showWebsite) : ?> + <col width="135" /> + <?php endif; ?> + <col width="120" /> + <col /> + <col width="1" /> + <thead> + <tr class="headings"> + <th <?php if (!$_showWebsite): ?>style="display: none;"<?php endif; ?>><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Website'); ?></th> + <th><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Customer Group'); ?></th> + <th><?php echo $this->getPriceColumnHeader(Mage::helper('Mage_Catalog_Helper_Data')->__('Price')); ?></th> + <th class="last"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Action'); ?></th> + </tr> + </thead> + <tbody id="<?php echo $_htmlId; ?>_container"></tbody> + <tfoot> + <tr> + <td <?php if (!$_showWebsite): ?>style="display: none;"<?php endif; ?>></td> + <td colspan="4" class="a-right"><?php echo $this->getAddButtonHtml(); ?></td> + </tr> + </tfoot> + </table> + +<script type="text/javascript"> +//<![CDATA[ +var groupPriceRowTemplate = '<tr>' + + '<td<?php if (!$_showWebsite): ?> style="display:none"<?php endif; ?>>' + + '<select class="<?php echo $_htmlClass; ?> required-entry" name="<?php echo $_htmlName; ?>[{{index}}][website_id]" id="group_price_row_{{index}}_website">' + <?php foreach ($this->getWebsites() as $_websiteId => $_info) : ?> + + '<option value="<?php echo $_websiteId; ?>"><?php echo $this->jsQuoteEscape($this->escapeHtml($_info['name'])); ?><?php if (!empty($_info['currency'])) : ?> [<?php echo $this->escapeHtml($_info['currency']); ?>]<?php endif; ?></option>' + <?php endforeach; ?> + + '</select></td>' + + '<td><select class="<?php echo $_htmlClass; ?> custgroup required-entry" name="<?php echo $_htmlName; ?>[{{index}}][cust_group]" id="group_price_row_{{index}}_cust_group">' + <?php foreach ($this->getCustomerGroups() as $_groupId => $_groupName): ?> + + '<option value="<?php echo $_groupId; ?>"><?php echo $this->jsQuoteEscape($this->escapeHtml($_groupName)); ?></option>' + <?php endforeach; ?> + + '</select></td>' + + '<td><input class="<?php echo $_htmlClass; ?> required-entry <?php echo $_priceValueValidation; ?>" type="text" name="<?php echo $_htmlName; ?>[{{index}}][price]" value="{{price}}" id="group_price_row_{{index}}_price" /></td>' + + '<td class="last"><input type="hidden" name="<?php echo $_htmlName; ?>[{{index}}][delete]" class="delete" value="" id="group_price_row_{{index}}_delete" />' + + '<button title="<?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Delete Group Price'); ?>" type="button" class="scalable delete icon-btn delete-product-option" id="group_price_row_{{index}}_delete_button" onclick="return groupPriceControl.deleteItem(event);">' + + '<span><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Delete'); ?></span></button></td>' + + '</tr>'; + +var groupPriceControl = { + template: new Template(groupPriceRowTemplate, new RegExp('(^|.|\\r|\\n)({{\\s*(\\w+)\\s*}})', '')), + itemsCount: 0, + addItem : function () { + <?php if ($_readonly): ?> + if (arguments.length < 3) { + return; + } + <?php endif; ?> + var data = { + website_id: '<?php echo $this->getDefaultWebsite(); ?>', + group: '<?php echo $this->getDefaultCustomerGroup(); ?>', + price: '', + readOnly: false, + index: this.itemsCount++ + }; + + if(arguments.length >= 3) { + data.website_id = arguments[0]; + data.group = arguments[1]; + data.price = arguments[2]; + } + if (arguments.length == 4) { + data.readOnly = arguments[3]; + } + + Element.insert($('<?php echo $_htmlId; ?>_container'), { + bottom : this.template.evaluate(data) + }); + + $('group_price_row_' + data.index + '_cust_group').value = data.group; + $('group_price_row_' + data.index + '_website').value = data.website_id; + + <?php if ($this->isShowWebsiteColumn() && !$this->isAllowChangeWebsite()): ?> + var websiteElement = $('group_price_row_' + data.index + '_website'); + var websiteCaption = websiteElement.options[websiteElement.selectedIndex].text; + + websiteElement.insert({after:'<span class="website-name">' + websiteCaption + '</span>'}); + websiteElement.hide(); + <?php endif;?> + + if (data.readOnly == '1') { + ['website', 'cust_group', 'price', 'delete'].each(function(element_suffix) { + $('group_price_row_' + data.index + '_' + element_suffix).disabled = true; + }); + $('group_price_row_' + data.index + '_delete_button').hide(); + } + + <?php if ($_readonly): ?> + $('<?php echo $_htmlId; ?>_container').select('input', 'select').each(this.disableElement); + $('<?php echo $_htmlId; ?>_container').up('table').select('button').each(this.disableElement); + <?php else: ?> + $('<?php echo $_htmlId; ?>_container').select('input', 'select').each(function(element) { + Event.observe(element, 'change', element.setHasChanges.bind(element)); + }); + <?php endif; ?> + }, + disableElement: function(element) { + element.disabled = true; + element.addClassName('disabled'); + }, + deleteItem: function(event) { + var tr = Event.findElement(event, 'tr'); + if (tr) { + Element.select(tr, '.delete').each(function(element) { + element.value='1'; + }); + Element.select(tr, ['input', 'select']).each(function(element) { + element.hide(); + }); + Element.hide(tr); + Element.addClassName(tr, 'no-display template'); + } + return false; + } +}; +<?php foreach ($this->getValues() as $_item) : ?> +groupPriceControl.addItem('<?php echo $_item['website_id']; ?>', '<?php echo $_item['cust_group']; ?>', '<?php echo sprintf('%.2f', $_item['price']); ?>', <?php echo (int)!empty($_item['readonly']); ?>); +<?php endforeach; ?> +<?php if ($_readonly) : ?> +$('<?php echo $_htmlId; ?>_container').up('table').select('button') + .each(groupPriceControl.disableElement); +<?php endif; ?> +//]]> +</script> +</td></tr> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/tier.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/tier.phtml index 13c37b17c23..43c76b81d3c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/tier.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 */ @@ -80,11 +80,11 @@ var tierPriceRowTemplate = '<tr>' <?php endforeach ?> + '</select></td>' + '<td class="nobr"><input class="<?php echo $_htmlClass ?> qty required-entry validate-greater-than-zero" type="text" name="<?php echo $_htmlName ?>[{{index}}][price_qty]" value="{{qty}}" id="tier_price_row_{{index}}_qty" />' - + ' <small class="nobr"><?php echo Mage::helper("Mage_Catalog_Helper_Data")->__("and above")?></small></td>' + + ' <small class="nobr"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__("and above")?></small></td>' + '<td><input class="<?php echo $_htmlClass ?> required-entry <?php echo $_priceValueValidation ?>" type="text" name="<?php echo $_htmlName ?>[{{index}}][price]" value="{{price}}" id="tier_price_row_{{index}}_price" /></td>' + '<td class="last"><input type="hidden" name="<?php echo $_htmlName ?>[{{index}}][delete]" class="delete" value="" id="tier_price_row_{{index}}_delete" />' - + '<button title="<?php echo Mage::helper("Mage_Catalog_Helper_Data")->__("Delete Tier") ?>" type="button" class="scalable delete icon-btn delete-product-option" id="tier_price_row_{{index}}_delete_button" onclick="return tierPriceControl.deleteItem(event);">' - + '<span><?php echo Mage::helper("Mage_Catalog_Helper_Data")->__("Delete") ?></span></button></td>' + + '<button title="<?php echo Mage::helper('Mage_Catalog_Helper_Data')->__("Delete Tier") ?>" type="button" class="scalable delete icon-btn delete-product-option" id="tier_price_row_{{index}}_delete_button" onclick="return tierPriceControl.deleteItem(event);">' + + '<span><span><span><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__("Delete") ?></span></span></span></button></td>' + '</tr>'; var tierPriceControl = { diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/serializer.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/serializer.phtml index 00d66f8c154..cf461700366 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/serializer.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/config.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/config.phtml index 409a3a0749a..3af9eba4ce8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/config.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ ?> @@ -72,7 +72,7 @@ </div> <div class="values-container right"> <label for="__id___label" class="bold"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Attribute Name:') ?></label> - <input id="__id___label" type="text" <?php if ($this->isReadonly()):?> disabled="disabled" <?php endif;?> class="input-text attribute-label required-entry template no-display" value="'{{label}}'" readonly="label" /> + <input id="__id___label" type="text" <?php if ($this->isAttributesConfigurationReadonly()): ?> disabled="disabled" <?php endif;?> class="input-text attribute-label required-entry template no-display" value="'{{label}}'" readonly="label" /> <input id="__id___label_use_default" type="checkbox" value="1" " checked="use_default" class="attribute-use-default-label"> <label for="__id___label_use_default"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Use default')?> ('{{store_label}}')</label> <ul class="attribute-values"> @@ -87,17 +87,17 @@ <div class="attribute-values-container-main"> <div class="attribute-values-container left"> <?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Price:') ?> - <input id="__id___pricing" type="text" <?php if ($this->isReadonly() || $this->getCanEditPrice() === false):?> disabled="disabled" <?php endif;?> class="input-text attribute-price validate-number template no-display" value="'{{pricing_value}}'"/> + <input id="__id___pricing" type="text" <?php if ($this->isAttributesPricesReadonly() || $this->getCanEditPrice() === false): ?> disabled="disabled" <?php endif;?> class="input-text attribute-price validate-number template no-display" value="'{{pricing_value}}'"/> </div> <div class="attribute-values-container left"> - <select class="attribute-price-type" id="__id___price_type" <?php if ($this->isReadonly() || $this->getCanEditPrice() === false):?> disabled="disabled" <?php endif;?>> + <select class="attribute-price-type" id="__id___price_type" <?php if ($this->isAttributesPricesReadonly() || $this->getCanEditPrice() === false): ?> disabled="disabled" <?php endif;?>> <option value="0"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Fixed') ?></option> <option value="1"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Percentage') ?></option> </select> </div> <?php if ($this->getShowUseDefaultPrice()):?> <div class="attribute-values-container"> - <input id="__id___default" type="checkbox" <?php if ($this->isReadonly() || $this->getCanEditPrice() === false):?> disabled="disabled" <?php endif;?> class="attribute-use-default-value"> <label for="__id___default" class="normal"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Use Default Value') ?></label> + <input id="__id___default" type="checkbox" <?php if ($this->isAttributesPricesReadonly() || $this->getCanEditPrice() === false): ?> disabled="disabled" <?php endif;?> class="attribute-use-default-value"> <label for="__id___default" class="normal"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Use Default Value') ?></label> </div> <?php endif;?> <?php else : ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/websites.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/websites.phtml index e68873d54a0..721bd19a37f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/websites.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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,6 +38,7 @@ </li> </ul> <?php endif; ?> + <?php echo $this->getHintHtml() ?> <?php foreach ($this->getWebsiteCollection() as $_website): ?> <div> <div class="website-name"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/helper/gallery.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/helper/gallery.phtml index f956dfbefa8..f1aa4f26ad7 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/helper/gallery.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/helper/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/js.phtml index 30495e2ca3f..12f3e401f3c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/price.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/price.phtml index 67a04d5e95e..f0bb82f09f5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/price.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/price.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) */ ?> @@ -213,13 +213,13 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> </span> </span> <span class="price-including-tax"> - <span class="label"><?php echo $_taxHelper->__('Incl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Incl. Tax:') ?></span> <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> </span> @@ -245,7 +245,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> </span> @@ -275,7 +275,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> </span> @@ -305,7 +305,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPrice, $_storeId, true, false) ?> </span> @@ -316,7 +316,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax </span> <?php endforeach; ?> <span class="price-including-tax"> - <span class="label"><?php echo $_taxHelper->__('Incl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Incl. Tax:') ?></span> <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> </span> @@ -334,7 +334,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPrice, $_storeId, true, false) ?> </span> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/alert.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/alert.phtml index 07931d0e595..d1843d7c9f9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/alert.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/alert.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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/inventory.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/inventory.phtml index cd1bf4009b0..99f450f03a5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/inventory.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/widget/chooser/container.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/widget/chooser/container.phtml index beaccd822dc..89af4ea1bb9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/widget/chooser/container.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalog/wysiwyg/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/wysiwyg/js.phtml index 926b55367dc..96c56085bb4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/wysiwyg/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/catalogsearch.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalogsearch.xml index 1ccc658f2ed..f39405ee7f7 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalogsearch.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalogsearch.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/code/core/Mage/Adminhtml/view/adminhtml/cms.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms.xml index 94669268012..8b5fb088421 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content.phtml index 7466ac1ac63..3447515cf04 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content.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/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/files.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/files.phtml index d99fb9c65c5..f43abd58dee 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/files.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/files.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/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/newfolder.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/newfolder.phtml index 022cea673ef..10af59bd1ab 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/newfolder.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/newfolder.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/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/uploader.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/uploader.phtml index 8d89251209d..14c425fe3bb 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/uploader.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/uploader.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) */ ?> @@ -31,9 +31,6 @@ * @see Mage_Adminhtml_Block_Cms_Wysiwyg_Images_Content_Uploader */ ?> - -<?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->getTranslatorScript() ?> - <div id="<?php echo $this->getHtmlId() ?>" class="uploader"> <div class="buttons"> <div id="<?php echo $this->getHtmlId() ?>-install-flash" style="display:none"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/js.phtml index 7f05ec014aa..956c8851298 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/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/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/tree.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/tree.phtml index cfe7c6bc73b..f08a05fac89 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/tree.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/tree.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/code/core/Mage/Adminhtml/view/adminhtml/cms/page/edit/form/renderer/content.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/page/edit/form/renderer/content.phtml index 83479460834..41bff8988ed 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/page/edit/form/renderer/content.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/page/edit/form/renderer/content.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/code/core/Mage/Adminhtml/view/adminhtml/customer.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer.xml index 8462f32f13c..538c9f3b53b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ --> @@ -57,47 +57,70 @@ <adminhtml_customer_wishlist> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist" name="customer.wishlist.edit.tab" output="toHtml" /> </adminhtml_customer_wishlist> - + <adminhtml_customer_orders> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Orders" name="adminhtml.customer.edit.tab.orders"/> </block> </adminhtml_customer_orders> - + <adminhtml_customer_carts> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Carts" name="admin.customer.carts"/> </block> </adminhtml_customer_carts> - + <adminhtml_customer_viewcart> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_View_Cart" name="admin.customer.view.cart"/> </block> </adminhtml_customer_viewcart> - + <adminhtml_customer_viewwishlist> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_View_Wishlist" name="admin.customer.view.wishlist"/> </block> </adminhtml_customer_viewwishlist> - + <adminhtml_customer_lastorders> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_View_Orders" name="admin.customer.lastorders"/> </block> </adminhtml_customer_lastorders> - + <adminhtml_customer_productreviews> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Reviews" name="admin.customer.reviews"/> </block> </adminhtml_customer_productreviews> - + <adminhtml_customer_producttags> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Tag" name="admin.customer.tags"/> </block> </adminhtml_customer_producttags> - + + <adminhtml_customer_taggrid> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Tag" name="admin.customer.tags"/> + </block> + </adminhtml_customer_taggrid> + + <adminhtml_customer_newsletter> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter_Grid" name="admin.customer.newsletter.grid"/> + </block> + </adminhtml_customer_newsletter> + + <adminhtml_customer_grid> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Customer_Grid" name="admin.customer.grid"/> + </block> + </adminhtml_customer_grid> + + <adminhtml_customer_cart> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Cart" name="admin.customer.view.edit.cart" /> + </block> + </adminhtml_customer_cart> </layout> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/js.phtml index 90a187665fe..24e7c31dc6a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/account/form/renderer/group.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/account/form/renderer/group.phtml new file mode 100644 index 00000000000..36684c8912f --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/account/form/renderer/group.phtml @@ -0,0 +1,52 @@ +<?php +/** + * 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) + */ +?> +<?php +$_element = $this->getElement(); +$_note = $_element->getNote(); +$_trId = $_element->getHtmlContainerId(); +$_class = $_element->getFieldsetHtmlClass(); +?> +<?php if (!$_element->getNoDisplay()): ?> +<tr<?php if ($_trId): ?> id="<?php echo $_trId; ?>"<?php endif; ?>> + <?php if ($_element->getType() == 'hidden'): ?> + <td colspan="2" class="hidden"><?php echo trim($_element->getElementHtml()); ?></td> + <?php else: ?> + <td class="label<?php echo $_class ? " {$_class}-label" : ''; ?>"><?php echo trim($_element->getLabelHtml()); ?></td> + <td class="<?php echo $_element->hasValueClass() ? $_element->getValueClass() : 'value'; ?><?php echo $_class ? " {$_class}-value" : ''; ?>"> + <?php echo trim($_element->getElementHtml()); ?> + <?php if ($this->getDisableAutoGroupChangeAttribute()): ?> + <br/> + <input id="<?php echo $this->escapeHtml($this->getDisableAutoGroupChangeCheckboxElementId()); ?>" name="<?php echo $this->escapeHtml($this->getDisableAutoGroupChangeCheckboxElementName()); ?>" type="checkbox"<?php if ($this->getDisableAutoGroupChangeCheckboxState() == 'checked') :?> checked="checked"<?php endif; ?> value="1"/> + <label for="<?php echo $this->escapeHtml($this->getDisableAutoGroupChangeCheckboxElementId()); ?>"><?php echo $this->escapeHtml($this->getDisableAutoGroupChangeCheckboxLabel()); ?></label> + <?php endif; ?> + <?php if ($_note): ?> + <p class="note<?php echo $_class ? " {$_class}-note" : ''; ?>" id="note_<?php echo $_element->getId(); ?>"><span><?php echo $_note; ?></span></p> + <?php endif ?> + </td> + <?php endif; ?> +</tr> +<?php endif; ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/view/grid/item.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/view/grid/item.phtml index 7fce785e0de..7dab73d693d 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/view/grid/item.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/customer/online.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/online.phtml index 73361bed99f..33d669557d0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/online.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/customer/sales/order/create/address/form/renderer/vat.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/sales/order/create/address/form/renderer/vat.phtml new file mode 100644 index 00000000000..89299ce938c --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/sales/order/create/address/form/renderer/vat.phtml @@ -0,0 +1,52 @@ +<?php +/** + * 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) + */ +?> +<?php +$_element = $this->getElement(); +$_note = $_element->getNote(); +$_trId = $_element->getHtmlContainerId(); +$_class = $_element->getFieldsetHtmlClass(); +$_validateButton = $this->getValidateButton(); +?> +<?php if (!$_element->getNoDisplay()): ?> +<tr<?php if($_trId): ?> id="<?php echo $_trId; ?>"<?php endif; ?>> + <?php if ($_element->getType()=='hidden'): ?> + <td colspan="2" class="hidden"><?php echo trim($_element->getElementHtml()); ?></td> + <?php else: ?> + <td class="label<?php echo $_class ? " {$_class}-label" : ''?>"><?php echo trim($_element->getLabelHtml()); ?></td> + <td class="<?php echo $_element->hasValueClass() ? $_element->getValueClass() : 'value'; ?><?php echo $_class ? " {$_class}-value" : ''; ?>"> + <?php echo trim($_element->getElementHtml()); ?> + <?php if ($_note): ?> + <p class="note<?php echo $_class ? " {$_class}-note" : ''; ?>" id="note_<?php echo $_element->getId(); ?>"><span><?php echo $_note; ?></span></p> + <?php endif; ?> + <div class="validate-vat"> + <?php echo $_validateButton->toHtml(); ?> + </div> + </td> + <?php endif; ?> + +</tr> +<?php endif; ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/system/config/validatevat.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/system/config/validatevat.phtml new file mode 100644 index 00000000000..f31b51554e1 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/system/config/validatevat.phtml @@ -0,0 +1,65 @@ +<?php +/** + * 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) + */ +?> +<?php +/** + * @see Mage_Adminhtml_Block_Customer_System_Config_Validatevat + */ +?> +<script type="text/javascript"> +//<![CDATA[ + function validateVat() { + var elem = $('<?php echo $this->getHtmlId() ?>'); + + params = { + country: $('general_store_information_merchant_country').value, + vat: $('general_store_information_merchant_vat_number').value + }; + + new Ajax.Request('<?php echo $this->getAjaxUrl() ?>', { + parameters: params, + onSuccess: function(response) { + result = '<?php echo $this->__('VAT Number is Invalid') ?>'; + try { + response = response.responseText; + if (response == 1) { + result = '<?php echo $this->__('VAT Number is Valid') ?>'; + elem.removeClassName('fail').addClassName('success') + } else { + elem.removeClassName('success').addClassName('fail') + } + } catch (e) { + elem.removeClassName('success').addClassName('fail') + } + $('validation_result').update(result); + } + }); + } +//]]> +</script> +<button onclick="javascript:validateVat(); return false;" class="scalable" type="button" id="<?php echo $this->getHtmlId() ?>"> + <span id="validation_result"><?php echo $this->escapeHtml($this->getButtonLabel()) ?></span> +</button> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/addresses.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/addresses.phtml index ea1892f5919..ced2f290bac 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/addresses.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ ?> @@ -406,8 +406,12 @@ addressesModel.prototype = { var html = this.itemContentTemplate.evaluate(data); html = html.replace(new RegExp('(<br\\s*/?>\\s*){2,}','img'),'<br/>'); html = html.replace(new RegExp('<br\\s*/?>(\\s*,){1,}\\s*<br\\s*/?>','ig'),'<br/>'); + html = html.replace(new RegExp('<br\\s*/?>(\\s*,){1,}(.*)<br\\s*/?>','ig'),'<br/>$2<br/>'); + html = html.replace(new RegExp('<br\\s*/?>(.*?)(,\\s*){1,}<br\\s*/?>','ig'),'<br/>$1<br/>'); + html = html.replace(new RegExp('<br\\s*/?>(.*?)(,\\s*){2,}(.*?)<br\\s*/?>','ig'),'<br/>$1, $3<br/>'); html = html.replace(new RegExp('t:\\s*<br\\s*/?>','ig'),''); - html = html.replace(new RegExp('f:\\s*$','ig'),''); + html = html.replace(new RegExp('f:\\s*<br\\s*/?>','ig'),''); + html = html.replace(new RegExp('vat:\\s*$','ig'),''); itemContainer[0].innerHTML = html; } } diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/cart.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/cart.phtml index bb337528fa7..671f37952df 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/cart.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/newsletter.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/newsletter.phtml index 1e3ddc990e7..fa2b24de4bf 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/newsletter.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view.phtml index 73f151e3b85..9a61d3e3e33 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view/sales.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view/sales.phtml index 06bff3a25e7..3ab79a2dd9c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view/sales.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/wishlist.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/wishlist.phtml index d256d33ef2b..f6b2343f259 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/wishlist.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph.phtml index 673ed1ada35..aac9ce29fec 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph/disabled.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph/disabled.phtml index 5acb9197f1c..3d6dc96e00e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph/disabled.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/dashboard/grid.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/grid.phtml index 305a2ceb247..a636859def2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/grid.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/dashboard/index.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/index.phtml index 588504bd14b..1f302d5e2cf 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/index.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/dashboard/salebar.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/salebar.phtml index ca849d1ec2d..c41191acae6 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/salebar.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/dashboard/searches.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/searches.phtml index 02928d05340..46fd0230011 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/searches.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/dashboard/store/switcher.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/store/switcher.phtml index 52c1d4daeb7..d991bd23a4c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/store/switcher.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ ?> -<p class="switcher"><label for="store_switcher"><?php echo $this->__('View Statistics For') ?>:</label> +<p class="switcher"><label for="store_switcher"><?php echo $this->__('View Statistics For:') ?></label> +<?php echo $this->getHintHtml() ?> <select name="store_switcher" id="store_switcher" class="left-col-block" onchange="return switchStore(this);"> <option value=""><?php echo $this->__('All Websites') ?></option> <?php foreach ($this->getWebsiteCollection() as $_website): ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/totalbar.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/totalbar.phtml index f3c124c8312..e479afbad80 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/totalbar.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/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/code/core/Mage/Adminhtml/view/adminhtml/dataflow.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/dataflow.xml index 0d9c0ae00d9..0ea564b913a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dataflow.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/email/order/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/email/order/items.phtml index 49e84c84da1..1fc426f7c0b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/email/order/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/main.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/main.xml index 59a4e85a0ff..76a1a9e968c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/main.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ @@ -56,6 +56,8 @@ Default layout, loads most of the pages <block type="Mage_Adminhtml_Block_Page_Head" name="head" as="head" template="page/head.phtml"> <action method="setTitle" translate="title"><title>Magento Admin</title></action> <action method="addJs"><file>prototype/prototype.js</file></action> + <action method="addJs"><file>mage/adminhtml/fix-extjs-defer.js</file><params/><if/><condition>can_load_ext_js</condition></action> + <action method="addJs"><file>mage/adminhtml/fix-extjs-defer-before.js</file><params/><if/><condition>can_load_ext_js</condition></action> <action method="addJs"><file>prototype/window.js</file></action> <action method="addJs"><file>scriptaculous/builder.js</file></action> <action method="addJs"><file>scriptaculous/effects.js</file></action> @@ -110,6 +112,8 @@ Default layout, loads most of the pages <!--<update handle="formkey"/> this won't work, see the try/catch and a jammed exception in Mage_Core_Model_Layout::createBlock() --> <block type="Mage_Core_Block_Template" name="formkey" as="formkey" template="Mage_Adminhtml::admin/formkey.phtml"/> + + <!-- deprecated since 1.7.0.0 see Mage_Page_Block_Js_Translate --> <block type="Mage_Page_Block_Js_Translate" name="js_translate" as="js_translate" template="Mage_Adminhtml::page/js/translate.phtml"/> <block type="Mage_Core_Block_Text_List" name="left" as="left"/> <block type="Mage_Core_Block_Text_List" name="content" as="content"/> @@ -235,10 +239,24 @@ Base preview layout </block> </adminhtml_dashboard_productsviewed> + <adminhtml_index_login> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Template" name="content" template="admin/login.phtml"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info" /> + </block> + </block> + </adminhtml_index_login> + + <adminhtml_index_forgotpassword> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Template" name="content" template="admin/forgotpassword.phtml"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info" /> + </block> + </block> + </adminhtml_index_forgotpassword> <!-- Empty hanle for ajax response etc. --> <empty> </empty> - </layout> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/media/editor.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/media/editor.phtml index 9afe134cc4f..0eb6f7f13c1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/media/editor.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/media/editor.phtml @@ -20,14 +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) */ ?> <?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->includeScript('lib/flex.js') ?> <?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->includeScript('lib/FABridge.js') ?> <?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->includeScript('mage/adminhtml/image.js') ?> -<?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->getTranslatorScript() ?> <div id="<?php echo $this->getHtmlId() ?>" class="editor" style="width:100%; height:100%;"> <div class="buttons" style="margin-bottom: 20px;"> <?php echo $this->getRotatecwButtonHtml() ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/media/uploader.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/media/uploader.phtml index 65422810a0e..21a608bb47f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/media/uploader.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/media/uploader.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,8 +33,6 @@ <?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->includeScript('lib/flex.js') ?> <?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->includeScript('mage/adminhtml/flexuploader.js') ?> <?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->includeScript('lib/FABridge.js') ?> -<?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->getTranslatorScript() ?> - <div id="<?php echo $this->getHtmlId() ?>" class="uploader"> <div class="buttons"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter.xml index c6f84dff7bd..b8cda057b29 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/iframeswitcher.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/iframeswitcher.phtml index ba7fc16faac..f9182aff433 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/iframeswitcher.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/iframeswitcher.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) */ ?> @@ -41,7 +41,7 @@ <?php if (!Mage::app()->isSingleStoreMode()) :?> <p class="switcher"> <?php echo $this->getChildHtml('store_switcher') ?> - <button class="button" onclick="preview();"><span><?php echo $this->__('Preview'); ?></span></button> + <button class="button" onclick="preview();"><span><span><span><?php echo $this->__('Preview'); ?></span></span></span></button> </p> <?php endif;?> </div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/store.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/store.phtml index 713a9537cc3..06cd2bb8f7c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/store.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/store.phtml @@ -20,13 +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) */ ?> <?php if ($websites = $this->getWebsites()): ?> -<label for="store_switcher"><?php echo $this->__('Choose Store View') ?>:</label> +<label for="store_switcher"><?php echo $this->__('Choose Store View:') ?></label> <select name="store_switcher" id="store_switcher"> <?php foreach ($websites as $website): ?> <?php $showWebsite=false; ?> @@ -49,6 +49,7 @@ <?php endforeach; ?> <?php endforeach; ?> </select> +<?php echo $this->getHintHtml() ?> <script type="text/javascript"> //<![CDATA[ Event.observe($('store_switcher'), 'change', function(event) { diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/problem/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/problem/list.phtml index 0c393ebc518..a8b0c3aab96 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/problem/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/problem/list.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/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/edit.phtml index b2fbc3948f5..36a7cf63c8c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/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) */ /* @var $this Mage_Adminhtml_Block_Newsletter_Queue_Edit */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/list.phtml index 5e42e56cca2..7d94fde3c5e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/list.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/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/preview.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/preview.phtml index 59c5469ca1c..c5ff4ba60b9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/preview.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/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/code/core/Mage/Adminhtml/view/adminhtml/newsletter/subscriber/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/subscriber/list.phtml index 31ee9eaf35c..b23ba77d167 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/subscriber/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/subscriber/list.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) */ ?> @@ -41,7 +41,7 @@ <option value="<?php echo $_queue['value'] ?>"><?php echo $_queue['label'] ?> #<?php echo $_queue['value'] ?></option> <?php endforeach; ?> </select> - <button class="scalable" onclick="subscriberController.addToQueue();"><span><?php echo Mage::helper('Mage_Newsletter_Helper_Data')->__('Add to Queue'); ?></span></button> + <button class="scalable" onclick="subscriberController.addToQueue();"><span><span><span><?php echo Mage::helper('Mage_Newsletter_Helper_Data')->__('Add to Queue'); ?></span></span></span></button> </div> <?php endif ?> <script type="text/javascript"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/edit.phtml index 34bcce405cd..518a23e8417 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/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) */ /* @var $this Mage_Adminhtml_Block_Newsletter_Template_Edit */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/list.phtml index be2cb3de9a1..cdfb6787034 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/list.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 @@ <tr> <td style="width:50%;"><h3 class="icon-head head-newsletter-list"><?php echo $this->getHeaderText() ?></h3></td> <td class="form-buttons"> - <button class="scalable add" onclick="window.location='<?php echo $this->getCreateUrl() ?>'"><span><?php echo Mage::helper('Mage_Newsletter_Helper_Data')->__('Add New Template'); ?></span></button> + <button class="scalable add" onclick="window.location='<?php echo $this->getCreateUrl() ?>'"><span><span><span><?php echo Mage::helper('Mage_Newsletter_Helper_Data')->__('Add New Template'); ?></span></span></span></button> </td> </tr> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/preview.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/preview.phtml index 59c5469ca1c..c5ff4ba60b9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/preview.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/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/code/core/Mage/Adminhtml/view/adminhtml/notification/baseurl.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/baseurl.phtml index 761a9b0c790..b662d2c12a1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/baseurl.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/baseurl.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/code/core/Mage/Adminhtml/view/adminhtml/notification/security.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/security.phtml index 334c3fbd98f..b1d6d4d8450 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/security.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/security.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/code/core/Mage/Adminhtml/view/adminhtml/notification/survey.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/survey.phtml index 24b04cfc1e8..903bdd51b49 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/survey.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/survey.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/code/core/Mage/Adminhtml/view/adminhtml/notification/toolbar.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/toolbar.phtml index 3fa5fc3ba1c..7c5b2e18365 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/toolbar.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/toolbar.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) */ ?> @@ -59,10 +59,7 @@ $latestNoticeUrl = $this->getLatestNoticeUrl(); ?> <?php /* - <span class="f-right"><?php echo $this->__('You have %s unread message(s). <a href="%s">Go to messages inbox</a>.', - $msgStats, - $this->getNoticesInboxUrl() - );?></span> + <span class="f-right"><?php echo $this->__('You have %s unread message(s). <a href="%s">Go to messages inbox</a>.', $msgStats, $this->getNoticesInboxUrl());?></span> */?> <span class="f-right"> @@ -70,12 +67,7 @@ <?php echo $this->__('You have %s unread message(s).', $msgStats) ?> <a href="<?php echo $this->getNoticesInboxUrl() ?>"><?php echo $goToBoxMessage ?></a> </span> <?php /* ********** temporary commented - <span class="f-right"><?php echo $this->__('You have %s, %s and %s unread messages. <a href="%s">Go to messages inbox</a>.', - '<span class="critical"><strong>'.$this->getCriticalCount().'</strong> '.$this->__('critical').'</span>', - '<strong>'.$this->getMajorCount().'</strong> '.$this->__('major'), - '<strong>'.$this->getMinorCount().'</strong> '.$this->__('minor'), - $this->getNoticesInboxUrl() - );?></span> + <span class="f-right"><?php echo $this->__('You have %s, %s and %s unread messages. <a href="%s">Go to messages inbox</a>.', '<span class="critical"><strong>'.$this->getCriticalCount().'</strong> '.$this->__('critical').'</span>', '<strong>'.$this->getMajorCount().'</strong> '.$this->__('major'), '<strong>'.$this->getMinorCount().'</strong> '.$this->__('minor'), $this->getNoticesInboxUrl());?></span> ******** */?> <?php if ($this->isMessageWindowAvailable()): ?> <strong class="label clickable" onclick="openMessagePopup()"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/window.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/window.phtml index 4e3b40c1bb0..2545eed4a71 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/window.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/window.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/code/core/Mage/Adminhtml/view/adminhtml/page/footer.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/footer.phtml index 14e81f6bf9f..5a828b19d82 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/footer.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/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/code/core/Mage/Adminhtml/view/adminhtml/page/head.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/head.phtml index 3c8c18c2683..4f1bc8bec20 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/head.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/head.phtml @@ -20,13 +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) */ ?> <meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>"/> -<?php if($this->getCanLoadTinyMce()): ?> -<?php endif; ?> <title><?php echo htmlspecialchars(html_entity_decode($this->getTitle())) ?></title> <link rel="icon" href="<?php echo $this->getSkinUrl('Mage_Page::favicon.ico') ?>" type="image/x-icon"/> <link rel="shortcut icon" href="<?php echo $this->getSkinUrl('Mage_Page::favicon.ico') ?>" type="image/x-icon"/> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/page/header.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/header.phtml index 7b3e67d0bfc..625d5500d1e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/header.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/header.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/code/core/Mage/Adminhtml/view/adminhtml/page/js/calendar.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/calendar.phtml index 7b3b0a19bc8..69a4a69a368 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/calendar.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/calendar.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) */ // no notice of license for now diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/translate.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/translate.phtml index 002f3e73a77..99ebce66f7e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/translate.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/translate.phtml @@ -20,10 +20,17 @@ * * @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) */ - +?> + +<?php +/** + * @var $this Mage_Page_Block_Js_Translate + */ +?> +<?php $_data = array( 'Please select an option.' => $this->__('Please select an option.'), 'This is a required field.' => $this->__('This is a required field.'), @@ -52,10 +59,7 @@ $_data = array( 'Please enter valid password.' => $this->__('Please enter valid password.'), '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...'), - /*'' => $this->__(''), - '' => $this->__(''), - '' => $this->__(''),*/ + 'Please wait, loading...' => $this->__('Please wait, loading...') ); ?> <script type="text/javascript"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/page/menu.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/menu.phtml index 3287331e35c..fae8bb3785a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/menu.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/menu.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 @@ <?php function drawMenuLevel($_menu, $_level=0) { ?> <ul <?php if(!$_level): ?>id="nav"<?php endif ?>> <?php foreach ($_menu as $_item): ?> - <li <?php if(!empty($_item['children'])): ?>onmouseover="Element.addClassName(this,'over')" onmouseout="Element.removeClassName(this,'over')"<?php endif ?> class=" <?php echo (!$_level && !empty($_item['active']))?' active':'' ?> <?php echo !empty($_item['children'])?' parent':'' ?><?php echo (!empty($_level) && !empty($_item['last']))?' last':'' ?> level<?php echo $_level ?>"> <a href="<?php echo $_item['url'] ?>" <?php if(!empty($_item['title'])): ?>title="<?php echo $_item['title'] ?>"<?php endif ?> <?php if(!empty($_item['click'])): ?>onclick="<?php echo $_item['click']; ?>"<?php endif ?> class="<?php echo ($_level===0 && !empty($_item['active']))?'active':'' ?>"><span><?php echo $_item['label'] ?><?php if(!$_level): ?><?php endif ?></span></a> + <li <?php if(!empty($_item['children'])): ?>onmouseover="Element.addClassName(this,'over')" onmouseout="Element.removeClassName(this,'over')"<?php endif ?> class=" <?php echo (!$_level && !empty($_item['active']))?' active':'' ?> <?php echo !empty($_item['children'])?' parent':'' ?><?php echo (!empty($_level) && !empty($_item['last']))?' last':'' ?> level<?php echo $_level ?>"> <a href="<?php echo $_item['url'] ?>" <?php if(!empty($_item['title'])): ?>title="<?php echo $_item['title'] ?>"<?php endif ?> <?php if(!empty($_item['click'])): ?>onclick="<?php echo $_item['click']; ?>"<?php endif ?> class="<?php echo ($_level===0 && !empty($_item['active']))?'active':'' ?>"><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->escapeHtml($_item['label']); ?><?php if(!$_level): ?><?php endif ?></span></a> <?php if(!empty($_item['children'])): ?> <?php drawMenuLevel($_item['children'], $_level+1); ?> <?php endif; ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/page/notices.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/notices.phtml index 3fb87360c72..04c26a984cd 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/notices.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/notices.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 @@ <noscript> <div class="noscript"> <div class="noscript-inner"> - <p><strong><?php echo $this->__('We detected that your JavaScript seem to be disabled.'); ?></strong></p> + <p><strong><?php echo $this->__('JavaScript seems to be disabled in your browser.'); ?></strong></p> <p><?php echo $this->__('You must have JavaScript enabled in your browser to utilize the functionality of this website.'); ?></p> </div> </div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/role_users_grid_js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/role_users_grid_js.phtml index 012d656e22c..f35308cc61a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/role_users_grid_js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/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/code/core/Mage/Adminhtml/view/adminhtml/permissions/roleinfo.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/roleinfo.phtml index eae37f6b9e1..9244d325992 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/roleinfo.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/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/code/core/Mage/Adminhtml/view/adminhtml/permissions/roles.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/roles.phtml index 4713c7b0d10..cebb8dcb143 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/roles.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/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 @@ <tr> <td style="width:50%;"><h3 class="icon-head head-permissions-role"><?php echo $this->__('Roles') ?></h3></td> <td class="form-buttons"> - <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><?php echo $this->__('Add New Role') ?></span></button> + <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><span><span><?php echo $this->__('Add New Role') ?></span></span></span></button> </td> </tr> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesedit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesedit.phtml index 8006369fa57..ca389b990bd 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesedit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/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/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesusers.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesusers.phtml index 3727f5c4ac9..e09eb58a422 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesusers.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/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/code/core/Mage/Adminhtml/view/adminhtml/permissions/user_roles_grid_js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/user_roles_grid_js.phtml index 57a60860f8e..cc042e99e85 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/user_roles_grid_js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/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/code/core/Mage/Adminhtml/view/adminhtml/permissions/userinfo.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/userinfo.phtml index c9be39d10b1..5290bbcf433 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/userinfo.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/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/code/core/Mage/Adminhtml/view/adminhtml/permissions/users.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/users.phtml index da6c6b1ade6..f4df96e9efe 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/users.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/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 @@ <tr> <td style="width:50%;"><h3><?php echo $this->__('Users') ?></h3></td> <td class="a-right"> - <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><?php echo $this->__('Add New User') ?></span></button> + <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><span><span><?php echo $this->__('Add New User') ?></span></span></span></button> </td> </tr> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/poll/answers/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/poll/answers/list.phtml index dfb31fa93d7..d18db3cdb85 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/poll/answers/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/poll/answers/list.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/code/core/Mage/Adminhtml/view/adminhtml/promo.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/promo.xml index 7502cf2ecd0..0db056d5f49 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/promo.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ --> @@ -73,14 +73,25 @@ <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Conditions" name="promo_quote_edit_tab_conditions"/> <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Actions" name="promo_quote_edit_tab_actions"/> <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Labels" name="promo_quote_edit_tab_labels"/> + <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons" name="promo_quote_edit_tab_coupons"> + <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Form" name="promo_quote_edit_tab_coupons_form"/> + <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid" name="promo_quote_edit_tab_coupons_grid"/> + </block> <action method="addTab"><name>main_section</name><block>promo_quote_edit_tab_main</block></action> <action method="addTab"><name>conditions_section</name><block>promo_quote_edit_tab_conditions</block></action> <action method="addTab"><name>actions_section</name><block>promo_quote_edit_tab_actions</block></action> <action method="addTab"><name>labels_section</name><block>promo_quote_edit_tab_labels</block></action> + <action method="addTab"><name>coupons_section</name><block>promo_quote_edit_tab_coupons</block></action> </block> + <block type="Mage_Adminhtml_Block_Template" template="promo/salesrulejs.phtml" name="promo_quote_edit_jsinit"/> </reference> <reference name="content"> <block type="Mage_Adminhtml_Block_Promo_Quote_Edit" name="promo_quote_edit"></block> </reference> </adminhtml_promo_quote_edit> + <adminhtml_promo_quote_couponsgrid> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid" name="promo_quote_edit_tab_coupons_grid" /> + </block> + </adminhtml_promo_quote_couponsgrid> </layout> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/fieldset.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/fieldset.phtml index 2327f4ebdd2..403cf9e7ba2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/fieldset.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/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/code/core/Mage/Adminhtml/view/adminhtml/promo/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/form.phtml index 0690bcb2bcd..1dc278b7ddf 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/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/code/core/Mage/Adminhtml/view/adminhtml/promo/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/js.phtml index e185569e585..119a01a527c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/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/code/core/Mage/Adminhtml/view/adminhtml/promo/rules.js b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/rules.js index e0c06814446..1b1ee89e24b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/rules.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/rules.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/view/adminhtml/promo/salesrulejs.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/salesrulejs.phtml new file mode 100644 index 00000000000..ae07da53ff5 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/salesrulejs.phtml @@ -0,0 +1,113 @@ +<?php +/** + * 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) + */ +?> +<script type="text/javascript"> +//<![CDATA[ +var couponTypeSpecific = '<?php echo Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC ?>'; +var tmpButtonsActionsStorage = []; + +function disableEnableCouponsTabContent(disable) { + var containerId = 'promo_catalog_edit_tabs_coupons_section_content'; + if($(containerId)){ + var dataFields = $(containerId).select('input', 'select', 'textarea', 'button'); + for(var i = 0; i < dataFields.length; i++) { + disable ? dataFields[i].disable().addClassName('disabled') + : dataFields[i].enable().removeClassName('disabled'); + } + } + disable ? $('rule_coupon_code').enable() : $('rule_coupon_code').disable(); +} + +function handleCouponsTabContentActivity() { + disableEnableCouponsTabContent(!$('rule_use_auto_generation').checked); +} + +function handleCouponTypeChange() { + $('rule_coupon_type').observe('change', function() { + var disable = $('rule_coupon_type').value != couponTypeSpecific; + if (!disable) { + disable = !$('rule_use_auto_generation').checked; + } + disableEnableCouponsTabContent(disable); + }); +} + +function refreshCouponCodesGrid(grid, gridMassAction, transport) { + grid.reload(); +} + +function generateCouponCodes(idPrefix, generateUrl, grid) { + $(idPrefix + 'information_fieldset').removeClassName('ignore-validate'); + var validationResult = $(idPrefix + 'information_fieldset').select('input', + 'select', 'textarea').collect( function(elm) { + return Validation.validate(elm, { + useTitle :false, + onElementValidate : function() { + } + }); + }).all(); + $(idPrefix + 'information_fieldset').addClassName('ignore-validate'); + + if (!validationResult) { + return; + } + var elements = $(idPrefix + 'information_fieldset').select('input', 'select', 'textarea'); + + elements = elements.concat( + $$('#rule_uses_per_coupon'), + $$('#rule_uses_per_customer'), + $$('#rule_to_date') + ); + + var params = Form.serializeElements(elements, true); + params.form_key = FORM_KEY; + $('messages').update(); + var couponCodesGrid = eval(grid); + new Ajax.Request(generateUrl, { + parameters :params, + method :'post', + onComplete : function (transport, param){ + var response = false; + if (transport && transport.responseText) { + response = eval('(' + transport.responseText + ')'); + } + if (couponCodesGrid) { + couponCodesGrid.reload(); + } + if (response && response.messages) { + $('messages').update(response.messages); + } + if (response && response.error) { + alert(response.error); + } + } + }); +} + +document.observe("dom:loaded", handleCouponsTabContentActivity); +document.observe("dom:loaded", handleCouponTypeChange); +//]]> +</script> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/detailed.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/detailed.phtml index 326246b5f12..2e7a3e66d1b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/detailed.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/detailed.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/code/core/Mage/Adminhtml/view/adminhtml/rating/options.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/options.phtml index 16f00aeec54..fb644635fb7 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/options.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/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/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/detailed.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/detailed.phtml index d164d4f223f..25a30e55a75 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/detailed.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/detailed.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/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/summary.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/summary.phtml index cba500ee8fb..995a5bc749e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/summary.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/summary.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/code/core/Mage/Adminhtml/view/adminhtml/report.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/report.xml index 1ca1aadea36..d8ead103728 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ --> @@ -32,4 +32,24 @@ <block type="Mage_Adminhtml_Block_Report_Refresh_Statistics" template="report/refresh/statistics.phtml" name="sales.report.refreshstatistics" /> </reference> </adminhtml_report_statistics_index> + <adminhtml_report_product_viewed> + <reference name="messages"> + <action method="addNotice" translate="message"> + <message>This report depends on timezone configuration. Once timezone is changed, the lifetime statistics need to be refreshed.</message> + </action> + </reference> + <reference name="content"> + <block type="Mage_Adminhtml_Block_Report_Product_Viewed" template="report/grid/container.phtml" name="product.report.grid.container"> + <block type="Mage_Adminhtml_Block_Store_Switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher"> + <action method="setStoreVarName"><var_name>store_ids</var_name></action> + </block> + <block type="Mage_Adminhtml_Block_Report_Filter_Form" name="grid.filter.form"> + <action method="setFieldVisibility"> + <field>report_type</field> + <visibility>0</visibility> + </action> + </block> + </block> + </reference> + </adminhtml_report_product_viewed> </layout> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid.phtml index da75d61c815..9d8497b81bf 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/report/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/code/core/Mage/Adminhtml/view/adminhtml/report/grid/container.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid/container.phtml index bd98e3e9311..1f2f8230172 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid/container.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/report/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) */ ?> @@ -42,6 +42,7 @@ <?php echo $this->getGridHtml() ?> </div> <script type="text/javascript"> +//<![CDATA[ function filterFormSubmit() { var filters = $$('#filter_form input', '#filter_form select'); var elements = []; @@ -53,4 +54,5 @@ setLocation('<?php echo $this->getFilterUrl(); ?>filter/'+encode_base64(Form.serializeElements(elements))+'/'); } } +//]]> </script> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/report/refresh/statistics.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/report/refresh/statistics.phtml index c4dc32a97b6..683776eb10e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report/refresh/statistics.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher.phtml index aec031ccbb2..08ea6a430fb 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 @@ */ ?> <?php if ($this->isShow()): ?> -<p class="switcher"><label for="store_switcher"><?php echo $this->__('Show Report For') ?>:</label> +<p class="switcher"><label for="store_switcher"><?php echo $this->__('Show Report For:') ?></label> <select name="store_switcher" id="store_switcher" onchange="return switchStore(this);"> <option value=""><?php echo $this->__('All Websites') ?></option> <?php foreach ($this->getWebsiteCollection() as $_website): ?> @@ -55,6 +55,7 @@ <?php endforeach; ?> <?php endforeach; ?> </select> +<?php echo $this->getHintHtml() ?> </p> <script type="text/javascript"> function switchStore(obj){ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher/enhanced.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher/enhanced.phtml index 7e9ff6e8a2c..05f9db477f5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher/enhanced.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher/enhanced.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) */ ?> @@ -31,7 +31,7 @@ ?> <?php if ($this->isShow()): ?> -<p class="switcher"><label for="store_switcher"><?php echo $this->__('Show Report For') ?>:</label> +<p class="switcher"><label for="store_switcher"><?php echo $this->__('Show Report For:') ?></label> <select name="store_switcher" id="store_switcher" onchange="return switchStore(this);"> <option value=""><?php echo $this->__('All Websites') ?></option> <?php foreach ($this->getWebsiteCollection() as $_website): ?> @@ -55,6 +55,7 @@ <?php endforeach; ?> <?php endforeach; ?> </select> +<?php echo $this->getHintHtml() ?> </p> <script type="text/javascript"> function switchStore(obj){ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/report/wishlist.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/report/wishlist.phtml index 6f20cfc887e..6c4532bac30 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report/wishlist.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/report/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/code/core/Mage/Adminhtml/view/adminhtml/review/add.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/review/add.phtml index 57673ff7676..0ddb18ac7b6 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/review/add.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/review/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/code/core/Mage/Adminhtml/view/adminhtml/sales.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales.xml index a9e9207dd20..a3973fc7717 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ --> @@ -917,7 +917,7 @@ <block type="Mage_Adminhtml_Block_Store_Switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher"> <action method="setStoreVarName"><var_name>store_ids</var_name></action> </block> - <block type="Mage_Sales_Block_Adminhtml_Report_Filter_Form" name="grid.filter.form"> + <block type="Mage_Sales_Block_Adminhtml_Report_Filter_Form_Coupon" name="grid.filter.form"> <action method="addReportTypeOption" translate="value"> <key>created_at_order</key> <value>Order Created Date</value> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/name.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/name.phtml index c7c1f4ec3cd..2f6af91b079 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/name.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/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/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/qty.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/qty.phtml index c1ba8e12e3b..fa7706fee94 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/qty.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/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/code/core/Mage/Adminhtml/view/adminhtml/sales/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/renderer/default.phtml index 762b3ffbac0..4d43624ffde 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/address/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/address/form.phtml index dc6ccbab63e..e731d795f83 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/address/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/address/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/comments/view.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/comments/view.phtml index a74a9841e8c..5abf4dd75b8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/comments/view.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/comments/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/abstract.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/abstract.phtml index 3e97b6ddf53..a88008cb6ef 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/abstract.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/abstract.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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/billing/method/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/billing/method/form.phtml index a834dff0030..64370824b53 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/billing/method/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/billing/method/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) */ ?> @@ -50,5 +50,5 @@ </div> <script type="text/javascript">order.setPaymentMethod('<?php echo $this->getSelectedMethodCode() ?>')</script> <?php else: ?> - <?php echo Mage::helper('Mage_Sales_Helper_Data')->__('No Payment Methods') ?> + <div><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('No Payment Methods') ?></div> <?php endif; ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/comment.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/comment.phtml index 83fb5446162..5c9a99c0d3d 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/comment.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/comment.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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/coupons/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/coupons/form.phtml index 9c6a0fd755d..fe95484e613 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/coupons/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/coupons/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/data.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/data.phtml index b10924ff959..576f20da91b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/data.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/data.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,8 +42,10 @@ </td> <?php endif; ?> <td <?php if($this->getCustomerId()): ?>class="main-col"<?php endif; ?>> + <div id="order-additional_area" style="display:none" class="order-additional-area"><?php echo $this->getChildHtml('additional_area') ?></div> <div id="order-search" style="display:none" class="order-search-items"><?php echo $this->getChildHtml('search') ?></div> <div id="order-items"><?php echo $this->getChildHtml('items') ?></div> + <div id="order-errors"><?php echo $this->getChildHtml('errors') ?></div> <div id="order-form_account"><?php echo $this->getChildHtml('form_account') ?></div> <div id="order-addresses"> <div id="order-billing_address" class="box-left"><?php echo $this->getChildHtml('billing_address') ?></div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form.phtml index 45107eb4c3f..052dee376b3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/account.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/account.phtml index c43ffd862dd..092b6e2ca57 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/account.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/account.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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/address.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/address.phtml index b5c630933e0..5b22e27ff75 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/address.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/address.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) */ if($this->getIsShipping()): diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.js b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.js index 82e1343f209..5ce20bbb4a1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/view/adminhtml/sales/order/create/giftmessage.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.phtml index 6853fbbca01..7a63708413d 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items.phtml index 25633ebb61d..b258f84955f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items/grid.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items/grid.phtml index 5ff91ee747a..5e79118db11 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items/grid.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/js.phtml index 76a868fb7ed..7a7b6d92aee 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/newsletter/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/newsletter/form.phtml index 73359fa216f..0bc2d60acad 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/newsletter/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/newsletter/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/scripts.js b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/scripts.js index ae7eb3f2af2..d046613a534 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/scripts.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/scripts.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 AdminOrder = new Class.create(); @@ -42,6 +42,48 @@ AdminOrder.prototype = { this.giftMessageDataChanged = false; this.productConfigureAddFields = {}; this.productPriceBase = {}; + this.collectElementsValue = true; + Event.observe(window, 'load', (function(){ + this.dataArea = new OrderFormArea('data', $(this.getAreaId('data')), this); + this.itemsArea = Object.extend(new OrderFormArea('items', $(this.getAreaId('items')), this), { + addControlButton: function(button){ + var controlButtonArea = $(this.node).select('.form-buttons')[0]; + if (typeof controlButtonArea != 'undefined') { + var buttons = controlButtonArea.childElements(); + for (var i = 0; i < buttons.length; i++) { + if (buttons[i].innerHTML.include(button.label)) { + return ; + } + } + button.insertIn(controlButtonArea, 'top'); + } + } + }); + + var searchButton = new ControlButton(Translator.translate('Add Products')), + searchAreaId = this.getAreaId('search'); + searchButton.onClick = function() { + $(searchAreaId).show(); + this.remove(); + } + this.itemsArea.onLoad = this.itemsArea.onLoad.wrap(function(proceed) { + proceed(); + if (!$(searchAreaId).visible()) { + this.addControlButton(searchButton); + } + }); + this.areasLoaded(); + }).bind(this)); + }, + + areasLoaded: function(){ + }, + + itemsLoaded: function(){ + }, + + dataLoaded: function(){ + this.dataShow(); }, setLoadBaseUrl : function(url){ @@ -63,7 +105,7 @@ AdminOrder.prototype = { setCustomerAfter : function () { this.customerSelectorHide(); if (this.storeId) { - $(this.getAreaId('data')).callback = 'dataShow'; + $(this.getAreaId('data')).callback = 'dataLoaded'; this.loadArea(['data'], true); } else { @@ -219,14 +261,26 @@ AdminOrder.prototype = { } }, - disableShippingAddress : function(flag){ + disableShippingAddress : function(flag) { this.shippingAsBilling = flag; - if($('order-shipping_address_customer_address_id')) { - $('order-shipping_address_customer_address_id').disabled=flag; + if ($('order-shipping_address_customer_address_id')) { + $('order-shipping_address_customer_address_id').disabled = flag; } - if($(this.shippingAddressContainer)){ + if ($(this.shippingAddressContainer)) { var dataFields = $(this.shippingAddressContainer).select('input', 'select', 'textarea'); - for(var i=0;i<dataFields.length;i++) dataFields[i].disabled = flag; + for (var i = 0; i < dataFields.length; i++) { + dataFields[i].disabled = flag; + } + var buttons = $(this.shippingAddressContainer).select('button'); + // Add corresponding class to buttons while disabling them + for (i = 0; i < buttons.length; i++) { + buttons[i].disabled = flag; + if (flag) { + buttons[i].addClassName('disabled'); + } else { + buttons[i].removeClassName('disabled'); + } + } } }, @@ -598,13 +652,27 @@ AdminOrder.prototype = { this.showArea('data'); }, - sidebarApplyChanges : function(){ - if($(this.getAreaId('sidebar'))){ - var data = {}; - var elems = $(this.getAreaId('sidebar')).select('input'); - for(var i=0; i<elems.length; i++){ - if(elems[i].getValue()){ - data[elems[i].name] = elems[i].getValue(); + clearShoppingCart : function(confirmMessage){ + if (confirm(confirmMessage)) { + this.collectElementsValue = false; + order.sidebarApplyChanges({'sidebar[empty_customer_cart]': 1}); + } + }, + + sidebarApplyChanges : function(auxiliaryParams) { + if ($(this.getAreaId('sidebar'))) { + var data = {}; + if (this.collectElementsValue) { + var elems = $(this.getAreaId('sidebar')).select('input'); + for (var i=0; i < elems.length; i++) { + if (elems[i].getValue()) { + data[elems[i].name] = elems[i].getValue(); + } + } + } + if (auxiliaryParams instanceof Object) { + for (var paramName in auxiliaryParams) { + data[paramName] = String(auxiliaryParams[paramName]); } } data.reset_shipping = true; @@ -1056,5 +1124,125 @@ AdminOrder.prototype = { top: parentPos[1] + 'px', left: parentPos[0] + 'px' }); + }, + + validateVat: function(parameters) + { + var params = { + country: $(parameters.countryElementId).value, + vat: $(parameters.vatElementId).value + }; + + if (this.storeId !== false) { + params.store_id = this.storeId; + } + + var currentCustomerGroupId = $(parameters.groupIdHtmlId).value; + + new Ajax.Request(parameters.validateUrl, { + parameters: params, + onSuccess: function(response) { + var message = ''; + var groupChangeRequired = false; + try { + response = response.responseText.evalJSON(); + + if (true === response.valid) { + message = parameters.vatValidMessage; + if (currentCustomerGroupId != response.group) { + message = parameters.vatValidAndGroupChangeMessage; + groupChangeRequired = true; + } + } else if (response.success) { + message = parameters.vatInvalidMessage.replace(/%s/, params.vat); + } else { + message = parameters.vatValidationFailedMessage; + } + + } catch (e) { + message = parameters.vatValidationFailedMessage; + } + if (!groupChangeRequired) { + alert(message); + } + else { + this.processCustomerGroupChange(parameters.groupIdHtmlId, message, response.group); + } + }.bind(this) + }); + }, + + processCustomerGroupChange: function(groupIdHtmlId, message, groupId) + { + var currentCustomerGroupId = $(groupIdHtmlId).value; + var currentCustomerGroupTitle = $$('#' + groupIdHtmlId + ' > option[value=' + currentCustomerGroupId + ']')[0].text; + var customerGroupOption = $$('#' + groupIdHtmlId + ' > option[value=' + groupId + ']')[0]; + var confirmText = message.replace(/%s/, customerGroupOption.text); + confirmText = confirmText.replace(/%s/, currentCustomerGroupTitle); + if (confirm(confirmText)) { + $$('#' + groupIdHtmlId + ' option').each(function(o) { + o.selected = o.readAttribute('value') == groupId; + }); + this.accountGroupChange(); + } + } +}; + +var OrderFormArea = Class.create(); +OrderFormArea.prototype = { + _name: null, + _node: null, + _parent: null, + _callbackName: null, + + initialize: function(name, node, parent){ + this._name = name; + this._parent = parent; + this._callbackName = node.callback; + if (typeof this._callbackName == 'undefined') { + this._callbackName = name + 'Loaded'; + node.callback = this._callbackName; + } + parent[this._callbackName] = parent[this._callbackName].wrap((function (proceed){ + proceed(); + this.onLoad(); + }).bind(this)); + + this.setNode(node); + }, + + setNode: function(node){ + if (!node.callback) { + node.callback = this._callbackName; + } + this.node = node; + }, + + onLoad: function(){ + } +}; + +var ControlButton = Class.create(); +ControlButton.prototype = { + _label: '', + _node: null, + + initialize: function(label){ + this._label = label; + this._node = new Element('button', { + 'class': 'scalable add' + }); + }, + + onClick: function(){ + }, + + insertIn: function(element, position){ + var node = Object.extend(this._node), + content = {}; + node.observe('click', this.onClick); + node.update('<span>' + this._label + '</span>'); + content[position] = node; + Element.insert(element, content); } }; diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/shipping/method/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/shipping/method/form.phtml index 12adadf285b..cc67d268320 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/shipping/method/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/shipping/method/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) */ ?> @@ -91,7 +91,7 @@ <a href="#" onclick="order.loadShippingRates();return false"> <?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Get shipping methods and rates') ?> </a> - <input type="hidden" name="order[has_shipping]" value="" class="required-entry"> + <input type="hidden" name="order[has_shipping]" value="" class="required-entry" /> </div> <?php endif; ?> <div style="display:none;" id="shipping-method-overlay" class="overlay"><span><?php echo $this->__('Shipping method selection is not applicable') ?></span></div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar.phtml index 87b28fcd872..e81cab68e1f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar.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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar/items.phtml index 83547f2a50b..d524bb08db9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar/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) */ ?> @@ -92,5 +92,8 @@ <p class="center"><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('No items') ?></p> <?php endif ?> </div> + <?php if ($this->getItemCount() && $this->canRemoveItems()): ?> + <?php echo $this->getChildHtml('empty_customer_cart_button'); ?> + <?php endif; ?> </div> </div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/store/select.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/store/select.phtml index 97c02ff6f08..cb19c36c079 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/store/select.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/store/select.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) */ ?> <?php /* @var $this Mage_Adminhtml_Block_Sales_Order_Create_Store_Select */ ?> +<?php echo $this->getHintHtml() ?> <?php foreach ($this->getWebsiteCollection() as $_website): ?> <?php $showWebsite=false; ?> <?php foreach ($this->getGroupCollection($_website) as $_group): ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals.phtml index 73863759ad4..870926f59da 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/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) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/default.phtml index 8ddf39d3173..3b66de9de0b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/default.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) */ ?> <tr class="<?php echo $this->getTotal()->getCode(); ?>"> <td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>"> <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><strong><?php endif; ?> - <?php echo $this->getTotal()->getTitle() ?> + <?php echo $this->escapeHtml($this->getTotal()->getTitle()); ?> <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?></strong><?php endif; ?> </td> <td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/grandtotal.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/grandtotal.phtml index c84aa4adc45..f14446390b1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/grandtotal.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/grandtotal.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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/shipping.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/shipping.phtml index d304e1163fd..69c4371a007 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/shipping.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/subtotal.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/subtotal.phtml index c005216acb9..a7d021dd635 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/subtotal.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/tax.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/tax.phtml index cbb419a8fa6..13b1b0497eb 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/tax.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/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) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/form.phtml index 7629c505067..face88352ee 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items.phtml index 198e10e5e53..042a395f105 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/configurable.phtml index b0876731b90..ddebb797ec4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/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) */ ?> @@ -228,12 +228,11 @@ <?php endif; ?> <?php if (Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_item, 2, 'sales')): ?> - <br /><span class="nobr"><?php echo Mage::helper('Mage_Weee_Helper_Data')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> + <br /><span class="nobr"><?php echo Mage::helper('Mage_Weee_Helper_Data')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/default.phtml index 01c96a1f5c0..63677f43dc2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/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) */ ?> @@ -233,7 +233,6 @@ <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/totals/adjustments.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/totals/adjustments.phtml index 82181d24b43..6af4d00c972 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/totals/adjustments.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/totals/adjustments.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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/form.phtml index f25c4f38c37..ee8d6e46a52 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items.phtml index 616f49d8fc6..12358444ecb 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/configurable.phtml index 41ccaa15c73..60be10a9812 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/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) */ ?> @@ -215,12 +215,11 @@ <?php endif; ?> <?php if (Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_item, 2, 'sales')): ?> - <br /><span class="nobr"><?php echo Mage::helper('Mage_Weee_Helper_Data')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> + <br /><span class="nobr"><?php echo Mage::helper('Mage_Weee_Helper_Data')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/default.phtml index 4ef3c15b200..29ad5b5f7b6 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/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 @@ <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions.phtml index ddf58a0816e..550a5223d58 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions_tooltip.js b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions_tooltip.js index 519efaf5e22..99675a27f72 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions_tooltip.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions_tooltip.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/view/adminhtml/sales/order/invoice/create/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/form.phtml index d34ce1ae18e..2c43ff9c0ba 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items.phtml index d60b56da3cf..8bb3ea5fc65 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/configurable.phtml index 8a6e9ce2a99..57e88e3fb11 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/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) */ ?> @@ -227,7 +227,6 @@ <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/default.phtml index 6cab2cf4bcb..11b62382c1b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/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) */ ?> @@ -227,7 +227,6 @@ <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/tracking.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/tracking.phtml index 37c36500f4f..9b1d50936ea 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/tracking.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/tracking.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) */ ?> <script type="text/javascript"> +//<![CDATA[ var trackingControl = {}; trackingControl = { index : 0, @@ -64,6 +65,7 @@ trackingControl = { } } } +//]]> </script> <div class="grid"> <table cellspacing="0" class="data" id="tracking_numbers_table"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/form.phtml index fa54fbeebe6..ac33f2db3fc 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items.phtml index 8bbc47ed57b..b65e181c376 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/configurable.phtml index 8a6e9ce2a99..f42e2c83d73 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ ?> @@ -222,12 +222,12 @@ <?php endif; ?> <?php if (Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_item, 2, 'sales')): ?> - <br /><span class="nobr"><?php echo Mage::helper('Mage_Weee_Helper_Data')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> + <br /><span class="nobr"><?php echo Mage::helper('Mage_Weee_Helper_Data')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> </span> <?php endif; ?> - </span> + </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/default.phtml index 3c61f51b46f..45eba3ec630 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 @@ <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/form.phtml index 4d19df6f8f4..0f7346d1e33 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items.phtml index ad2600932cd..9558c568d95 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/configurable.phtml index 1cc67f2a09c..cca9e03bf98 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/default.phtml index d735fc08dfd..e1861670e19 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/tracking.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/tracking.phtml index fbf66aff699..7a095d19d42 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/tracking.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/tracking.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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging.js b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging.js index ac99fe5ebe5..fd0739b8b57 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 Packaging = Class.create(); @@ -248,6 +248,17 @@ Packaging.prototype = { }, validate: function() { + var dimensionElements = $("packaging_window").select( + 'input[name=container_length],input[name=container_width],input[name=container_height]' + ); + var callback = null; + if ( dimensionElements.any(function(element) { return !!element.value; })) { + callback = function(element) { $(element).addClassName('required-entry'); }; + } else { + callback = function(element) { $(element).removeClassName('required-entry'); }; + } + dimensionElements.each(callback); + return result = $$('[id^="package_block_"] input').collect(function (element) { return this.validateElement(element) }, this).all(); @@ -609,7 +620,7 @@ Packaging.prototype = { return; } - currentNode.select( + $(currentNode).select( 'input[name=container_length],input[name=container_width],input[name=container_height],select[name=container_dimension_units]' ).each(function(inputElement) { if (disable) { diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/grid.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/grid.phtml index a1e597d7ec0..560dc5f451a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/grid.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 @@ <input type="hidden" name="price" value="<?php echo $item->getPrice(); ?>"> <input type="text" name="qty" value="<?php echo $item->getQty()*1; ?>" class="input-text qty<?php if ($item->getOrderItem()->getIsQtyDecimal()): ?> qty-decimal<?php endif ?>"> <button type="button" class="scalable delete icon-btn" onclick="packaging.deleteItem(this);" style="display:none;"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Delete') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Delete') ?></span></span></span> </button> </td> </tr> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/packed.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/packed.phtml index 9508ea3911d..c2ddd754047 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/packed.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ ?> @@ -190,7 +190,7 @@ <div class="buttons-set a-right"> <?php echo $this->getPrintButton() ?> <button type="button" class="scalable SavePackagesBtn save" onclick="hidePackedWindow();" title="<?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Products should be added to package(s)')?>"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('OK') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('OK') ?></span></span></span> </button> </div> </div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/popup.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/popup.phtml index ceb39072c65..92348e12d67 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/popup.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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() { <div class="entry-edit"> <div class="entry-edit-head"> <button type="button" class="scalable AddPackageBtn" onclick="packaging.newPackage();"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Add Package') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Add Package') ?></span></span></span> </button> <h4 class="icon-head fieldset-legend"><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Create Packages') ?></h4> </div> @@ -156,12 +156,12 @@ document.observe("dom:loaded", function() { <?php endif; ?> <td> <button type="button" class="scalable AddItemsBtn" onclick="packaging.getItemsForPack(this);"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Add Products') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Add Products') ?></span></span></span> </button> </td> <td> <button type="button" class="scalable DeletePackageBtn" onclick="packaging.deletePackage(this);"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Delete Package') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Delete Package') ?></span></span></span> </button> </td> </tbody> @@ -198,7 +198,7 @@ document.observe("dom:loaded", function() { <div class="package_prapare" style="display:none"> <div class="entry-edit-head"> <button type="button" class="scalable AddSelectedBtn" onclick="packaging.packItems(this);"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Add Selected Product(s) to Package') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Add Selected Product(s) to Package') ?></span></span></span> </button> <h4><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Please Select Products to Add') ?></h4> </div> @@ -210,10 +210,10 @@ document.observe("dom:loaded", function() { </div> <div class="buttons-set a-right"> <button type="button" class="scalable disabled SavePackagesBtn" disabled="disabled" onclick="packaging.confirmPackaging();" title="<?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Products should be added to package(s)')?>"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('OK') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('OK') ?></span></span></span> </button> <button type="button" class="scalable" onclick="packaging.cancelPackaging();"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Cancel') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Cancel') ?></span></span></span> </button> </div> </div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/tracking/info.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/tracking/info.phtml index d4df9d10c96..e134686dba3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/tracking/info.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/form.phtml index 6c06d7c91d8..bd37961776f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items.phtml index 4f95554aa49..9b0c3defc4c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/configurable.phtml index 372700c1262..5bdf2a91a6f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/default.phtml index 148d0f69d76..5b5e0f62aad 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/tracking.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/tracking.phtml index 43963306ae1..74571137200 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/tracking.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/tracking.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) */ ?> @@ -74,6 +74,7 @@ </table> </div> <script type="text/javascript"> +//<![CDATA[ function selectCarrier(elem) { option = elem.options[elem.selectedIndex]; if (option.value && option.value != 'custom') { @@ -89,4 +90,5 @@ function deleteTrackingNumber(url) { submitAndReloadArea($('shipment_tracking_info').parentNode, url) } } +//]]> </script> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totalbar.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totalbar.phtml index cae1e44e9af..81448cb2a29 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totalbar.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals.phtml index a343bca3f4b..536e9aa713f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 @@ <table cellspacing="0" width="100%"> <col /> <col width="1" /> - <?php $_totals = $this->getTotals('')?> + <?php $_totals = $this->getTotals('footer')?> <?php if ($_totals):?> - <tbody> - <?php foreach ($_totals as $_code => $_total): ?> + <tfoot> + <?php foreach ($this->getTotals('footer') as $_code => $_total): ?> <?php if ($_total->getBlockName()): ?> <?php echo $this->getChildHtml($_total->getBlockName(), false); ?> <?php else:?> <tr class="<?php echo $_code?>"> <td <?php echo $this->getLabelProperties()?> class="label"> - <?php if ($_total->getStrong()):?> - <strong><?php echo $_total->getLabel()?></strong> - <?php else:?> - <?php echo $_total->getLabel()?> - <?php endif?> + <strong><?php echo $this->escapeHtml($_total->getLabel()); ?></strong> </td> - <?php if ($_total->getStrong()):?> <td <?php echo $this->getValueProperties()?> class="emph"> <strong><?php echo $this->formatValue($_total) ?></strong> - <?php else:?> - <td <?php echo $this->getValueProperties()?>> - <?php echo $this->formatValue($_total) ?> - <?php endif?> </td> </tr> <?php endif?> <?php endforeach?> - </tbody> + </tfoot> <?php endif?> - <?php $_totals = $this->getTotals('footer')?> + <?php $_totals = $this->getTotals('')?> <?php if ($_totals):?> - <tfoot> - <?php foreach ($this->getTotals('footer') as $_code => $_total): ?> + <tbody> + <?php foreach ($_totals as $_code => $_total): ?> <?php if ($_total->getBlockName()): ?> <?php echo $this->getChildHtml($_total->getBlockName(), false); ?> <?php else:?> <tr class="<?php echo $_code?>"> <td <?php echo $this->getLabelProperties()?> class="label"> - <strong><?php echo $_total->getLabel()?></strong> + <?php if ($_total->getStrong()):?> + <strong><?php echo $this->escapeHtml($_total->getLabel()); ?></strong> + <?php else:?> + <?php echo $this->escapeHtml($_total->getLabel()); ?> + <?php endif?> </td> + <?php if ($_total->getStrong()):?> <td <?php echo $this->getValueProperties()?> class="emph"> <strong><?php echo $this->formatValue($_total) ?></strong> + <?php else:?> + <td <?php echo $this->getValueProperties()?>> + <?php echo $this->formatValue($_total) ?> + <?php endif?> </td> </tr> <?php endif?> <?php endforeach?> - </tfoot> + </tbody> <?php endif?> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/discount.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/discount.phtml index 7911c993e1a..4ccfd708423 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/discount.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/due.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/due.phtml index 4b05ffb7428..8c37ce3b4f2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/due.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/footer.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/footer.phtml index bf027e603ae..5618bbe5b71 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/footer.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/grand.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/grand.phtml index aa4c3ea0236..f4ab25eea94 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/grand.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/item.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/item.phtml index f16c9bb1770..ee552ea4561 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/item.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/main.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/main.phtml index c85a611c6ae..518a2ceecd7 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/main.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/paid.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/paid.phtml index 249a9074078..d9d5e3d09a0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/paid.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/refunded.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/refunded.phtml index c6770626c18..c3437c5b943 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/refunded.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/shipping.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/shipping.phtml index 130ca52d94e..6d5b67f7bdc 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/shipping.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/tax.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/tax.phtml index c522ef9f8de..e08b9049e65 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/tax.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/form.phtml index 9e094c7ce83..226ff5f3906 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/giftmessage.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/giftmessage.phtml index 26390983ce0..c2ce110c0b4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/giftmessage.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/history.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/history.phtml index 8876f987a1c..f46dd2e20e6 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/history.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/info.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/info.phtml index 56a555b9d1e..7c1666437c4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/info.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items.phtml index 3f18a3ad111..4dda557ff70 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items/renderer/default.phtml index 9e73fbc0e39..43c90c1a2f5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/history.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/history.phtml index 292e7b707c8..46c5f57d289 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/history.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/info.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/info.phtml index 0328eb1366d..57b1ffec9a1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/info.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/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/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tracking.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tracking.phtml index a434cffcb95..ff559b74657 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tracking.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ ?> -<?php if($this->getOrder()->getShippingCarrier()->isTrackingAvailable()) : ?> +<?php $_shippingCarrier = $this->getOrder()->getShippingCarrier(); ?> +<?php if ($_shippingCarrier && $_shippingCarrier->isTrackingAvailable()): ?> <span class="field-row" id="order_tracking_info"> <table cellpadding="0" cellspacing="0" width="100%"> <tr> - <td><label id="tracking_number"><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Tracking Number') ?></label></td> + <td><label for="tracking_number"><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Tracking Number') ?></label></td> <td width="100%"> - <?php if($_numbers = $this->getOrder()->getTrackingNumbers()): ?> - - <?php foreach ($_numbers as $_number): ?> - <a href="#" onclick="<?php echo $this->getViewLinkHtml($_number) ?>"><?php echo $_number ?></a> - <a href="#" onclick="<?php echo $this->getRemoveLinkHtml($_number) ?>"><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Delete') ?></a><br/> - <span id="order_tracking_info_response_<?php echo $_number ?>"></span> - <?php endforeach; ?> + <?php $_numbers = $this->getOrder()->getTrackingNumbers(); ?> + <?php if ($_numbers): ?> + <?php foreach ($_numbers as $_number): ?> + <a href="#" onclick="<?php echo $this->getViewLinkHtml($_number) ?>"><?php echo $_number ?></a> + <a href="#" onclick="<?php echo $this->getRemoveLinkHtml($_number) ?>"><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Delete') ?></a><br/> + <span id="order_tracking_info_response_<?php echo $_number ?>"></span> + <?php endforeach; ?> <?php endif; ?> <input class="input-text" type="text" id="tracking_number" name="tracking_number" value="" style="width:120px;"/> <?php echo $this->getSaveButtonHtml() ?> @@ -44,4 +45,4 @@ </tr> </table> </span> -<?php endif ?> +<?php endif; ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/transactions/detail.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/transactions/detail.phtml index ec029946e11..9c6ab7a9059 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/transactions/detail.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/store/switcher.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher.phtml index 8819f353ec4..ccdcefe9e4d 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher.phtml @@ -20,13 +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) */ ?> <?php /* @var $this Mage_Core_Block_Template */ ?> <?php if ($websites = $this->getWebsites()): ?> -<p class="switcher"><label for="store_switcher"><?php echo $this->__('Choose Store View') ?>:</label> +<p class="switcher"><label for="store_switcher"><?php echo $this->__('Choose Store View:') ?></label> <select name="store_switcher" id="store_switcher" onchange="return switchStore(this);"> <?php if ($this->hasDefaultOption()): ?> <option value=""><?php echo $this->getDefaultStoreName() ?></option> @@ -52,6 +52,7 @@ <?php endforeach; ?> <?php endforeach; ?> </select> +<?php echo $this->getHintHtml() ?> </p> <script type="text/javascript"> function switchStore(obj) { diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/enhanced.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/enhanced.phtml index 7b30a4e632b..70aef2a9300 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/enhanced.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ ?> <?php $_websiteCollection = $this->getWebsiteCollection() ?> <?php if ($_websiteCollection->getSize()): ?> <div id="store_switcher_container"> -<p class="switcher"><label for="store_switcher"><?php echo $this->__('Choose Store View') ?>:</label> +<p class="switcher"><label for="store_switcher"><?php echo $this->__('Choose Store View:') ?></label> <select name="store_switcher" id="store_switcher" class="left-col-block"> <option value=""><?php echo $this->getDefaultStoreName() ?></option> <?php foreach ($_websiteCollection as $_website): ?> @@ -51,6 +51,7 @@ <?php endforeach; ?> <?php endforeach; ?> </select> +<?php echo $this->getHintHtml() ?> </p> </div> <script type="text/javascript"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/form/renderer/fieldset.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/form/renderer/fieldset.phtml new file mode 100644 index 00000000000..296aea419a4 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/form/renderer/fieldset.phtml @@ -0,0 +1,61 @@ +<?php +/** + * 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_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php $_element = $this->getElement() ?> +<?php if ($_element->getFieldsetContainerId()): ?> +<div id="<?php echo $_element->getFieldsetContainerId(); ?>"> +<?php endif; ?> +<?php if ($_element->getLegend()): ?> +<div class="entry-edit-head"> + <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $_element->getLegend() ?></h4> + <div class="form-buttons"><?php echo $_element->getHeaderBar() ?></div> +</div> +<?php endif; ?> +<?php if (!$_element->getNoContainer()): ?> + <div class="fieldset <?php echo $_element->getClass() ?>" id="<?php echo $_element->getHtmlId() ?>"> +<?php endif; ?> + <?php echo $this->getHintHtml() ?> + <div class="hor-scroll"> + <?php if ($_element->getComment()): ?> + <p class="comment"><?php echo $this->escapeHtml($_element->getComment()) ?></p> + <?php endif; ?> + <?php if ($_element->hasHtmlContent()): ?> + <?php echo $_element->getHtmlContent(); ?> + <?php else: ?> + <table cellspacing="0" class="<?php echo $_element->hasTableClass() ? $_element->getTableClass() : 'form-list'?>"> + <tbody> + <?php echo $_element->getChildrenHtml(); ?> + </tbody> + </table> + <?php endif; ?> + </div> + <?php echo $_element->getSubFieldsetHtml() ?> +<?php if (!$_element->getNoContainer()): ?> + </div> +<?php endif; ?> +<?php if ($_element->getFieldsetContainerId()): ?> +</div> +<?php endif; ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/autocomplete.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/autocomplete.phtml index 456e48b260a..534c11b4da6 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/autocomplete.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/autocomplete.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/code/core/Mage/Adminhtml/view/adminhtml/system/cache/additional.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/additional.phtml index 4b3332db334..56b7799a699 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/additional.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/additional.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,7 +35,7 @@ <table class="form-list"> <tr> <td class="scope-label"> - <button onclick="setLocation('<?php echo $this->getCleanImagesUrl()?>')" type="button" class="scalable"><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Flush Catalog Images Cache') ?></span></button> + <button onclick="setLocation('<?php echo $this->getCleanImagesUrl()?>')" type="button" class="scalable"><span><span><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Flush Catalog Images Cache') ?></span></span></span></button> </td> <td class="scope-label"> <?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Pregenerated product images files.')?> @@ -43,7 +43,7 @@ </tr> <tr> <td class="scope-label"> - <button onclick="setLocation('<?php echo $this->getCleanMediaUrl()?>')" type="button" class="scalable"><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Flush JavaScript/CSS Cache') ?></span></button> + <button onclick="setLocation('<?php echo $this->getCleanMediaUrl()?>')" type="button" class="scalable"><span><span><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Flush JavaScript/CSS Cache') ?></span></span></span></button> </td> <td class="scope-label"> <?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Themes JavaScript and CSS files combined to one file.')?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/edit.phtml index 967300dca05..0406b7ab6e7 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/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) */ ?> @@ -73,7 +73,7 @@ <?php if (isset($_button['warning']) && $_button['warning']): ?> <?php $clickAction = "if (confirm('".addslashes($_button['warning'])."')) {{$clickAction}}"; ?> <?php endif; ?> - <button <?php if (!isset($_button['disabled']) || !$_button['disabled']):?>onclick="<?php echo $clickAction; ?>"<?php endif; ?> id="<?php echo $_button['name'] ?>" type="button" class="scalable <?php if (isset($_button['disabled']) && $_button['disabled']):?>disabled<?php endif; ?>" style=""><span><?php echo $_button['action'] ?></span></button> + <button <?php if (!isset($_button['disabled']) || !$_button['disabled']):?>onclick="<?php echo $clickAction; ?>"<?php endif; ?> id="<?php echo $_button['name'] ?>" type="button" class="scalable <?php if (isset($_button['disabled']) && $_button['disabled']):?>disabled<?php endif; ?>" style=""><span><span><span><?php echo $_button['action'] ?></span></span></span></button> <?php if (isset($_button['comment'])): ?> <br /> <small><?php echo $_button['comment']; ?></small> <?php endif; ?> <?php endforeach; ?> </td> @@ -96,7 +96,7 @@ <tr> <td class="label"><label><?php echo $this->__('JavaScript/CSS Cache') ?></label></td> <td class="value"> - <button onclick="setCacheAction('jscss_action', this)" id='jscss_action' type="button" class="scalable"><span><?php echo $this->__('Clear') ?></span></button> + <button onclick="setCacheAction('jscss_action', this)" id='jscss_action' type="button" class="scalable"><span><span><span><?php echo $this->__('Clear') ?></span></span></span></button> </td> </tr> </tbody> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/notifications.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/notifications.phtml index 61b87a8b635..d88f71e06ef 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/notifications.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/notifications.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/code/core/Mage/Adminhtml/view/adminhtml/system/config/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/edit.phtml index 0f26cefb2d2..773f37810f3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/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/code/core/Mage/Adminhtml/view/adminhtml/system/config/form/field/array.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/form/field/array.phtml index c6105517438..2fc0dd12fa2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/form/field/array.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/form/field/array.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) */ ?> @@ -50,7 +50,7 @@ $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : ''; <td colspan="<?php echo count($this->_columns) ?>"></td> <td <?php echo $_colspan?>> <button style="" onclick="" class="scalable add" type="button" id="addToEndBtn<?php echo $_htmlId ?>"> - <span><?php echo $this->_addButtonLabel ?></span> + <span><span><span><?php echo $this->_addButtonLabel ?></span></span></span> </button> </td> </tr> @@ -61,7 +61,7 @@ $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : ''; </div> <div id="empty<?php echo $_htmlId ?>"> <button style="" onclick="" class="scalable add" type="button" id="emptyAddBtn<?php echo $_htmlId ?>"> - <span><?php echo $this->_addButtonLabel ?></span> + <span><span><span><?php echo $this->_addButtonLabel ?></span></span></span> </button> </div> @@ -78,9 +78,9 @@ var arrayRow<?php echo $_htmlId ?> = { +'<\/td>' <?php endforeach;?> <?php if ($this->_addAfter):?> - +'<td><button onclick="" class="scalable add" type="button" id="addAfterBtn#{_id}"><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add after') ?><\/span><\/button><\/td>' + +'<td><button onclick="" class="scalable add" type="button" id="addAfterBtn#{_id}"><span><span><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add after') ?><\/span><\/span><\/span><\/button><\/td>' <?php endif;?> - +'<td><button onclick="arrayRow<?php echo $_htmlId ?>.del(\'#{_id}\')" class="scalable delete" type="button"><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete') ?><\/span><\/button><\/td>' + +'<td><button onclick="arrayRow<?php echo $_htmlId ?>.del(\'#{_id}\')" class="scalable delete" type="button"><span><span><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete') ?><\/span><\/span><\/span><\/button><\/td>' +'<\/tr>' ), diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/js.phtml index ed011861989..9ddc15343d2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/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) */ ?> @@ -251,11 +251,6 @@ perPageModel.prototype = { var values = $(elm.id + '_values').value.split(','); return values.indexOf(v) != -1; }); - - this.gridValuesElement.addClassName('validate-per-page-value-list'); - this.listValuesElement.addClassName('validate-per-page-value-list'); - this.gridElement.addClassName('validate-per-page-value'); - this.listElement.addClassName('validate-per-page-value'); } } diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/switcher.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/switcher.phtml index 1e084a74049..f7b4e4ed682 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/switcher.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/switcher.phtml @@ -20,13 +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) */ ?> <?php /* @var $this Mage_Core_Block_Template */ ?> <div class="switcher"> <label for="store_switcher"><?php echo $this->__('Current Configuration Scope:') ?></label> + <?php echo $this->getHintHtml() ?> <select id="store_switcher" class="system-config-store-switcher" onchange="location.href=this.options[this.selectedIndex].getAttribute('url')"> <?php foreach ($this->getStoreSelectOptions() as $_value => $_option): ?> <?php if (isset($_option['is_group'])): ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/system/storage/media/synchronize.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/system/storage/media/synchronize.phtml index f61ed22e996..37c79ece9e4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/system/storage/media/synchronize.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/system/storage/media/synchronize.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/code/core/Mage/Adminhtml/view/adminhtml/system/config/tabs.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/tabs.phtml index 1cbd22ab634..1fb6c887171 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/tabs.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/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/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/process.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/process.phtml index 1e4f65d5cbf..b9e67731b6f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/process.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/process.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/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/run.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/run.phtml index 87f1fe0007f..a7cbf39e3b0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/run.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/run.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/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/upload.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/upload.phtml index 907a0e432d8..986ab842fc7 100755 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/upload.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/upload.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/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/wizard.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/wizard.phtml index d7fc151e5a8..0b6970ff4a6 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/wizard.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/wizard.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/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/matrix.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/matrix.phtml index f0b320dfaff..2e2961304ce 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/matrix.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/matrix.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/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/services.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/services.phtml index 54a4aa08119..97d1aed3267 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/services.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/services.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/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rates.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rates.phtml index 827071ed995..e5724763647 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rates.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rates.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/code/core/Mage/Adminhtml/view/adminhtml/system/design/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/edit.phtml index de823e62358..48921b85bca 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/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/code/core/Mage/Adminhtml/view/adminhtml/system/design/index.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/index.phtml index 0bd113396ec..4eece28a869 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/index.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/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/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/edit.phtml index c6f7ac8d0c1..b6188cded82 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/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/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/list.phtml index d304728d5a9..69957a9928a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/list.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/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/preview.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/preview.phtml index 7f8b4962059..17789e49cd1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/preview.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/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/code/core/Mage/Adminhtml/view/adminhtml/system/info.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/info.phtml index 9d98003ffcd..0b48cc33d99 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/info.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/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/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/applicable_country.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/applicable_country.phtml index 96a395b3e21..858e4481794 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/applicable_country.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/applicable_country.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/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/ups.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/ups.phtml index e21206ac524..0299bac0634 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/ups.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/ups.phtml @@ -20,203 +20,176 @@ * * @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 $upsModel Mage_Usa_Model_Shipping_Carrier_Ups */ +$upsModel = Mage::getSingleton('Mage_Usa_Model_Shipping_Carrier_Ups'); +$orShipArr = $upsModel->getCode('originShipment'); +$defShipArr = $upsModel->getCode('method'); -$orShipArr = Mage::getSingleton('Mage_Usa_Model_Shipping_Carrier_Ups')->getCode('originShipment'); - -$defShipArr = Mage::getSingleton('Mage_Usa_Model_Shipping_Carrier_Ups')->getCode('method'); - +/** @var $this Mage_Adminhtml_Block_Template */ $sectionCode = $this->getRequest()->getParam('section'); $websiteCode = $this->getRequest()->getParam('website'); $storeCode = $this->getRequest()->getParam('store'); - -if(!$storeCode && $websiteCode){ +if (!$storeCode && $websiteCode) { + /** @var $web Mage_Core_Model_Website */ $web = Mage::getModel('Mage_Core_Model_Website')->load($websiteCode); - $stroredAllowedMethods = $web->getConfig('carriers/ups/allowed_methods'); - $stroredAllowedMethods = explode(',',$stroredAllowedMethods); - $stroredOriginShipment = $web->getConfig('carriers/ups/origin_shipment'); - $stroredFreeShipment = $web->getConfig('carriers/ups/free_method'); + $storedAllowedMethods = explode(',', $web->getConfig('carriers/ups/allowed_methods')); + $storedOriginShipment = $web->getConfig('carriers/ups/origin_shipment'); + $storedFreeShipment = $web->getConfig('carriers/ups/free_method'); + $storedUpsType = $web->getConfig('carriers/ups/type'); } elseif ($storeCode) { - $stroredAllowedMethods = Mage::getStoreConfig('carriers/ups/allowed_methods',$storeCode); - $stroredAllowedMethods = explode(',',$stroredAllowedMethods); - $stroredOriginShipment = Mage::getStoreConfig('carriers/ups/origin_shipment',$storeCode); - $stroredFreeShipment = Mage::getStoreConfig('carriers/ups/free_method',$storeCode); + $storedAllowedMethods = explode(',', Mage::getStoreConfig('carriers/ups/allowed_methods', $storeCode)); + $storedOriginShipment = Mage::getStoreConfig('carriers/ups/origin_shipment', $storeCode); + $storedFreeShipment = Mage::getStoreConfig('carriers/ups/free_method', $storeCode); + $storedUpsType = Mage::getStoreConfig('carriers/ups/type', $storeCode); } else { - $stroredAllowedMethods = Mage::getStoreConfig('carriers/ups/allowed_methods'); - $stroredAllowedMethods = explode(',',$stroredAllowedMethods); - $stroredOriginShipment = Mage::getStoreConfig('carriers/ups/origin_shipment'); - $stroredFreeShipment = Mage::getStoreConfig('carriers/ups/free_method'); + $storedAllowedMethods = explode(',', Mage::getStoreConfig('carriers/ups/allowed_methods')); + $storedOriginShipment = Mage::getStoreConfig('carriers/ups/origin_shipment'); + $storedFreeShipment = Mage::getStoreConfig('carriers/ups/free_method'); + $storedUpsType = Mage::getStoreConfig('carriers/ups/type'); } ?> <script type="text/javascript"> //<![CDATA[ - originShipmentObj = new Object(); - - - <?php - //get origin shipment data, using in UPS XML module - foreach ($orShipArr as $key=>$val){ - print "originShipmentObj['$key'] = new Object();\n"; - foreach ($val as $code=>$label){ - print "\toriginShipmentObj['$key']['$code'] = '$label';\n"; - } - } - ?> - //get default shipment data, using in UPS module - <?php - print "originShipmentObj['default'] = new Object();\n"; - foreach ($defShipArr as $code=>$label){ - print "\toriginShipmentObj['default']['$code'] = '$label';\n"; - } - ?> - //get stored Allowed Methods - <?php - print "stroredAllowedMethods = new Array();\n"; - foreach ($stroredAllowedMethods as $code){ - print "\tstroredAllowedMethods.push('$code');\n"; - } - ?> - //set stored origin shipment - <?php - print "stroredOriginShipment='$stroredOriginShipment'"; - ?> - - //set stored Free origin shipment - <?php - print "stroredFreeShipment='$stroredFreeShipment'"; - ?> - - - function hideRowArrayElements(arr,method) + function hideRowArrayElements(arr) { - for(a=0;a<arr.length;a++){ + for (var a = 0; a < arr.length; a++) { $(arr[a]).up(1).hide(); } } - function showRowArrayElements(arr,method) + function showRowArrayElements(arr) { - for(a=0;a<arr.length;a++){ + for (var a = 0; a < arr.length; a++) { $(arr[a]).up(1).show(); } } - function inArray(arr,value) + function inArray(arr, value) { - var i; - for (i=0; i < arr.length; i++) { - if (arr[i] === value) { - return true; - } + for (var i = 0; i < arr.length; i++) { + if (arr[i] === value) { + return true; + } } return false; } var upsXml = Class.create(); upsXml.prototype = { - initialize : function() + initialize: function() { - this.carriersUpsTypeId = 'carriers_ups_type'; - if($(this.carriersUpsTypeId)){ - this.checkingUpsXmlId = new Array('carriers_ups_gateway_xml_url','carriers_ups_username','carriers_ups_password','carriers_ups_access_license_number'); - this.checkingUpsId = new Array('carriers_ups_gateway_url'); - this.originShipmentTitle = ''; - this.allowedMethodsId = 'carriers_ups_allowed_methods'; - this.freeShipmentId = 'carriers_ups_free_method'; - this.onlyUpsXmlElements = new Array('carriers_ups_gateway_xml_url','carriers_ups_tracking_xml_url','carriers_ups_username','carriers_ups_password','carriers_ups_access_license_number','carriers_ups_origin_shipment','carriers_ups_negotiated_active','carriers_ups_shipper_number','carriers_ups_mode_xml'); - this.onlyUpsElements = new Array('carriers_ups_gateway_url'); - this.setFormValues(); - Event.observe($('carriers_ups_type'), 'change', this.setFormValues.bind(this)); + if (!$(this.carriersUpsTypeId)) { + return; } + this.checkingUpsXmlId = ['carriers_ups_gateway_xml_url','carriers_ups_username', + 'carriers_ups_password','carriers_ups_access_license_number']; + this.checkingUpsId = ['carriers_ups_gateway_url']; + this.originShipmentTitle = ''; + this.allowedMethodsId = 'carriers_ups_allowed_methods'; + this.freeShipmentId = 'carriers_ups_free_method'; + this.onlyUpsXmlElements = ['carriers_ups_gateway_xml_url','carriers_ups_tracking_xml_url', + 'carriers_ups_username','carriers_ups_password','carriers_ups_access_license_number', + 'carriers_ups_origin_shipment','carriers_ups_negotiated_active','carriers_ups_shipper_number', + 'carriers_ups_mode_xml']; + this.onlyUpsElements = ['carriers_ups_gateway_url']; + + this.storedOriginShipment = '<?php echo $storedOriginShipment ?>'; + this.storedFreeShipment = '<?php echo $storedFreeShipment ?>'; + this.storedUpsType = '<?php echo $storedUpsType ?>'; + <?php /** @var $_coreHelper Mage_Core_Helper_Data */ $_coreHelper = Mage::helper('Mage_Core_Helper_Data'); ?> + this.storedAllowedMethods = <?php echo $_coreHelper->jsonEncode($storedAllowedMethods) ?>; + this.originShipmentObj = <?php echo $_coreHelper->jsonEncode($orShipArr) ?>; + this.originShipmentObj['default'] = <?php echo $_coreHelper->jsonEncode($defShipArr) ?>; + + this.setFormValues(); + Event.observe($(this.carriersUpsTypeId), 'change', this.setFormValues.bind(this)); }, updateAllowedMethods: function(originShipmentTitle) { - selectFieldAllowedMethod = $(this.allowedMethodsId); - selectFieldFreeShipment = $(this.freeShipmentId); + var allowedMethods = $(this.allowedMethodsId), // multiselect + freeMethod = $(this.freeShipmentId), // single-choice select + originShipment = this.originShipmentObj[originShipmentTitle]; - originShipment = originShipmentObj[originShipmentTitle]; - - while (selectFieldAllowedMethod.length> 0) { - selectFieldAllowedMethod.remove(0); - } - while (selectFieldFreeShipment.length> 0) { - selectFieldFreeShipment.remove(0); + while (allowedMethods.length > 0) { + allowedMethods.remove(0); } - var optionFree = document.createElement("OPTION"); - optionFree.text = 'None'; - optionFree.value = ''; - try { - selectFieldFreeShipment.add(optionFree, null); - } catch(ex) { - selectFieldFreeShipment.add(optionFree); + while (freeMethod.length > 0) { + freeMethod.remove(0); } - for(code in originShipment){ - var option = document.createElement("OPTION"); - option.text = originShipment[code]; - option.value = code; - - var optionFree = document.createElement("OPTION"); - optionFree.text = originShipment[code]; - optionFree.value = code; + freeMethod.insert(new Element('option', {value:''}).update('None')); - if( (originShipmentTitle == stroredOriginShipment || originShipmentTitle=='default') && stroredFreeShipment==code){ - optionFree.selected = true; + var code, option; + for (code in originShipment) { + option = new Element('option', {value:code}).update(originShipment[code]); + if ((originShipmentTitle == this.storedOriginShipment || originShipmentTitle == 'default') + && this.storedFreeShipment == code + ) { + option.selected = true; } - if( (originShipmentTitle == stroredOriginShipment || originShipmentTitle=='default') && inArray(stroredAllowedMethods,code)){ + freeMethod.insert(option); + + option = new Element('option', {value:code}).update(originShipment[code]); + if (this.storedUpsType == 'UPS') { + if (originShipmentTitle != 'default' || inArray(this.storedAllowedMethods, code)) { + option.selected = true; + } + } else if (originShipmentTitle != this.storedOriginShipment + || inArray(this.storedAllowedMethods, code) + ) { option.selected = true; } - try { - selectFieldAllowedMethod.add(option, null); // standards compliant; doesn't work in IE - selectFieldFreeShipment.add(optionFree, null); - } catch(ex) { - selectFieldAllowedMethod.add(option); // IE only - selectFieldFreeShipment.add(optionFree); + + if ((originShipmentTitle == 'default' || originShipmentTitle == this.storedOriginShipment) + && inArray(this.storedAllowedMethods, code) + ) { + option.selected = true; } + + allowedMethods.insert(option); } }, setFormValues: function() { - if($F(this.carriersUpsTypeId) == 'UPS'){ - for(a=0;a<this.checkingUpsXmlId.length;a++){ + var a; + if ($F(this.carriersUpsTypeId) == 'UPS') { + for (a = 0; a < this.checkingUpsXmlId.length; a++) { $(this.checkingUpsXmlId[a]).removeClassName('required-entry'); } - for(a=0;a<this.checkingUpsId.length;a++){ + for (a = 0; a < this.checkingUpsId.length; a++) { $(this.checkingUpsXmlId[a]).addClassName('required-entry'); } Event.stopObserving($('carriers_ups_origin_shipment'), 'change', this.changeOriginShipment.bind(this)); showRowArrayElements(this.onlyUpsElements); hideRowArrayElements(this.onlyUpsXmlElements); - this.changeOriginShipment(null,'default'); + this.changeOriginShipment(null, 'default'); } else { - for(a=0;a<this.checkingUpsXmlId.length;a++){ + for (a = 0; a < this.checkingUpsXmlId.length; a++) { $(this.checkingUpsXmlId[a]).addClassName('required-entry'); } - for(a=0;a<this.checkingUpsId.length;a++){ + for (a = 0; a < this.checkingUpsId.length; a++) { $(this.checkingUpsXmlId[a]).removeClassName('required-entry'); } Event.observe($('carriers_ups_origin_shipment'), 'change', this.changeOriginShipment.bind(this)); showRowArrayElements(this.onlyUpsXmlElements); hideRowArrayElements(this.onlyUpsElements); - this.changeOriginShipment(); + this.changeOriginShipment(null, null); } }, - changeOriginShipment: function(Event,key) + changeOriginShipment: function(Event, key) { - if(key) - this.originShipmentTitle = key - else - this.originShipmentTitle = $F('carriers_ups_origin_shipment'); + this.originShipmentTitle = key ? key : $F('carriers_ups_origin_shipment'); this.updateAllowedMethods(this.originShipmentTitle); } - } + }; xml = new upsXml(); -//]]> + //]]> </script> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/variable/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/variable/js.phtml index 8dc7adb2797..65f2a32c38f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/variable/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/tag.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/tag.xml index 2834b470a9a..7f036133d95 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tag.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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) */ --> @@ -49,4 +49,40 @@ <remove name="root" /> <block type="Mage_Adminhtml_Block_Tag_Assigned_Grid" name="assigned_grid" output="toHtml" /> </adminhtml_tag_assignedgridonly> + + <adminhtml_tag_index> + <reference name="content"> + <block type="Mage_Adminhtml_Block_Tag_Tag" name="adminhtml.tag.tag"/> + </reference> + </adminhtml_tag_index> + + <adminhtml_tag_pending> + <reference name="content"> + <block type="Mage_Adminhtml_Block_Tag_Pending" name="adminhtml.tag.pending"/> + </reference> + </adminhtml_tag_pending> + + <adminhtml_tag_ajaxgrid> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Tag_Tag_Grid" name="adminhtml.tag.tag.grid"/> + </block> + </adminhtml_tag_ajaxgrid> + + <adminhtml_tag_ajaxpendinggrid> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Tag_Grid_Pending" name="adminhtml.tag.grid.pending"/> + </block> + </adminhtml_tag_ajaxpendinggrid> + + <adminhtml_tag_product> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Tag_Product_Grid" name="adminhtml.tag.product.grid"/> + </block> + </adminhtml_tag_product> + + <adminhtml_tag_customer> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Tag_Customer_Grid" name="adminhtml.tag.customer.grid"/> + </block> + </adminhtml_tag_customer> </layout> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tag/edit/container.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tag/edit/container.phtml index 14af436f9fd..0d7f20b9d36 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tag/edit/container.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/tag/index.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tag/index.phtml index e5c5e79af6f..6a64592b2dd 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tag/index.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/tax/class/page/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/class/page/edit.phtml index 23ed082ffd5..7a5391e95db 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/class/page/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/tax/importExport.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/importExport.phtml index 2a3770900a3..9e09822fd30 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/importExport.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/form.phtml index 253ac8d871b..55c7efdac46 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/title.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/title.phtml index 721438fe3f2..e64b44a393c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/title.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/add.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/add.phtml index caa4c17c72d..d34398a4ee1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/add.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 @@ <tr> <td style="width:50%;"><h3 class="icon-head head-tax"><?php echo $header ?></h3></td> <td class="form-buttons"> - <button class="scalable add" onclick="window.location.href='<?php echo $createUrl ?>'"><span><?php echo Mage::helper('Mage_Tax_Helper_Data')->__('Add New Class') ?></span></button> + <button class="scalable add" onclick="window.location.href='<?php echo $createUrl ?>'"><span><span><span><?php echo Mage::helper('Mage_Tax_Helper_Data')->__('Add New Class') ?></span></span></span></button> </td> </tr> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/save.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/save.phtml index 0f846b5d719..29dc54c21ea 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/save.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/add.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/add.phtml index c099c6227ce..f1edfc322b1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/add.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/save.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/save.phtml index 5f7e4ef3266..cdde037d888 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/save.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/add.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/add.phtml index 9a602d46ede..f9070d02eb0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/add.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 @@ <tr> <td style="width:50%;"><h3 class="icon-head head-tax"><?php echo $header ?></h3></td> <td class="form-buttons"> - <button class="scalable add" onclick="window.location.href='<?php echo $createUrl ?>'"><span><?php echo Mage::helper('Mage_Tax_Helper_Data')->__('Add New Tax Rule') ?></span></button> + <button class="scalable add" onclick="window.location.href='<?php echo $createUrl ?>'"><span><span><span><?php echo Mage::helper('Mage_Tax_Helper_Data')->__('Add New Tax Rule') ?></span></span></span></button> </td> </tr> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/save.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/save.phtml index e9b12ec3018..356fe3e6a63 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/save.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/categories.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/categories.phtml index 3a160365c86..32d1c022618 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/categories.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/edit.phtml index 57be9648f47..7ae6052b52f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/selector.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/selector.phtml index cc650ee9341..8522feb6cee 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/selector.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/variables.js b/app/code/core/Mage/Adminhtml/view/adminhtml/variables.js index 8b54d92d5ed..cf9ffd27bdb 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/variables.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/variables.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/view/adminhtml/widget/accordion.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/accordion.phtml index ea1e4638d86..38a15353a9b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/accordion.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 */ ?> -<dl id="<?php echo $this->getHtmlId() ?>" class="accordion"> +<dl id="tab_content_<?php echo $this->getHtmlId() ?>" name="tab_content_<?php echo $this->getHtmlId() ?>" class="accordion"> <?php foreach ($this->getItems() as $_item): ?> <?php echo $this->getChildHtml($_item->getId()) ?> <?php endforeach ?> </dl> <script type="text/javascript"> - <?php echo $this->getHtmlId() ?>AccordionJs = new varienAccordion('<?php echo $this->getHtmlId() ?>', '<?php echo $this->getShowOnlyOne() ?>'); + tab_content_<?php echo $this->getHtmlId() ?>AccordionJs = new varienAccordion('tab_content_<?php echo $this->getHtmlId() ?>', '<?php echo $this->getShowOnlyOne() ?>'); </script> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/breadcrumbs.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/breadcrumbs.phtml index e1bad537b68..24668763af5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/breadcrumbs.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form.phtml index c048a166a08..04a297f0adb 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/form/container.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/container.phtml index fc0f9f81915..9fd68966b19 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/container.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element.phtml index fce21172174..ebf3c96263f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element/gallery.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element/gallery.phtml index 592ea9f7972..68770dce849 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element/gallery.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/element.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/element.phtml index 9f4fb73b85e..4348f586182 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/element.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset.phtml index 36e698e001d..78d7b3c7490 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset/element.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset/element.phtml index 8269cda7d48..6b783b76a72 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset/element.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/grid.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid.phtml index 15220c0343e..0f004f1d83c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/container.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/container.phtml index e8acc20ef97..fb76b3c55b3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/container.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/massaction.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/massaction.phtml index 76be70bad73..1c0855161f3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/massaction.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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 @@ <td> <div class="right"> <div class="entry-edit"> + <?php if ($this->getHideFormElement() !== true):?> <form action="" id="<?php echo $this->getHtmlId() ?>-form" method="post"> + <?php endif ?> <?php echo $this->getBlockHtml('formkey')?> <fieldset> <span class="field-row"> @@ -60,7 +62,9 @@ <?php echo $this->getApplyButtonHtml() ?> </span> </fieldset> + <?php if ($this->getHideFormElement() !== true):?> </form> + <?php endif ?> </div> <div class="no-display"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/serializer.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/serializer.phtml index 86dd54e07f6..cda25d5e381 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/serializer.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/tabs.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabs.phtml index 760c858bc3b..723f9c4e82e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabs.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/tabshoriz.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabshoriz.phtml index c90300dbe9c..81f5df1d477 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabshoriz.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/tabsleft.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabsleft.phtml index c7e8e4bb369..fec2c9b0f7f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabsleft.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Adminhtml/view/adminhtml/widget/view/container.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/view/container.phtml index e4e318581d2..2fed8775821 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/view/container.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/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/code/core/Mage/Api/Controller/Action.php b/app/code/core/Mage/Api/Controller/Action.php index f8274cf838a..8781fda354c 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 2e52caaa089..ebd3fd8de64 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 0ededf84745..b604fc672b3 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 a47f7931b9c..5a873750fd3 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/Resource.php b/app/code/core/Mage/Api/Model/Acl/Resource.php index 514819c0be1..1157e6da21e 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 9fdbe47b28b..f3723bf4245 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 3a145bd249d..4323e48c1e9 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 ebb710d7b0f..fc6ca50bb72 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 6744f5ef53e..0a42cc0efb3 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 dde5d2b3116..bade58da92a 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 77abc5aec1c..e8b70d3a829 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/Resource/Abstract.php b/app/code/core/Mage/Api/Model/Resource/Abstract.php index ad770c63bd5..549e349178f 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 78ef2fbbd9d..9fefdc2c91b 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 6652490513f..b4eb87b3b61 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 a073ed37a5d..eaa79681184 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 49d73abe31d..a6ef7ebb706 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 507a1b63eb1..ae39a30c903 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 c52c34d99b2..a490823768f 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 8b6f8bcbbb2..43448bd61ce 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 1a72e9f9880..e0def9cb02c 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 b3861edd220..4b282900e2f 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 7a65f1b405d..82052d38cc8 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 774d6d49052..48dc8a7b349 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 b960fc86273..878de72994b 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 13a632799a2..9577cf9cc06 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 e0978371db8..599ca42fab4 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 d1f63492acc..69a3b30e2a6 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 b8e95d00318..8c319032a95 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 29dc0b5440e..536d0fd8c14 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 f5ee1916e7d..e48430c4f60 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 818abbbfa52..c46832bb1dc 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 e5dfdf8ebc1..18b8bebeaff 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 29b42ef0cfc..4c4181b77e0 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 432e09c868d..7f7b549d01f 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 6071193a5bd..a9cbeaa622f 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 c615d9cc315..978a42372f6 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 f9b65727098..7b3a4963b34 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 38c44e871e2..0192d728913 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 79519a7d560..e6624481c9e 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 93a42209c58..ee5e139283d 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('Mage_Api_Model_Resource_User'); diff --git a/app/code/core/Mage/Api/Model/Wsdl/Config.php b/app/code/core/Mage/Api/Model/Wsdl/Config.php index 6c558007400..f94bf37991b 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 72dd66bc8d7..49db9a717d8 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 d44a987a48f..fe11244090b 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 fb724559977..39753e5924b 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 3674c65c25b..91f4ec7b8ce 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 6f183b5d272..18395b95af8 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 29a0edb8b4d..1573ed59069 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 a3d1fb4d07d..a756ac4538e 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 3989d783347..695ee9b259e 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 f1d7bab35da..2492346a4a2 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 25818a76a17..bc9c8e122b4 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 fb9df666844..68bb78a1570 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/Authorizenet/Block/Directpost/Form.php b/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php index e1bdfe5d4df..355e2422e06 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 a450291edbb..9cadfc3ccdd 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 bc63f67119d..a7298578ea9 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 9efc94c9730..e4eee4781bf 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 75f2fdcef2b..6477f12ce0b 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 2d66651dff6..57fcd15eebd 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 4f47518cae8..9486793f887 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 b7b9d53be18..a827b6deb30 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 9162394ad4c..8be65c3f7c7 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 995c427325a..87a489758a0 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 894e94d2acc..88f8782aaab 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 52f8b54abfa..2a479f02f73 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) */ --> @@ -210,6 +210,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> </fields> </authorizenet_directpost> diff --git a/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/iframe.phtml b/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/iframe.phtml index 35b8c0c16f9..1f1d2f3a37e 100644 --- a/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/iframe.phtml +++ b/app/code/core/Mage/Authorizenet/view/adminhtml/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/code/core/Mage/Authorizenet/view/adminhtml/directpost/info.phtml b/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/info.phtml index c4b65dc8b08..41959620422 100644 --- a/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/info.phtml +++ b/app/code/core/Mage/Authorizenet/view/adminhtml/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/code/core/Mage/Authorizenet/view/adminhtml/layout.xml b/app/code/core/Mage/Authorizenet/view/adminhtml/layout.xml index 423270a2320..c8a299ed74e 100644 --- a/app/code/core/Mage/Authorizenet/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Authorizenet/view/adminhtml/layout.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/code/core/Mage/Authorizenet/view/frontend/directpost/form.phtml b/app/code/core/Mage/Authorizenet/view/frontend/directpost/form.phtml index 7ac49e2ef60..2f979a708ed 100644 --- a/app/code/core/Mage/Authorizenet/view/frontend/directpost/form.phtml +++ b/app/code/core/Mage/Authorizenet/view/frontend/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/code/core/Mage/Authorizenet/view/frontend/directpost/iframe.phtml b/app/code/core/Mage/Authorizenet/view/frontend/directpost/iframe.phtml index 611c034ef19..9d2c612ca24 100644 --- a/app/code/core/Mage/Authorizenet/view/frontend/directpost/iframe.phtml +++ b/app/code/core/Mage/Authorizenet/view/frontend/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/code/core/Mage/Authorizenet/view/frontend/directpost/info.phtml b/app/code/core/Mage/Authorizenet/view/frontend/directpost/info.phtml index d4ba4ac82ad..d8e6ff2275d 100644 --- a/app/code/core/Mage/Authorizenet/view/frontend/directpost/info.phtml +++ b/app/code/core/Mage/Authorizenet/view/frontend/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/code/core/Mage/Authorizenet/view/frontend/layout.xml b/app/code/core/Mage/Authorizenet/view/frontend/layout.xml index 0cde9389051..558852a8590 100644 --- a/app/code/core/Mage/Authorizenet/view/frontend/layout.xml +++ b/app/code/core/Mage/Authorizenet/view/frontend/layout.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/code/core/Mage/Backup/Exception.php b/app/code/core/Mage/Backup/Exception.php index 8be06068a24..cbdfdc8a4e0 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 c9540e00e14..3f53a87aa62 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) */ @@ -29,5 +29,305 @@ */ 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'; + + /** + * Backup type constant for full system backup excluding media folder + * + * @const string + */ + const TYPE_SNAPSHOT_WITHOUT_MEDIA = 'nomedia'; + + /** + * 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'), + self::TYPE_SNAPSHOT_WITHOUT_MEDIA => self::__('System (excluding Media)') + ); + } + + /** + * Get all possible backup type values + * + * @return array + */ + public function getBackupTypesList() + { + return array( + self::TYPE_DB, + self::TYPE_SYSTEM_SNAPSHOT, + self::TYPE_SNAPSHOT_WITHOUT_MEDIA, + 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_SNAPSHOT_WITHOUT_MEDIA => '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('Mage_Admin_Model_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_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.') + ); + + 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('Mage_Index_Model_Resource_Process_Collection') as $process){ + $process->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX); + } + 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 fb3a75d3f2b..8ecf82c2138 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) */ @@ -29,23 +29,17 @@ * * @category Mage * @package Mage_Backup - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ 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,14 +59,19 @@ class Mage_Backup_Model_Backup extends Varien_Object */ public function load($fileName, $filePath) { - list ($time, $type) = explode("_", substr($fileName, 0, strrpos($fileName, "."))); + $backupData = Mage::helper('Mage_Backup_Helper_Data')->extractDataFromFilename($fileName); + $this->addData(array( 'id' => $filePath . DS . $fileName, - 'time' => (int)$time, + 'time' => (int)$backupData->getTime(), 'path' => $filePath, - 'date_object' => new Zend_Date((int)$time) + 'extension' => Mage::helper('Mage_Backup_Helper_Data')->getExtensionByType($backupData->getType()), + 'display_name' => Mage::helper('Mage_Backup_Helper_Data')->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; } @@ -93,19 +92,29 @@ class Mage_Backup_Model_Backup extends Varien_Object */ public function getFileName() { - return $this->getTime() . "_" . $this->getType() - . "." . self::BACKUP_EXTENSION; + $filename = $this->getTime() . "_" . $this->getType(); + $backupName = $this->getName(); + + if (!empty($backupName)) { + $filename .= '_' . $backupName; + } + + $filename .= '.' . Mage::helper('Mage_Backup_Helper_Data')->getExtensionByType($this->getType()); + + return $filename; } /** * Sets type of file * - * @param string $value db|media|view + * @param string $value + * @return Mage_Backup_Model_Backup */ public function setType($value='db') { - if(!in_array($value, array('db','media','view'))) { - $value = 'db'; + $possibleTypes = Mage::helper('Mage_Backup_Helper_Data')->getBackupTypesList(); + if(!in_array($value, $possibleTypes)) { + $value = Mage::helper('Mage_Backup_Helper_Data')->getDefaultBackupType(); } $this->_type = $value; @@ -117,7 +126,7 @@ class Mage_Backup_Model_Backup extends Varien_Object /** * Returns type of backup file * - * @return string db|media|view + * @return string */ public function getType() { @@ -205,6 +214,7 @@ class Mage_Backup_Model_Backup extends Varien_Object * Delete backup file * * @throws Mage_Backup_Exception + * @return Mage_Backup_Model_Backup */ public function deleteFile() { @@ -249,11 +259,12 @@ class Mage_Backup_Model_Backup extends Varien_Object $mode = $write ? 'wb' . self::COMPRESS_RATE : 'rb'; - try { - $this->_handler = gzopen($filePath, $mode); - } - catch (Exception $e) { - Mage::exception('Mage_Backup', Mage::helper('Mage_Backup_Helper_Data')->__('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('Mage_Backup_Helper_Data')->__('Backup file "%s" cannot be read from or written to.', $this->getFileName()) + ); } return $this; @@ -351,4 +362,41 @@ class Mage_Backup_Model_Backup extends Varien_Object return 0; } + + /** + * Validate user password + * + * @param string $password + * @return bool + */ + public function validateUserPassword($password) + { + $userPasswordHash = Mage::getModel('Mage_Admin_Model_Session')->getUser()->getPassword(); + return Mage::helper('Mage_Core_Helper_Data')->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('Mage_Backup_Model_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 new file mode 100644 index 00000000000..023b3a2fcfb --- /dev/null +++ b/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php @@ -0,0 +1,89 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Backup by cron backend model + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Core_Model_Config_Data') + ->load(self::CRON_STRING_PATH, 'path') + ->setValue($cronExprString) + ->setPath(self::CRON_STRING_PATH) + ->save(); + + Mage::getModel('Mage_Core_Model_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('Mage_Backup_Helper_Data')->__('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 00000000000..abace0ebe89 --- /dev/null +++ b/app/code/core/Mage/Backup/Model/Config/Source/Type.php @@ -0,0 +1,52 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Backups types' source model for system configuration + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Model_Config_Source_Type +{ + /** + * return possible options + * + * @return array + */ + public function toOptionArray() + { + $backupTypes = array(); + foreach(Mage::helper('Mage_Backup_Helper_Data')->getBackupTypes() as $type => $label) { + $backupTypes[] = array( + 'label' => $label, + 'value' => $type, + ); + } + return $backupTypes; + } +} diff --git a/app/code/core/Mage/Backup/Model/Db.php b/app/code/core/Mage/Backup/Model/Db.php index 772c24b2bc0..2126f41b9ce 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,10 @@ class Mage_Backup_Model_Db /** * Buffer length for multi rows - * default 512 Kb + * default 100 Kb * */ - const BUFFER_LENGTH = 524288; + const BUFFER_LENGTH = 102400; /** * Retrieve resource model diff --git a/app/code/core/Mage/Backup/Model/Fs/Collection.php b/app/code/core/Mage/Backup/Model/Fs/Collection.php index 70f4b2e9b9b..d7850ae9f87 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) */ @@ -58,10 +58,17 @@ class Mage_Backup_Model_Fs_Collection extends Varien_Data_Collection_Filesystem } // set collection specific params + $extensions = Mage::helper('Mage_Backup_Helper_Data')->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 @@ class Mage_Backup_Model_Fs_Collection extends Varien_Data_Collection_Filesystem $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 00000000000..9cd91aa2625 --- /dev/null +++ b/app/code/core/Mage/Backup/Model/Observer.php @@ -0,0 +1,95 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Backup Observer + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Backup_Helper_Data')->turnOnMaintenanceMode(); + } + + $type = Mage::getStoreConfig(self::XML_PATH_BACKUP_TYPE); + + $this->_errors = array(); + try { + $backupManager = Mage_Backup::getBackupInstance($type) + ->setBackupExtension(Mage::helper('Mage_Backup_Helper_Data')->getExtensionByType($type)) + ->setTime(time()) + ->setBackupsDir(Mage::helper('Mage_Backup_Helper_Data')->getBackupsDir()); + + Mage::register('backup_manager', $backupManager); + + if ($type != Mage_Backup_Helper_Data::TYPE_DB) { + $backupManager->setRootDir(Mage::getBaseDir()) + ->addIgnorePaths(Mage::helper('Mage_Backup_Helper_Data')->getBackupIgnorePaths()); + } + + $backupManager->create(); + Mage::log(Mage::helper('Mage_Backup_Helper_Data')->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('Mage_Backup_Helper_Data')->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 714cb16ba29..23beb2fb2e8 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) */ @@ -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('Mage_Core_Model_Resource')->getConnection('backup_read'); + $this->_write = Mage::getSingleton('Mage_Core_Model_Resource')->getConnection('backup_write'); } /** @@ -74,7 +74,7 @@ class Mage_Backup_Model_Resource_Db */ public function getTables() { - return $this->_read->listTables(); + return $this->_write->listTables(); } /** @@ -112,7 +112,10 @@ class Mage_Backup_Model_Resource_Db if (!$tableName) { $tables = $this->getTables(); foreach($tables as $table) { - $fkScript = $fkScript . Mage::getResourceHelper('Mage_Backup')->getTableForeignKeysSql($table); + $tableFkScript = Mage::getResourceHelper('Mage_Backup')->getTableForeignKeysSql($table); + if (!empty($tableFkScript)) { + $fkScript .= "\n" . $tableFkScript; + } } } else { $fkScript = $this->getTableForeignKeysSql($tableName); @@ -128,7 +131,7 @@ class Mage_Backup_Model_Resource_Db */ public function getTableStatus($tableName) { - $row = $this->_read->showTableStatus($tableName); + $row = $this->_write->showTableStatus($tableName); if ($row) { $statusObject = new Varien_Object(); @@ -137,8 +140,8 @@ class Mage_Backup_Model_Resource_Db $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; @@ -157,8 +160,7 @@ class Mage_Backup_Model_Resource_Db */ public function getTableDataSql($tableName, $count = null, $offset = null) { - return Mage::getResourceHelper('Mage_Backup')->getInsertSql($tableName); - + return Mage::getResourceHelper('Mage_Backup')->getPartInsertSql($tableName, $count, $offset); } /** @@ -181,7 +183,7 @@ class Mage_Backup_Model_Resource_Db */ 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"; @@ -249,7 +251,7 @@ class Mage_Backup_Model_Resource_Db public function beginTransaction() { Mage::getResourceHelper('Mage_Backup')->turnOnSerializableMode(); - $this->_read->beginTransaction(); + $this->_write->beginTransaction(); return $this; } @@ -260,7 +262,7 @@ class Mage_Backup_Model_Resource_Db */ public function commitTransaction() { - $this->_read->commit(); + $this->_write->commit(); Mage::getResourceHelper('Mage_Backup')->turnOnReadCommittedMode(); return $this; } @@ -272,7 +274,18 @@ class Mage_Backup_Model_Resource_Db */ 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 b166957d27e..26de1344678 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) */ @@ -54,19 +54,40 @@ class Mage_Backup_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_ */ 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 @@ class Mage_Backup_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_ * 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 @@ class Mage_Backup_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_ 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 d598ee9a44a..a8c2bccf7fa 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) */ --> @@ -50,6 +50,11 @@ <children> <backup translate="title" module="Mage_Backup"> <title>Backups</title> + <children> + <rollback translate="title" module="Mage_Backup"> + <title>Rollback</title> + </rollback> + </children> </backup> </children> </tools> diff --git a/app/code/core/Mage/Backup/etc/config.xml b/app/code/core/Mage/Backup/etc/config.xml index 5179bd3febb..c6d01a142ac 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) */ --> @@ -51,4 +51,13 @@ </modules> </translate> </adminhtml> + <crontab> + <jobs> + <system_backup> + <run> + <model>Mage_Backup_Model_Observer::scheduledBackup</model> + </run> + </system_backup> + </jobs> + </crontab> </config> 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 00000000000..f0e0a6f229b --- /dev/null +++ b/app/code/core/Mage/Backup/etc/system.xml @@ -0,0 +1,95 @@ +<?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_Backup + * @copyright 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> + <sections> + <system> + <groups> + <backup translate="label" module="Mage_Backup"> + <label>Scheduled Backup Settings</label> + <frontend_type>text</frontend_type> + <sort_order>500</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <fields> + <enabled translate="label" module="Mage_Backup"> + <label>Enable Scheduled Backup</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>10</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </enabled> + <type translate="label" module="Mage_Backup"> + <label>Backup Type</label> + <frontend_type>select</frontend_type> + <depends><enabled>1</enabled></depends> + <source_model>Mage_Backup_Model_Config_Source_Type</source_model> + <sort_order>20</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </type> + <time translate="label" module="Mage_Backup"> + <label>Start Time</label> + <frontend_type>time</frontend_type> + <depends><enabled>1</enabled></depends> + <sort_order>30</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </time> + <frequency translate="label" module="Mage_Backup"> + <label>Frequency</label> + <frontend_type>select</frontend_type> + <depends><enabled>1</enabled></depends> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency</source_model> + <backend_model>Mage_Backup_Model_Config_Backend_Cron</backend_model> + <sort_order>40</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </frequency> + <maintenance translate="label comment" module="Mage_Backup"> + <label>Maintenance Mode</label> + <comment>Put store on the maintenance mode while backup's creation</comment> + <frontend_type>select</frontend_type> + <depends><enabled>1</enabled></depends> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>50</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </maintenance> + </fields> + </backup> + </groups> + </system> + </sections> +</config> 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 5e0c2c38cfb..69d12354dcb 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 fa8f95eefed..7df542e3d62 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 4ab148ca25c..4a056642300 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 82799e3f0f7..5069b9aaeb8 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 d156e96dd2a..734c5795326 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 decf8454d04..e7e1a75d950 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) */ @@ -122,6 +122,15 @@ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes ); } + $groupPrice = $this->getForm()->getElement('group_price'); + if ($groupPrice) { + $groupPrice->setRenderer( + $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group') + ->setPriceColumnHeader(Mage::helper('Mage_Bundle_Helper_Data')->__('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/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php index 3d918822545..41911a42978 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 0a4963b01d7..751c51851d4 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 35e38253754..bce14c76e7a 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 368ba369711..79672d7390e 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 0af8b00caa3..a1b9e6bec9b 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 c1f9b9e010d..65ccd040e74 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 4cf4458c5de..e05be53435b 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 80850647b40..0fccbafca99 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 4ce33d26761..f8bb42b2a86 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 c21f8cef1c6..2dffeffa022 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/Price.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/Price.php index 1b918f25061..d020577d761 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 c262ecbb084..dd7f7515f6f 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 ef787faa8bb..473d1010842 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) */ @@ -122,7 +122,8 @@ class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle extends Mage_Catalog_Bl 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 b9c93026357..832fd99648a 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 @@ class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option extends Mage_Bun return $selectedQty; } + /** + * Get product model + * + * @return Mage_Catalog_Model_Product + */ public function getProduct() { if (!$this->hasData('product')) { 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 ddbc86de515..384b2b9c6fa 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 7976ee5b045..09773dc91d4 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 4f6f50137de..dfd7bddd0e6 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 5984c63128a..74527692515 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 9b159ab6f32..58c7e4b88ec 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 aa5ff499fb3..5daaa15b3bc 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 472b9f16b78..d3a3fc9a2e6 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 @@ class Mage_Bundle_Helper_Catalog_Product_Configuration extends Mage_Core_Helper_ * @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 @@ class Mage_Bundle_Helper_Catalog_Product_Configuration extends Mage_Core_Helper_ // 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_Resource_Option_Collection @@ -115,7 +120,9 @@ class Mage_Bundle_Helper_Catalog_Product_Configuration extends Mage_Core_Helper_ $qty = $this->getSelectionQty($product, $bundleSelection->getSelectionId()) * 1; if ($qty) { $option['value'][] = $qty . ' x ' . $this->escapeHtml($bundleSelection->getName()) - . ' ' . Mage::helper('Mage_Core_Helper_Data')->currency($this->getSelectionFinalPrice($item, $bundleSelection)); + . ' ' . Mage::helper('Mage_Core_Helper_Data')->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 12a0524a30c..26325296fa2 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/Observer.php b/app/code/core/Mage/Bundle/Model/Observer.php index ca53ac75197..06b83504c65 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) */ diff --git a/app/code/core/Mage/Bundle/Model/Option.php b/app/code/core/Mage/Bundle/Model/Option.php index 827c754577d..6afae3b27c3 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 60d4e741cab..24ad94b3051 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 86376232fc6..6415d43e81a 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 965cbe80378..7854949d24b 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 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr } } + /** + * 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()->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,45 +115,15 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr return $product->getCalculatedFinalPrice(); } - $finalPrice = $product->getPrice(); - - /** - * 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)); + $finalPrice = $this->getBasePrice($product, $qty); - $product->setFinalPrice($finalPrice); - Mage::dispatchEvent('catalog_product_get_final_price', array('product'=>$product)); - $finalPrice = $product->getData('final_price'); - } - $basePrice = $finalPrice; - - if ($product->hasCustomOptions()) { - $customOption = $product->getCustomOption('bundle_selection_ids'); - $selectionIds = unserialize($customOption->getValue()); - $selections = $product->getTypeInstance()->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->getSelectionFinalTotalPrice($product, $selection, $qty, - $selectionQty->getValue()); - } - } - } - } - - $finalPrice = $finalPrice + $this->_applyOptionsPrice($product, $qty, $basePrice) - $basePrice; $product->setFinalPrice($finalPrice); + Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product, 'qty' => $qty)); + $finalPrice = $product->getData('final_price'); + $finalPrice += $this->getTotalBundleItemsPrice($product, $qty); + $finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice); + $product->setFinalPrice($finalPrice); return max(0, $product->getData('final_price')); } @@ -138,7 +142,7 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr } /** - * Retrieve Price with take into account tier price + * Retrieve Price considering tier price * * @param Mage_Catalog_Model_Product $product * @param string|null $which @@ -150,9 +154,9 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr { // check calculated price index if ($product->getData('min_price') && $product->getData('max_price')) { - $minimalPrice = Mage::helper('Mage_Tax_Helper_Data')->getPrice($product, $product->getData('min_price'), $includeTax); - $maximalPrice = Mage::helper('Mage_Tax_Helper_Data')->getPrice($product, $product->getData('max_price'), $includeTax); - $this->_isPricesCalculatedByIndex = true; + $minimalPrice = Mage::helper('Mage_Tax_Helper_Data')->getPrice($product, $product->getData('min_price'), $includeTax); + $maximalPrice = Mage::helper('Mage_Tax_Helper_Data')->getPrice($product, $product->getData('max_price'), $includeTax); + $this->_isPricesCalculatedByIndex = true; } else { /** * Check if product price is fixed @@ -272,7 +276,7 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr if ($which == 'max') { return $maximalPrice; - } else if ($which == 'min') { + } elseif ($which == 'min') { return $minimalPrice; } @@ -327,6 +331,9 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr /** * 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 @@ -335,27 +342,7 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr */ 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); } /** @@ -368,10 +355,7 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr */ public function getSelectionPreFinalPrice($bundleProduct, $selectionProduct, $qty = null) { - return $this->_applySpecialPrice( - $bundleProduct, - $this->getSelectionPrice($bundleProduct, $selectionProduct, $qty) - ); + return $this->getSelectionPrice($bundleProduct, $selectionProduct, $qty); } /** @@ -389,18 +373,85 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr 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); + if (is_null($selectionQty)) { + $selectionQty = $selectionProduct->getSelectionQty(); + } - if ($takeTierPrice) { - // apply bundle tier price - $tierPrice = $this->_applyTierPrice($bundleProduct, $bundleQty, $selectionPrice); - return min(array($tierPrice, $specialPrice)); + if ($bundleProduct->getPriceType() == self::PRICE_TYPE_DYNAMIC) { + $price = $selectionProduct->getFinalPrice($takeTierPrice ? $selectionQty : 1); } else { - return $specialPrice; + if ($selectionProduct->getSelectionPriceType()) { // percent + $price = $this->getPrice($bundleProduct) * ($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) + ); + } + + /** + * 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; } /** @@ -536,11 +587,11 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr } /** - * 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/Product/Type.php b/app/code/core/Mage/Bundle/Model/Product/Type.php index e6d6a90421a..0983cb1330b 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) */ @@ -654,7 +654,7 @@ class Mage_Bundle_Model_Product_Type extends Mage_Catalog_Model_Product_Type_Abs * 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, @@ -792,9 +792,7 @@ class Mage_Bundle_Model_Product_Type extends Mage_Catalog_Model_Product_Type_Abs 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() ); diff --git a/app/code/core/Mage/Bundle/Model/Resource/Bundle.php b/app/code/core/Mage/Bundle/Model/Resource/Bundle.php index dcd8b7b4881..e8fdf82a86a 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 9eb0f073c11..5080bbbe694 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) */ @@ -170,7 +170,13 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour ->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()); @@ -201,7 +207,6 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour $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', @@ -225,6 +230,13 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour $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) { @@ -235,24 +247,38 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour ); $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)) { @@ -302,6 +328,8 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour '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()); @@ -324,6 +352,15 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour ) . ' + 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( @@ -339,12 +376,14 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour ->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()); @@ -387,7 +426,6 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour ) . '* bs.selection_qty' ); - $tierExpr = $write->getCheckSql( 'i.base_tier IS NOT NULL', $write->getCheckSql( @@ -402,6 +440,24 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour ) . ' * 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( @@ -415,7 +471,21 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour '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() @@ -459,6 +529,7 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour 'is_required' => 'bo.required', 'price' => $priceExpr, 'tier_price' => $tierExpr, + 'group_price' => $groupExpr, )); $query = $select->insertFromSelect($this->_getBundleSelectionTable()); @@ -476,6 +547,7 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour 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); @@ -564,4 +636,63 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour 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_entity')), + '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->getTable('catalog_product_entity_group_price')), + array('entity_id') + ) + ->join( + array('e' => $this->getTable('catalog_product_entity')), + 'gp.entity_id=e.entity_id', + array() + ) + ->join( + array('cg' => $this->getTable('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 4d6765345b6..9194d063ee4 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 8714a94eebb..b5a2f56ff25 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 56fcc2c8a31..df6e62487f0 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 4a71987b70c..722d2646b50 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 0ac65aa1c9c..accc1c816a7 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 243c69505d9..7c578e51d84 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 e4fc0834dd0..a2810309cda 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 977b0f7e934..d94f213333b 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 9f9feb15a94..eda3fffc320 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 9ce08855dc6..561937eda55 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 7af28c5c50c..0285375b1c0 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 84547a057b3..e3ebf898ac8 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 b283eda0a2a..c4cb9d60474 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 48e25938e18..69019a202d5 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 cf59d4f149d..50f6baf2039 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/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 f11710d34b6..be8f0baefc0 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 4bb20ee9627..af9c2188587 100644 --- a/app/code/core/Mage/Bundle/etc/config.xml +++ b/app/code/core/Mage/Bundle/etc/config.xml @@ -21,14 +21,14 @@ * * @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) */ --> <config> <modules> <Mage_Bundle> - <version>1.6.0.0</version> + <version>1.6.0.0.1</version> </Mage_Bundle> </modules> <global> diff --git a/app/code/core/Mage/Bundle/etc/fieldset.xml b/app/code/core/Mage/Bundle/etc/fieldset.xml index e97bd79595a..6e7b334120d 100644 --- a/app/code/core/Mage/Bundle/etc/fieldset.xml +++ b/app/code/core/Mage/Bundle/etc/fieldset.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) */ --> 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 30f535f2c9d..759c47cdfe2 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-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 00000000000..43e2bf45535 --- /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 @@ +<?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_Bundle + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +$installFile = dirname(__FILE__) . DS . 'upgrade-1.6.0.0-1.6.0.0.1.php'; +if (file_exists($installFile)) { + include $installFile; +} + +/** @var $installer Mage_Catalog_Model_Resource_Setup */ +$installer = $this; +/** @var $connection Varien_Db_Adapter_Pdo_Mysql */ +$connection = $installer->getConnection(); +$memoryTables = array( + 'catalog_product_index_price_bundle_opt_tmp', + 'catalog_product_index_price_bundle_sel_tmp', + 'catalog_product_index_price_bundle_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 00000000000..214d8d91942 --- /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 @@ +<?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_Bundle + * @copyright 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_Catalog_Model_Resource_Setup */ +$installer = $this; +$connection = $installer->getConnection(); + +$priceIndexerTables = array( + 'catalog_product_index_price_bundle_idx', + 'catalog_product_index_price_bundle_tmp', +); + +$optionsPriceIndexerTables = array( + 'catalog_product_index_price_bundle_opt_idx', + 'catalog_product_index_price_bundle_opt_tmp', +); + +$selectionPriceIndexerTables = array( + 'catalog_product_index_price_bundle_sel_idx', + 'catalog_product_index_price_bundle_sel_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/Bundle/view/adminhtml/layout.xml b/app/code/core/Mage/Bundle/view/adminhtml/layout.xml index 217e6b9ee7c..04088e94f24 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Bundle/view/adminhtml/layout.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/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml index 7ec25c4ec74..812eaee17ca 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.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/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml index ee9fe0f65e2..5e99121107a 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.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/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml index 4d9420abf44..fb6fc84c932 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.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/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml index 4ca4f23e7ab..2675e600acd 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.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/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml index abde139db0d..31526f04286 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/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/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle.phtml index 0edb2a0043f..9fbde6677e2 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle.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/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option.phtml index 7f681f66a70..0eddff17e2f 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/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) */ ?> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/search.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/search.phtml index 7a2fe9ba4f7..3649d47e9ff 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/search.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/search.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/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/selection.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/selection.phtml index 19e9b608a6d..4db875553be 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/selection.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/selection.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/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/create/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/create/items/renderer.phtml index 9fa999f9429..f67f5a9446e 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/create/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/create/items/renderer.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/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/view/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/view/items/renderer.phtml index 43fee1b0a78..cb0501c3c00 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/view/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/view/items/renderer.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/code/core/Mage/Bundle/view/adminhtml/sales/invoice/create/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/create/items/renderer.phtml index da23543ee15..4a347c2d07d 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/create/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/create/items/renderer.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/code/core/Mage/Bundle/view/adminhtml/sales/invoice/view/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/view/items/renderer.phtml index b585e15270c..e5aec80b512 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/view/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/view/items/renderer.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/code/core/Mage/Bundle/view/adminhtml/sales/order/view/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/order/view/items/renderer.phtml index 5b70bbd1802..991801fbaaa 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/order/view/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/order/view/items/renderer.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/code/core/Mage/Bundle/view/adminhtml/sales/shipment/create/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/create/items/renderer.phtml index 197f96021c3..8924cf628b3 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/create/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/create/items/renderer.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/code/core/Mage/Bundle/view/adminhtml/sales/shipment/view/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/view/items/renderer.phtml index b89b9de260c..9d5e11e269d 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/view/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/view/items/renderer.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/code/core/Mage/Bundle/view/frontend/bundle.js b/app/code/core/Mage/Bundle/view/frontend/bundle.js index 56c8c82c69f..e803e253c8c 100644 --- a/app/code/core/Mage/Bundle/view/frontend/bundle.js +++ b/app/code/core/Mage/Bundle/view/frontend/bundle.js @@ -19,7 +19,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) */ if(typeof Product=='undefined') { diff --git a/app/code/core/Mage/Bundle/view/frontend/catalog/product/price.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/price.phtml index df093c98d46..7ad2d7b58d3 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/price.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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 @@ <?php if ($_product->getPriceType() == 1) { $_weeeTaxAmount = Mage::helper('Mage_Weee_Helper_Data')->getAmount($_product); + $_weeeTaxAmountInclTaxes = $_weeeTaxAmount; + if (Mage::helper('Mage_Weee_Helper_Data')->isTaxable()) { + $_attributes = Mage::helper('Mage_Weee_Helper_Data')->getProductWeeeAttributesForRenderer($_product, null, null, null, true); + $_weeeTaxAmountInclTaxes = Mage::helper('Mage_Weee_Helper_Data')->getAmountInclTaxes($_attributes); + } if ($_weeeTaxAmount && Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, array(0, 1, 4))) { $_minimalPriceTax += $_weeeTaxAmount; - $_minimalPriceInclTax += $_weeeTaxAmount; + $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes; } if ($_weeeTaxAmount && Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, 2)) { - $_minimalPriceInclTax += $_weeeTaxAmount; + $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes; } if (Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, array(1, 2, 4))) { @@ -153,10 +158,10 @@ if ($_product->getPriceType() == 1) { if ($_product->getPriceType() == 1) { if ($_weeeTaxAmount && Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, array(0, 1, 4))) { $_maximalPriceTax += $_weeeTaxAmount; - $_maximalPriceInclTax += $_weeeTaxAmount; + $_maximalPriceInclTax += $_weeeTaxAmountInclTaxes; } if ($_weeeTaxAmount && Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, 2)) { - $_maximalPriceInclTax += $_weeeTaxAmount; + $_maximalPriceInclTax += $_weeeTaxAmountInclTaxes; } } ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/options/notice.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/options/notice.phtml index 8a4b97da0f1..93c8ff90e2c 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/options/notice.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/catalog/product/view/price.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/price.phtml index 10b6bcf98ec..8d9a5d297c5 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/price.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/catalog/product/view/tierprices.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/tierprices.phtml index 80576267bef..adf0f60e559 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/tierprices.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle.phtml index 8f331941f74..2ba0a21a548 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/checkbox.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/checkbox.phtml index 47f5b382d9a..cc04c120ddb 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/checkbox.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/multi.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/multi.phtml index 78f77409640..5f115c67214 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/multi.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml index a8af8fd096d..f02ad6fea9c 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml index 0d28c8fdae5..c8cf9e8f883 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/options.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/options.phtml index 1e1aa4f2eca..c52f0ace169 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/options.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/email/order/items/creditmemo/default.phtml b/app/code/core/Mage/Bundle/view/frontend/email/order/items/creditmemo/default.phtml index b362fd38ed0..8cf26befcd0 100644 --- a/app/code/core/Mage/Bundle/view/frontend/email/order/items/creditmemo/default.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/email/order/items/invoice/default.phtml b/app/code/core/Mage/Bundle/view/frontend/email/order/items/invoice/default.phtml index 1ae55618798..ee29073b941 100644 --- a/app/code/core/Mage/Bundle/view/frontend/email/order/items/invoice/default.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/email/order/items/order/default.phtml b/app/code/core/Mage/Bundle/view/frontend/email/order/items/order/default.phtml index 60356b42475..e5c5eee673e 100644 --- a/app/code/core/Mage/Bundle/view/frontend/email/order/items/order/default.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/email/order/items/shipment/default.phtml b/app/code/core/Mage/Bundle/view/frontend/email/order/items/shipment/default.phtml index 59a87236604..2a9e4ec5353 100644 --- a/app/code/core/Mage/Bundle/view/frontend/email/order/items/shipment/default.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/layout.xml b/app/code/core/Mage/Bundle/view/frontend/layout.xml index f0123909477..b03fe0fcd2e 100644 --- a/app/code/core/Mage/Bundle/view/frontend/layout.xml +++ b/app/code/core/Mage/Bundle/view/frontend/layout.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/code/core/Mage/Bundle/view/frontend/rss/catalog/product/price.phtml b/app/code/core/Mage/Bundle/view/frontend/rss/catalog/product/price.phtml index 90233fd6c79..95b494afe38 100644 --- a/app/code/core/Mage/Bundle/view/frontend/rss/catalog/product/price.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/sales/order/creditmemo/items/renderer.phtml b/app/code/core/Mage/Bundle/view/frontend/sales/order/creditmemo/items/renderer.phtml index b4b8514d4b8..00a5f0f7c60 100644 --- a/app/code/core/Mage/Bundle/view/frontend/sales/order/creditmemo/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/sales/order/invoice/items/renderer.phtml b/app/code/core/Mage/Bundle/view/frontend/sales/order/invoice/items/renderer.phtml index 9d109336948..977d7e34361 100644 --- a/app/code/core/Mage/Bundle/view/frontend/sales/order/invoice/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/sales/order/items/renderer.phtml b/app/code/core/Mage/Bundle/view/frontend/sales/order/items/renderer.phtml index 7153357e375..0398cbea96e 100644 --- a/app/code/core/Mage/Bundle/view/frontend/sales/order/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Bundle/view/frontend/sales/order/shipment/items/renderer.phtml b/app/code/core/Mage/Bundle/view/frontend/sales/order/shipment/items/renderer.phtml index 17afe53ea51..5349e886843 100644 --- a/app/code/core/Mage/Bundle/view/frontend/sales/order/shipment/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/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/code/core/Mage/Captcha/Block/Captcha.php b/app/code/core/Mage/Captcha/Block/Captcha.php new file mode 100755 index 00000000000..7453fb41902 --- /dev/null +++ b/app/code/core/Mage/Captcha/Block/Captcha.php @@ -0,0 +1,48 @@ +<?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_Captcha + * @copyright 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 block + * + * @category Core + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Block_Captcha extends Mage_Core_Block_Template +{ + /** + * Renders captcha HTML (if required) + * + * @return string + */ + protected function _toHtml() + { + $blockPath = Mage::helper('Mage_Captcha_Helper_Data')->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 00000000000..814a173f193 --- /dev/null +++ b/app/code/core/Mage/Captcha/Block/Captcha/Zend.php @@ -0,0 +1,87 @@ +<?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_Captcha + * @copyright 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 block + * + * @category Core + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Block_Captcha_Zend extends Mage_Core_Block_Template +{ + protected $_template = '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('Mage_Captcha_Helper_Data')->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 00000000000..bb6dbee4f2c --- /dev/null +++ b/app/code/core/Mage/Captcha/Helper/Data.php @@ -0,0 +1,138 @@ +<?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_Captcha + * @copyright 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 image model + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +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 = ucfirst($this->getConfigNode('type')); + $this->_captcha[$formId] = Mage::getModel('Mage_Captcha_Model_' . $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/Config/Font.php b/app/code/core/Mage/Captcha/Model/Config/Font.php new file mode 100755 index 00000000000..7b11ef2b53a --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Font.php @@ -0,0 +1,49 @@ +<?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_Captcha + * @copyright 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 image model + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Model_Config_Font +{ + /** + * Get options for font selection field + * + * @return array + */ + public function toOptionArray() + { + $optionArray = array(); + foreach (Mage::helper('Mage_Captcha_Helper_Data')->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 00000000000..444b5d3a1f0 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php @@ -0,0 +1,61 @@ +<?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_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Data source to fill "Forms" field + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +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 00000000000..568c70ddb01 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php @@ -0,0 +1,40 @@ +<?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_Captcha + * @copyright 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 image model + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +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 00000000000..112903c3031 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Form/Frontend.php @@ -0,0 +1,40 @@ +<?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_Captcha + * @copyright 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 image model + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +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 00000000000..02cb7aa1f2d --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Mode.php @@ -0,0 +1,54 @@ +<?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_Captcha + * @copyright 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 image model + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Model_Config_Mode +{ + /** + * Get options for captcha mode selection field + * + * @return array + */ + public function toOptionArray() + { + return array( + array( + 'label' => Mage::helper('Mage_Captcha_Helper_Data')->__('Always'), + 'value' => Mage_Captcha_Helper_Data::MODE_ALWAYS + ), + array( + 'label' => Mage::helper('Mage_Captcha_Helper_Data')->__('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 00000000000..2fa086c8be4 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Interface.php @@ -0,0 +1,60 @@ +<?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_Captcha + * @copyright 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 interface + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +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 00000000000..8eb1ab84943 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Observer.php @@ -0,0 +1,292 @@ +<?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_Captcha + * @copyright 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 Observer + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Captcha_Helper_Data')->getCaptcha($formId); + if ($captchaModel->isRequired()) { + $controller = $observer->getControllerAction(); + if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { + Mage::getSingleton('Mage_Customer_Model_Session')->addError(Mage::helper('Mage_Captcha_Helper_Data')->__('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('Mage_Captcha_Helper_Data')->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('Mage_Customer_Model_Session')->addError(Mage::helper('Mage_Captcha_Helper_Data')->__('Incorrect CAPTCHA.')); + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + Mage::getSingleton('Mage_Customer_Model_Session')->setUsername($login); + $beforeUrl = Mage::getSingleton('Mage_Customer_Model_Session')->getBeforeAuthUrl(); + $url = $beforeUrl ? $beforeUrl : Mage::helper('Mage_Customer_Helper_Data')->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('Mage_Captcha_Helper_Data')->getCaptcha($formId); + if ($captchaModel->isRequired()) { + $controller = $observer->getControllerAction(); + if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { + Mage::getSingleton('Mage_Customer_Model_Session')->addError(Mage::helper('Mage_Captcha_Helper_Data')->__('Incorrect CAPTCHA.')); + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + Mage::getSingleton('Mage_Customer_Model_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('Mage_Captcha_Helper_Data')->getCaptcha($formId); + $checkoutMethod = Mage::getSingleton('Mage_Checkout_Model_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('Mage_Captcha_Helper_Data')->__('Incorrect CAPTCHA.')); + $controller->getResponse()->setBody(Mage::helper('Mage_Core_Helper_Data')->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('Mage_Captcha_Helper_Data')->getCaptcha($formId); + $checkoutMethod = Mage::getSingleton('Mage_Checkout_Model_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('Mage_Captcha_Helper_Data')->__('Incorrect CAPTCHA.')); + $controller->getResponse()->setBody(Mage::helper('Mage_Core_Helper_Data')->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('Mage_Captcha_Helper_Data')->getCaptcha($formId); + $loginParams = Mage::app()->getRequest()->getPost('login'); + $login = is_array($loginParams) && 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('Mage_Captcha_Helper_Data')->__('Incorrect CAPTCHA.')); + } + } + $captchaModel->logAttempt($login); + return $this; + } + + /** + * Returns backend session + * + * @return Mage_Adminhtml_Model_Session + */ + protected function _getBackendSession() + { + return Mage::getSingleton('Mage_Adminhtml_Model_Session'); + } + + /** + * 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('Mage_Captcha_Helper_Data')->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->_getBackendSession()->setEmail((string) $controller->getRequest()->getPost('email')); + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + $this->_getBackendSession()->addError(Mage::helper('Mage_Captcha_Helper_Data')->__('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('Mage_Captcha_Model_Resource_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('Mage_Captcha_Helper_Data')->getConfigNode('timeout', $website->getDefaultStore())*60; + $imageDirectory = Mage::helper('Mage_Captcha_Helper_Data')->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('Mage_Captcha_Model_Resource_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 00000000000..9a9490611cd --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Resource/Log.php @@ -0,0 +1,156 @@ +<?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_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Log Attempts resource + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Core_Model_Date')->gmtDate() + ), + array('count' => new Zend_Db_Expr('count+1'), 'updated_at') + ); + } + $ip = Mage::helper('Mage_Core_Helper_Http')->getRemoteAddr(); + if ($ip != null) { + $this->_getWriteAdapter()->insertOnDuplicate( + $this->getMainTable(), + array( + 'type' => self::TYPE_REMOTE_ADDRESS, 'value' => $ip, 'count' => 1, + 'updated_at' => Mage::getSingleton('Mage_Core_Model_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('Mage_Core_Helper_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('Mage_Core_Helper_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('Mage_Core_Model_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 new file mode 100755 index 00000000000..435dd9a9a8b --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Zend.php @@ -0,0 +1,504 @@ +<?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_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Implementation of Zend_Captcha + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +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; + + /** + * 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()); + } + + /** + * Returns key with respect of current form ID + * + * @param string $key + * @return string + */ + protected function _getFormIdKey($key) + { + return $this->_formId . '_' . $key; + } + + /** + * Get Block Name + * + * @return string + */ + public function getBlockName() + { + return 'Mage_Captcha_Block_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) + || $this->getSession()->getData($this->_getFormIdKey('show_captcha')) + ); + } + + /** + * Check is overlimit attempts + * + * @param string $login + * @return bool + */ + protected function _isOverLimitAttempts($login) + { + return ($this->_isOverLimitIpAttempt() || $this->_isOverLimitLoginAttempts($login)); + } + + /** + * Returns number of allowed attempts for same login + * + * @return int + */ + protected function _getAllowedAttemptsForSameLogin() + { + 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'); + } + + /** + * Check is overlimit saved attempts from one ip + * + * @return bool + */ + protected function _isOverLimitIpAttempt() + { + $countAttemptsByIp = Mage::getResourceModel('Mage_Captcha_Model_Resource_Log')->countAttemptsByRemoteAddress(); + return $countAttemptsByIp >= $this->_getAllowedAttemptsFromSameIp(); + } + + /** + * Is Over Limit Login Attempts + * + * @param string $login + * @return bool + */ + protected function _isOverLimitLoginAttempts($login) + { + if ($login != false) { + $countAttemptsByLogin = Mage::getResourceModel('Mage_Captcha_Model_Resource_Log')->countAttemptsByUserLogin($login); + return ($countAttemptsByLogin >= $this->_getAllowedAttemptsForSameLogin()); + } + return false; + } + + /** + * Check is user auth + * + * @return bool + */ + protected function _isUserAuth() + { + return Mage::app()->getStore()->isAdmin() + ? Mage::getSingleton('Mage_Admin_Model_Session')->isLoggedIn() + : Mage::getSingleton('Mage_Customer_Model_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_Customer_Model_Session + */ + public function getSession() + { + return Mage::getSingleton('Mage_Customer_Model_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())) { + Mage::getResourceModel('Mage_Captcha_Model_Resource_Log')->logAttempt($login); + if ($this->_isOverLimitLoginAttempts($login)) { + $this->getSession()->setData($this->_getFormIdKey('show_captcha'), 1); + } + } + 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_Data + */ + protected function _getHelper() + { + if (empty($this->_helper)) { + $this->_helper = Mage::helper('Mage_Captcha_Helper_Data'); + } + 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->_getFormIdKey(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->_getFormIdKey(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->_getFormIdKey(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 00000000000..09d0f5fb218 --- /dev/null +++ b/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.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_Captcha + * @copyright 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 controller + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Captcha_Helper_Data')->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 00000000000..dcc3c7f1815 --- /dev/null +++ b/app/code/core/Mage/Captcha/controllers/RefreshController.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_Captcha + * @copyright 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 controller + * + * @category Mage + * @package Mage_Core + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Captcha_Helper_Data')->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 00000000000..a16dd6d31fb --- /dev/null +++ b/app/code/core/Mage/Captcha/etc/config.xml @@ -0,0 +1,250 @@ +<?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_Captcha + * @copyright 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> + <modules> + <Mage_Captcha> + <version>1.7.0.0.0</version> + </Mage_Captcha> + </modules> + <global> + <resources> + <captcha_setup> + <setup> + <module>Mage_Captcha</module> + </setup> + </captcha_setup> + </resources> + <events> + <controller_action_predispatch_customer_account_loginPost> + <observers> + <captcha> + <class>Mage_Captcha_Model_Observer</class> + <method>checkUserLogin</method> + </captcha> + </observers> + </controller_action_predispatch_customer_account_loginPost> + <controller_action_predispatch_customer_account_forgotpasswordpost> + <observers> + <captcha> + <class>Mage_Captcha_Model_Observer</class> + <method>checkForgotPassword</method> + </captcha> + </observers> + </controller_action_predispatch_customer_account_forgotpasswordpost> + <controller_action_predispatch_customer_account_createpost> + <observers> + <captcha> + <class>Mage_Captcha_Model_Observer</class> + <method>checkUserCreate</method> + </captcha> + </observers> + </controller_action_predispatch_customer_account_createpost> + <controller_action_predispatch_adminhtml_index_forgotpassword> + <observers> + <captcha> + <class>Mage_Captcha_Model_Observer</class> + <method>checkUserForgotPasswordBackend</method> + </captcha> + </observers> + </controller_action_predispatch_adminhtml_index_forgotpassword> + <admin_user_authenticate_before> + <observers> + <captcha> + <class>Mage_Captcha_Model_Observer</class> + <method>checkUserLoginBackend</method> + </captcha> + </observers> + </admin_user_authenticate_before> + <controller_action_predispatch_checkout_onepage_saveBilling> + <observers> + <captcha_guest> + <class>Mage_Captcha_Model_Observer</class> + <method>checkGuestCheckout</method> + </captcha_guest> + <captcha_register> + <class>Mage_Captcha_Model_Observer</class> + <method>checkRegisterCheckout</method> + </captcha_register> + </observers> + </controller_action_predispatch_checkout_onepage_saveBilling> + <customer_customer_authenticated> + <observers> + <captcha_reset_attempt> + <class>Mage_Captcha_Model_Observer</class> + <method>resetAttemptForFrontend</method> + </captcha_reset_attempt> + </observers> + </customer_customer_authenticated> + <admin_session_user_login_success> + <observers> + <captcha_reset_attempt> + <class>Mage_Captcha_Model_Observer</class> + <method>resetAttemptForBackend</method> + </captcha_reset_attempt> + </observers> + </admin_session_user_login_success> + </events> + </global> + <frontend> + <routers> + <captcha> + <use>standard</use> + <args> + <module>Mage_Captcha</module> + <frontName>captcha</frontName> + </args> + </captcha> + </routers> + <layout> + <updates> + <captcha module="Mage_Captcha"> + <file>layout.xml</file> + </captcha> + </updates> + </layout> + </frontend> + <admin> + <routers> + <adminhtml> + <args> + <modules> + <captcha>Mage_Captcha_Adminhtml</captcha> + </modules> + </args> + </adminhtml> + </routers> + </admin> + <adminhtml> + <layout> + <updates> + <captcha module="Mage_Captcha"> + <file>layout.xml</file> + </captcha> + </updates> + </layout> + </adminhtml> + <default> + <admin> + <captcha> + <type>zend</type> + <enable>0</enable> + <font>linlibertine</font> + <mode>after_fail</mode> + <forms>backend_forgotpassword</forms> + <failed_attempts_login>3</failed_attempts_login> + <failed_attempts_ip>1000</failed_attempts_ip> + <timeout>7</timeout> + <length>4-5</length> + <symbols>ABCDEFGHJKMnpqrstuvwxyz23456789</symbols> + <case_sensitive>0</case_sensitive> + <always_for> + <backend_forgotpassword>1</backend_forgotpassword> + </always_for> + </captcha> + </admin> + <customer> + <captcha> + <type>zend</type> + <enable>0</enable> + <font>linlibertine</font> + <mode>after_fail</mode> + <forms>user_forgotpassword</forms> + <failed_attempts_login>3</failed_attempts_login> + <failed_attempts_ip>1000</failed_attempts_ip> + <timeout>7</timeout> + <length>4-5</length> + <symbols>ABCDEFGHJKMnpqrstuvwxyz23456789</symbols> + <case_sensitive>0</case_sensitive> + <always_for> + <user_create>1</user_create> + <user_forgotpassword>1</user_forgotpassword> + <guest_checkout>1</guest_checkout> + <register_during_checkout>1</register_during_checkout> + </always_for> + </captcha> + </customer> + <captcha translate="label"> + <fonts> + <linlibertine> + <label>LinLibertine</label> + <path>lib/LinLibertineFont/LinLibertine_Bd-2.8.1.ttf</path> + </linlibertine> + </fonts> + <frontend> + <areas> + <user_create> + <label>Create user</label> + </user_create> + <user_login> + <label>Login</label> + </user_login> + <user_forgotpassword> + <label>Forgot password</label> + </user_forgotpassword> + <guest_checkout> + <label>Checkout as Guest</label> + </guest_checkout> + <register_during_checkout> + <label>Register during Checkout</label> + </register_during_checkout> + </areas> + </frontend> + <backend> + <areas> + <backend_login> + <label>Admin Login</label> + </backend_login> + <backend_forgotpassword> + <label>Admin Forgot Password</label> + </backend_forgotpassword> + </areas> + </backend> + </captcha> + </default> + <crontab> + <jobs> + <captcha_delete_old_attempts> + <schedule> + <cron_expr>*/30 * * * *</cron_expr> + </schedule> + <run> + <model>Mage_Captcha_Model_Observer::deleteOldAttempts</model> + </run> + </captcha_delete_old_attempts> + <captcha_delete_expired_images> + <schedule> + <cron_expr>*/10 * * * *</cron_expr> + </schedule> + <run> + <model>Mage_Captcha_Model_Observer::deleteExpiredImages</model> + </run> + </captcha_delete_expired_images> + + </jobs> + </crontab> +</config> 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 00000000000..a0b1e6e7232 --- /dev/null +++ b/app/code/core/Mage/Captcha/etc/system.xml @@ -0,0 +1,250 @@ +<?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_Captcha + * @copyright 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> + <sections> + <admin> + <groups> + <captcha translate="label"> + <label>CAPTCHA</label> + <frontend_type>text</frontend_type> + <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> + <fields> + <enable translate="label"> + <label>Enable CAPTCHA in Admin</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>1</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </enable> + <font translate="label"> + <label>Font</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Captcha_Model_Config_Font</source_model> + <sort_order>2</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </font> + <forms translate="label"> + <label>Forms</label> + <frontend_type>multiselect</frontend_type> + <source_model>Mage_Captcha_Model_Config_Form_Backend</source_model> + <sort_order>3</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </forms> + <mode translate="label"> + <label>Displaying Mode</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Captcha_Model_Config_Mode</source_model> + <sort_order>4</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </mode> + <failed_attempts_login translate="label comment"> + <label>Number of Unsuccessful Attempts to Login</label> + <frontend_type>text</frontend_type> + <comment>If 0 is specified, CAPTCHA on the Login form will be always available.</comment> + <sort_order>5</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends> + <mode>after_fail</mode> + <enable>1</enable> + </depends> + <frontend_class>required-entry validate-digits</frontend_class> + </failed_attempts_login> + <timeout translate="label"> + <label>CAPTCHA Timeout (minutes)</label> + <frontend_type>text</frontend_type> + <sort_order>6</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + <frontend_class>required-entry validate-digits</frontend_class> + </timeout> + <length translate="label comment"> + <label>Number of Symbols</label> + <frontend_type>text</frontend_type> + <comment>Please specify 8 symbols at the most. Range allowed (e.g. 3-5)</comment> + <sort_order>7</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + <frontend_class>required-entry</frontend_class> + </length> + <symbols translate="label comment"> + <label>Symbols Used in CAPTCHA</label> + <frontend_type>text</frontend_type> + <comment><![CDATA[Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.<br />Similar looking characters (e.g. "i", "l", "1") decrease chance of correct recognition by customer.]]></comment> + <sort_order>8</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + <frontend_class>required-entry validate-alphanum</frontend_class> + </symbols> + <case_sensitive translate="label"> + <label>Case Sensitive</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>9</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </case_sensitive> + </fields> + </captcha> + </groups> + </admin> + <customer> + <groups> + <captcha translate="label"> + <label>CAPTCHA</label> + <frontend_type>text</frontend_type> + <sort_order>110</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <fields> + <enable translate="label"> + <label>Enable CAPTCHA on Frontend</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>1</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </enable> + <font translate="label"> + <label>Font</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Captcha_Model_Config_Font</source_model> + <sort_order>2</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </font> + <forms translate="label comment"> + <label>Forms</label> + <frontend_type>multiselect</frontend_type> + <source_model>Mage_Captcha_Model_Config_Form_Frontend</source_model> + <comment>CAPTCHA for "Create user" and "Forgot password" forms is always enabled if chosen</comment> + <sort_order>3</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </forms> + <mode translate="label"> + <label>Displaying Mode</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Captcha_Model_Config_Mode</source_model> + <sort_order>4</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </mode> + <failed_attempts_login translate="label comment"> + <label>Number of Unsuccessful Attempts to Login</label> + <frontend_type>text</frontend_type> + <comment>If 0 is specified, CAPTCHA on the Login form will be always available.</comment> + <sort_order>5</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends> + <enable>1</enable> + <mode>after_fail</mode> + </depends> + <frontend_class>required-entry validate-digits</frontend_class> + </failed_attempts_login> + <timeout translate="label"> + <label>CAPTCHA Timeout (minutes)</label> + <frontend_type>text</frontend_type> + <sort_order>6</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + <frontend_class>required-entry validate-digits</frontend_class> + </timeout> + <length translate="label comment"> + <label>Number of Symbols</label> + <frontend_type>text</frontend_type> + <comment>Please specify 8 symbols at the most. Range allowed (e.g. 3-5)</comment> + <sort_order>7</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + <frontend_class>required-entry</frontend_class> + </length> + <symbols translate="label comment"> + <label>Symbols Used in CAPTCHA</label> + <frontend_type>text</frontend_type> + <comment><![CDATA[Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.<br />Similar looking characters (e.g. "i", "l", "1") decrease chance of correct recognition by customer.]]></comment> + <sort_order>8</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + <frontend_class>required-entry validate-alphanum</frontend_class> + </symbols> + <case_sensitive translate="label"> + <label>Case Sensitive</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>9</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </case_sensitive> + </fields> + </captcha> + </groups> + </customer> + </sections> +</config> 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 00000000000..82d3f629527 --- /dev/null +++ b/app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php @@ -0,0 +1,52 @@ +<?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_Captcha + * @copyright 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 */ +$installer = $this; + +$installer->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/Captcha/view/adminhtml/layout.xml b/app/code/core/Mage/Captcha/view/adminhtml/layout.xml new file mode 100644 index 00000000000..0ae5f1a74e4 --- /dev/null +++ b/app/code/core/Mage/Captcha/view/adminhtml/layout.xml @@ -0,0 +1,47 @@ +<?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 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) + */ +--> +<layout version="0.1.0"> + <adminhtml_index_login> + <reference name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha"> + <action method="setFormId"><formId>backend_login</formId></action> + <action method="setImgWidth"><width>226</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </reference> + </adminhtml_index_login> + <adminhtml_index_forgotpassword> + <reference name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha"> + <action method="setFormId"><formId>backend_forgotpassword</formId></action> + <action method="setImgWidth"><width>226</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </reference> + </adminhtml_index_forgotpassword> +</layout> diff --git a/app/code/core/Mage/Captcha/view/adminhtml/reload.png b/app/code/core/Mage/Captcha/view/adminhtml/reload.png new file mode 100644 index 0000000000000000000000000000000000000000..2b1e64bc158ab6cb284628823b12db2af8565dfc GIT binary patch literal 1538 zcmV+d2L1VoP)<h;3K|Lk000e1NJLTq000;O000;W1^@s6;CDUv00004b3#c}2nYxW zd<bNS000HKNkl<ZNQt$UTa1-g6~}*Tf8Te$bDcY9t_(2TN`N*^1H_V$ng*j7ZHP5Z zUo`R2H+|KIHu})`YBVPGMG`gDL~XUzSg}+trG#6_%z(hm6wWZr0CVQdxqa8Yw-2W? zEfN}ET*-deS;_jXwf2AQz2X0C@_EkbZ*EuFq482?WXnb;Um6uZ+YKT%4pw!$c{jdy z`*u{BsqgyzP5rnS?&BPjN6KD)%Z`J&t$V-b4UHdkviU(#ZXOV8(zc0$2bqDvv&!@S zIQiB3sXcGsi~gqyre50U`u!WW7I!@Jsz3h3mz+XR3B<7$5D_eZwIX1#+O+G<X#U3O z_RY&bY%f-(_PkL^J{!;Z?B=5v``zN$rZ46<?|j7{nK+`9Q!q*Dh?f_qG$5)pfXa8H zoQ#+_5!0?IF^R8o`3dE!-O9vwzcU)%{zh5rW4H99E%FP6t(o4w?|D7_&l9ygV;%7} z@5Y~a3RUbzTn_-7CYYc}JU2-)b6#v%cQa$V4w|6;eSc+PsV`_>eB=yHf4Sggd%J(+ zb#*;&!=@*Lqmn;x6mNJ7048W+8g;-Tejc~GANT3!NJh7jEPjkzDmrHQ=ArCB-)lh_ zya?_3I^g{yMW?Ie9P<164hz;3FDLo^FW?Pr#>N5R^hx5`E9ljGU@cB}8E<?S*}c!< z4UXe(7$d1%5ip+L-Fqmrbm#EDjuiiN=$)o^0rELj%5~+x?qmx^L?p9)Ki=>JHVFwX z{f+hqf4~L}Fctv4c!PNEBC30c?9P2C*9B`p$D(q1KU>JYkZlI<0aX{k&3c=??(S!; zjUA_J1OCou0SG6L(?0WCY^z2`J!{g);EwOXE01AXE1ed$YS^R=I>zfN9mq7>6VUhs z;K`VBWDp(U^bX>54Pe4L@yuCl>s}|jjyyX6Yp~VpH2?e>Rs;l0*ub<OfYB(=>2*A3 z960X+h@uD5oY+)UzJz!_roM!(&OzG5V!_%^tI#ddyDMk`93KjU;ATO2paT%?D~H~- zLl%uuHeMCI+9EjjE8^?#Vv`8H_-||+Je>Wybuw4w?Q|Xe0p7?inkRlv`_wP6Q6$<V z3J@2tfu_+Tgh*;lYe{f@B-f8K@?@tYQ5{p81s!!b@+rg_7)SLCgHqUV8HllB<3Ljf ztP9YH%~Ba^;;IqJm&kwNTlhN;gDAifockrwm3fGhhl_A>coPS3y2_Z=GP*X4IA9db zW?~ls6hNhJ<{GiND4rOVadCUgxaA4l4V$pRGRf>ah!df5&iax<0srZj$v^Wl;$?|v zj$^9V5Km~tcCu2}GwXwPWiejvEvUB#2E3!bD+L6>q@Wz!@(!~5zDrU$g>BA*wW#7K z&d7dpPrZaH_M@vaM3cV;-LOW`m1_Eziwp7nb--_?!+5c2{;_pDGdbKR`%y@I>ph&l zZ8$v><o10V|B0_)+RGh4z8_U8BVHE0GDCRbXPDY`tio1X=K9&&@n3&;EsWrk+q9KJ zrJ;k}Wp}>Zo7wA|<qgU7F-aFr2_`@l2T}PxoYD|ZR~hj#*tkYK^CscBpOD@;gVEZo zH1za^+31z4i^+#4Zl!h|01#;y$jMSq&NQ>>(xzNCEvuv|dik>G<xA+=6lP@#eg8aZ z<?kdn-yoTN3){S7t<ko+nqHm09sl&iweYQf&P3sI(2?~+@4@A}X`EAbE(p_GeMM(? zsiX#!N|cT6Vpp$Xs+TYiE}*NE*j5E}h)%6uyr0gVoDP3{d@6YJ_47e(E%+k<fNIl3 z7<=P`nebhc*ab&{>yfi!t+m={W6~tiK|9bZ^NZ<)vs3NYkDYA1I=zs*e|k1<uSO3K z<YOOw-$4#+_6kpK%nWZE^>z>Tx#NYL>On->ZC!h?s_)!fNTxpeIG#T<7dIpQ$f$ol o;J-}KQQTU^21tR&{wCJ!KhPV<Zd|KM(EtDd07*qoM6N<$f+J)7SO5S3 literal 0 HcmV?d00001 diff --git a/app/code/core/Mage/Captcha/view/adminhtml/zend.phtml b/app/code/core/Mage/Captcha/view/adminhtml/zend.phtml new file mode 100644 index 00000000000..9ca705d4a92 --- /dev/null +++ b/app/code/core/Mage/Captcha/view/adminhtml/zend.phtml @@ -0,0 +1,57 @@ +<?php +/** + * 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_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php $captcha = $this->getCaptchaModel() ?> +<?php /* @var $this Mage_Core_Block_Captcha_Zend */ ?> +<div class="clear"></div> +<div class="captcha"> + <div class="captcha-input input-box input-left"> + <label for="captcha"><?php echo $this->__('Please type the letters from the image:') ?></label><br /> + <input type="text" name="<?php echo Mage_Captcha_Helper_Data::INPUT_NAME_FIELD_VALUE ?>[<?php echo $this->getFormId()?>]" id="captcha" class="required-entry input-text validation-failed"/> + </div> + <div class="captcha-image input-right"> + <img id="captcha-reload" class="captcha-reload" src="<?php echo $this->getSkinUrl('Mage_Captcha::reload.png') ?>" alt="<?php echo $this->__('Reload captcha') ?>"/> + <img id="<?php echo $this->getFormId() ?>" width="<?php echo $this->getImgWidth() ?>" height="<?php echo $this->getImgHeight() ?>" src="<?php echo $captcha->getImgSrc() ?>" /> + </div> +</div> +<?php if ($captcha->isCaseSensitive()) :?> +<div class="captcha-note"> + <p><?php echo $this->__('<strong>Attention</strong>: Captcha is case sensitive.') ?></p> +</div> +<?php endif; ?> +<script type="text/javascript"> +//<![CDATA[ + document.observe('dom:loaded', function () { + + var captcha = new Captcha('<?php echo $this->getRefreshUrl() ?>', '<?php echo $this->getFormId() ?>'); + + $('captcha-reload').observe('click', function () { + captcha.refresh(this); + }); + + }); +//]]> +</script> diff --git a/app/code/core/Mage/Captcha/view/frontend/layout.xml b/app/code/core/Mage/Captcha/view/frontend/layout.xml new file mode 100644 index 00000000000..8de21d6a6a1 --- /dev/null +++ b/app/code/core/Mage/Captcha/view/frontend/layout.xml @@ -0,0 +1,105 @@ +<?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 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) + */ +--> +<layout version="0.1.0"> + <customer_account_login> + <reference name="customer_form_login"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha"> + <reference name="head"> + <action method="addJs"><file>mage/captcha.js</file></action> + </reference> + <action method="setFormId"><formId>user_login</formId></action> + <action method="setImgWidth"><width>230</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </block> + </reference> + </customer_account_login> + <customer_account_forgotpassword> + <reference name="forgotPassword"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha"> + <reference name="head"> + <action method="addJs"><file>mage/captcha.js</file></action> + </reference> + <action method="setFormId"><formId>user_forgotpassword</formId></action> + <action method="setImgWidth"><width>230</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </block> + </reference> + </customer_account_forgotpassword> + <customer_account_create> + <reference name="customer_form_register"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha"> + <reference name="head"> + <action method="addJs"><file>mage/captcha.js</file></action> + </reference> + <action method="setFormId"><formId>user_create</formId></action> + <action method="setImgWidth"><width>230</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </block> + </reference> + </customer_account_create> + <checkout_onepage_index> + <reference name="checkout.onepage.login"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha"> + <reference name="head"> + <action method="addJs"><file>mage/captcha.js</file></action> + </reference> + <action method="setFormId"><formId>user_login</formId></action> + <action method="setImgWidth"><width>230</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </block> + </reference> + <reference name="checkout.onepage.billing"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha.guest.checkout"> + <reference name="head"> + <action method="addJs"><file>mage/captcha.js</file></action> + </reference> + <action method="setFormId"><formId>guest_checkout</formId></action> + <action method="setImgWidth"><width>230</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + <block type="Mage_Captcha_Block_Captcha" name="captcha.register.during.checkout"> + <reference name="head"> + <action method="addJs"><file>mage/captcha.js</file></action> + </reference> + <action method="setFormId"><formId>register_during_checkout</formId></action> + <action method="setImgWidth"><width>230</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </block> + </reference> + </checkout_onepage_index> +</layout> diff --git a/app/code/core/Mage/Captcha/view/frontend/reload.png b/app/code/core/Mage/Captcha/view/frontend/reload.png new file mode 100644 index 0000000000000000000000000000000000000000..2b1e64bc158ab6cb284628823b12db2af8565dfc GIT binary patch literal 1538 zcmV+d2L1VoP)<h;3K|Lk000e1NJLTq000;O000;W1^@s6;CDUv00004b3#c}2nYxW zd<bNS000HKNkl<ZNQt$UTa1-g6~}*Tf8Te$bDcY9t_(2TN`N*^1H_V$ng*j7ZHP5Z zUo`R2H+|KIHu})`YBVPGMG`gDL~XUzSg}+trG#6_%z(hm6wWZr0CVQdxqa8Yw-2W? zEfN}ET*-deS;_jXwf2AQz2X0C@_EkbZ*EuFq482?WXnb;Um6uZ+YKT%4pw!$c{jdy z`*u{BsqgyzP5rnS?&BPjN6KD)%Z`J&t$V-b4UHdkviU(#ZXOV8(zc0$2bqDvv&!@S zIQiB3sXcGsi~gqyre50U`u!WW7I!@Jsz3h3mz+XR3B<7$5D_eZwIX1#+O+G<X#U3O z_RY&bY%f-(_PkL^J{!;Z?B=5v``zN$rZ46<?|j7{nK+`9Q!q*Dh?f_qG$5)pfXa8H zoQ#+_5!0?IF^R8o`3dE!-O9vwzcU)%{zh5rW4H99E%FP6t(o4w?|D7_&l9ygV;%7} z@5Y~a3RUbzTn_-7CYYc}JU2-)b6#v%cQa$V4w|6;eSc+PsV`_>eB=yHf4Sggd%J(+ zb#*;&!=@*Lqmn;x6mNJ7048W+8g;-Tejc~GANT3!NJh7jEPjkzDmrHQ=ArCB-)lh_ zya?_3I^g{yMW?Ie9P<164hz;3FDLo^FW?Pr#>N5R^hx5`E9ljGU@cB}8E<?S*}c!< z4UXe(7$d1%5ip+L-Fqmrbm#EDjuiiN=$)o^0rELj%5~+x?qmx^L?p9)Ki=>JHVFwX z{f+hqf4~L}Fctv4c!PNEBC30c?9P2C*9B`p$D(q1KU>JYkZlI<0aX{k&3c=??(S!; zjUA_J1OCou0SG6L(?0WCY^z2`J!{g);EwOXE01AXE1ed$YS^R=I>zfN9mq7>6VUhs z;K`VBWDp(U^bX>54Pe4L@yuCl>s}|jjyyX6Yp~VpH2?e>Rs;l0*ub<OfYB(=>2*A3 z960X+h@uD5oY+)UzJz!_roM!(&OzG5V!_%^tI#ddyDMk`93KjU;ATO2paT%?D~H~- zLl%uuHeMCI+9EjjE8^?#Vv`8H_-||+Je>Wybuw4w?Q|Xe0p7?inkRlv`_wP6Q6$<V z3J@2tfu_+Tgh*;lYe{f@B-f8K@?@tYQ5{p81s!!b@+rg_7)SLCgHqUV8HllB<3Ljf ztP9YH%~Ba^;;IqJm&kwNTlhN;gDAifockrwm3fGhhl_A>coPS3y2_Z=GP*X4IA9db zW?~ls6hNhJ<{GiND4rOVadCUgxaA4l4V$pRGRf>ah!df5&iax<0srZj$v^Wl;$?|v zj$^9V5Km~tcCu2}GwXwPWiejvEvUB#2E3!bD+L6>q@Wz!@(!~5zDrU$g>BA*wW#7K z&d7dpPrZaH_M@vaM3cV;-LOW`m1_Eziwp7nb--_?!+5c2{;_pDGdbKR`%y@I>ph&l zZ8$v><o10V|B0_)+RGh4z8_U8BVHE0GDCRbXPDY`tio1X=K9&&@n3&;EsWrk+q9KJ zrJ;k}Wp}>Zo7wA|<qgU7F-aFr2_`@l2T}PxoYD|ZR~hj#*tkYK^CscBpOD@;gVEZo zH1za^+31z4i^+#4Zl!h|01#;y$jMSq&NQ>>(xzNCEvuv|dik>G<xA+=6lP@#eg8aZ z<?kdn-yoTN3){S7t<ko+nqHm09sl&iweYQf&P3sI(2?~+@4@A}X`EAbE(p_GeMM(? zsiX#!N|cT6Vpp$Xs+TYiE}*NE*j5E}h)%6uyr0gVoDP3{d@6YJ_47e(E%+k<fNIl3 z7<=P`nebhc*ab&{>yfi!t+m={W6~tiK|9bZ^NZ<)vs3NYkDYA1I=zs*e|k1<uSO3K z<YOOw-$4#+_6kpK%nWZE^>z>Tx#NYL>On->ZC!h?s_)!fNTxpeIG#T<7dIpQ$f$ol o;J-}KQQTU^21tR&{wCJ!KhPV<Zd|KM(EtDd07*qoM6N<$f+J)7SO5S3 literal 0 HcmV?d00001 diff --git a/app/code/core/Mage/Captcha/view/frontend/zend.phtml b/app/code/core/Mage/Captcha/view/frontend/zend.phtml new file mode 100644 index 00000000000..f6732e8972d --- /dev/null +++ b/app/code/core/Mage/Captcha/view/frontend/zend.phtml @@ -0,0 +1,52 @@ +<?php +/** + * 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_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php /* @var $this Mage_Core_Block_Captcha_Zend */ ?> + +<?php /* @var $captcha Mage_Core_Model_Captcha_Zend */ ?> +<?php $captcha = $this->getCaptchaModel() ?> +<li id="captcha-input-box-<?php echo $this->getFormId()?>"> + <label for="captcha_<?php echo $this->getFormId() ?>" class="required"><em>*</em><?php echo $this->__('Please type the letters below')?></label> + <div class="input-box captcha"> + <input name="<?php echo Mage_Captcha_Helper_Data::INPUT_NAME_FIELD_VALUE ?>[<?php echo $this->getFormId()?>]" type="text" class="input-text required-entry" id="captcha_<?php echo $this->getFormId() ?>" /> + </div> +</li> +<li> + <div class="captcha-image" id="captcha-image-box-<?php echo $this->getFormId()?>"> + <script type="text/javascript"> + //<![CDATA[ + var captcha_<?php echo $this->getFormId()?> = new Captcha('<?php echo $this->getRefreshUrl() ?>', '<?php echo $this->getFormId() ?>'); + //]]> + </script> + <img id="catpcha-reload" class="captcha-reload" src="<?php echo $this->getSkinUrl('Mage_Captcha::reload.png') ?>" alt="<?php echo $this->__('Reload captcha') ?>" onclick="captcha_<?php echo $this->getFormId()?>.refresh(this)"> + <img id="<?php echo $this->getFormId() ?>" class="captcha-img" height="<?php echo $this->getImgHeight() ?>" src="<?php echo $captcha->getImgSrc() ?>"/> + <?php if ($captcha->isCaseSensitive()) :?> + <div class="captcha-note"> + <?php echo $this->__('<strong>Attention</strong>: Captcha is case sensitive.') ?> + </div> + <?php endif; ?> + </div> +</li> diff --git a/app/code/core/Mage/Catalog/Block/Breadcrumbs.php b/app/code/core/Mage/Catalog/Block/Breadcrumbs.php index da650999bc3..0691777e5a9 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 c2483404c1b..a0debf7483c 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 696522d54d5..8427a9b1565 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 58b78d424bb..2708dfe3c12 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) */ 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 83a2d75a84b..fe03b2493db 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 afd22e7e1d7..46207e73de6 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 93b6edb25c4..60e16e8ebb9 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 17d921e2121..bc89dc30bb0 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 ba978e2c071..2fbfa9486c9 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 686c77eaa7d..dd991f8cb6e 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) */ @@ -230,4 +230,14 @@ class Mage_Catalog_Block_Layer_View extends Mage_Core_Block_Template { 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 1cc141ed9ec..0f119130054 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 18d6de8c515..348d004a9fa 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 b5dfbecc114..1177c24dee2 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) */ @@ -344,12 +344,19 @@ abstract class Mage_Catalog_Block_Product_Abstract extends Mage_Core_Block_Templ $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/Compare/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/Compare/Abstract.php index 220cf59e889..2e670812eb0 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 dc0cbe9d101..8b7ef5afd30 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 63bddb8974a..29899bf1866 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 c8bd70b7c3f..75c47245a50 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 422a46a226d..d2b02ce4d54 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 bd7bae35aaf..4eea20cd68e 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) */ 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 c3dfa323633..fb3c95fd87a 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 a5610d7c3dc..ad9caf80990 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 cf161f33f34..cd8b13f1ad0 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) */ 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 e6757d941f9..0cd04af31b4 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 a0a42a93c0f..4f3b7311b51 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) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/New.php b/app/code/core/Mage/Catalog/Block/Product/New.php index 5ae9a8c4d81..6670455b763 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) */ @@ -81,19 +81,26 @@ class Mage_Catalog_Block_Product_New extends Mage_Catalog_Block_Product_Abstract */ 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('Mage_Catalog_Model_Resource_Product_Collection'); $collection->setVisibility(Mage::getSingleton('Mage_Catalog_Model_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 406985816b6..672bb8bfd70 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) */ @@ -72,21 +72,26 @@ class Mage_Catalog_Block_Product_Price extends Mage_Core_Block_Template 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('Mage_Tax_Helper_Data')->getPrice($product, $price['website_price']) 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 8ae93ac6c27..10f03d6d076 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 f193c10dde9..b141a1c2706 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 f0bd3b79375..ff895feb962 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) */ @@ -122,7 +122,7 @@ class Mage_Catalog_Block_Product_View extends Mage_Catalog_Block_Product_Abstrac } $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('Mage_Core_Helper_Data')->urlEncode($addUrlValue); return $this->helper('Mage_Checkout_Helper_Cart')->getAddUrl($product, $additional); @@ -254,4 +254,4 @@ class Mage_Catalog_Block_Product_View extends Mage_Catalog_Block_Product_Abstrac return $qty; } -} +} \ No newline at end of file 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 53ec921ae3b..28529dc2dd5 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 a658e1e1dcd..14beb1bf0e2 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 79acac48b7a..dc80de96fd7 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 27bd2f2f8a5..223f1268ad4 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 93456f5ee3c..f5c5c40072c 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 ea8cf3e9258..9f7c34416b7 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 @@ class Mage_Catalog_Block_Product_View_Options extends Mage_Core_Block_Template 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('Mage_Core_Helper_Data')->currency($option->getPrice(true), false, false); + $data['oldPrice'] = Mage::helper('Mage_Core_Helper_Data')->currency($option->getPrice(false), false, false); + $data['priceValue'] = $option->getPrice(false); + $data['type'] = $option->getPriceType(); + $data['excludeTax'] = $price = Mage::helper('Mage_Tax_Helper_Data')->getPrice($option->getProduct(), $data['price'], false); + $data['includeTax'] = $price = Mage::helper('Mage_Tax_Helper_Data')->getPrice($option->getProduct(), $data['price'], true); + return $data; + } + + /** + * Get json representation of + * + * @return string + */ public function getJsonConfig() { $config = array(); @@ -146,11 +169,12 @@ class Mage_Catalog_Block_Product_View_Options extends Mage_Core_Block_Template $_tmpPriceValues = array(); foreach ($option->getValues() as $value) { /* @var $value Mage_Catalog_Model_Product_Option_Value */ - $_tmpPriceValues[$value->getId()] = Mage::helper('Mage_Core_Helper_Data')->currency($value->getPrice(true), false, false); + $id = $value->getId(); + $_tmpPriceValues[$id] = $this->_getPriceConfiguration($value); } $priceValue = $_tmpPriceValues; } else { - $priceValue = Mage::helper('Mage_Core_Helper_Data')->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 f01852ec6f6..4c014546828 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 @@ abstract class Mage_Catalog_Block_Product_View_Options_Abstract extends Mage_Cor { 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 978d1f5990c..9a80a3a027c 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 8d683d7ef64..f84c026a866 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 3a2c96f9440..e36bb882e53 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 ed037f5a202..efa36049637 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 @@ class Mage_Catalog_Block_Product_View_Options_Type_Select } 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(), @@ -105,12 +105,11 @@ class Mage_Catalog_Block_Product_View_Options_Type_Select $type = 'radio'; $class = 'radio'; if (!$_option->getIsRequire()) { - $selectHtml .= '<li><input type="radio" id="options_' - . $_option->getId() . '" class="' . $class - . ' product-custom-option" name="options[' . $_option->getId() . ']"' + $selectHtml .= '<li><input type="radio" id="options_' . $_option->getId() . '" class="' + . $class . ' product-custom-option" name="options[' . $_option->getId() . ']"' . ($this->getSkipJsReloadPrice() ? '' : ' onclick="opConfig.reloadPrice()"') . ' value="" checked="checked" /><span class="label"><label for="options_' - . $_option->getId().'">' . $this->__('None') . '</label></span></li>'; + . $_option->getId() . '">' . $this->__('None') . '</label></span></li>'; } break; case Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX: @@ -124,8 +123,8 @@ class Mage_Catalog_Block_Product_View_Options_Type_Select $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(); @@ -135,19 +134,19 @@ class Mage_Catalog_Block_Product_View_Options_Type_Select $checked = $configValue == $htmlValue ? 'checked' : ''; } - $selectHtml .= '<li>' . '<input type="' . $type . '" class="' . $class - . ' ' . $require . ' product-custom-option"' + $selectHtml .= '<li>' . '<input type="' . $type . '" class="' . $class . ' ' . $require + . ' product-custom-option"' . ($this->getSkipJsReloadPrice() ? '' : ' onclick="opConfig.reloadPrice()"') - . ' name="options[' . $_option->getId() . ']' . $arraySign . '" id="options_' - . $_option->getId() . '_' . $count . '" value="' . $htmlValue . '" ' . $checked . ' price="' - . $this->helper('Mage_Core_Helper_Data')->currencyByStore($_value->getPrice(true), $store, false) - . '" />' . '<span class="label"><label for="options_' . $_option->getId() . '_' . $count . '">' + . ' name="options[' . $_option->getId() . ']' . $arraySign . '" id="options_' . $_option->getId() + . '_' . $count . '" value="' . $htmlValue . '" ' . $checked . ' price="' + . $this->helper('Mage_Core_Helper_Data')->currencyByStore($_value->getPrice(true), $store, false) . '" />' + . '<span class="label"><label for="options_' . $_option->getId() . '_' . $count . '">' . $_value->getTitle() . ' ' . $priceStr . '</label></span>'; if ($_option->getIsRequire()) { - $selectHtml .= '<script type="text/javascript">' . '$(\'options_' . $_option->getId() - . '_' . $count . '\').advaiceContainer = \'options-' . $_option->getId() . '-container\';' - . '$(\'options_' . $_option->getId() . '_' . $count - . '\').callbackFunction = \'validateOptionsCallback\';' . '</script>'; + $selectHtml .= '<script type="text/javascript">' . '$(\'options_' . $_option->getId() . '_' + . $count . '\').advaiceContainer = \'options-' . $_option->getId() . '-container\';' + . '$(\'options_' . $_option->getId() . '_' . $count + . '\').callbackFunction = \'validateOptionsCallback\';' . '</script>'; } $selectHtml .= '</li>'; } 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 697a12f317a..597d145d433 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 a3359f11c1b..d8bca253b87 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 e2212d40c60..5c6107cd964 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 cf9a07de360..01c98a96573 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() ->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,6 +78,11 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo return false; } + /** + * Get Allowed Products + * + * @return array + */ public function getAllowProducts() { if (!$this->hasAllowProducts()) { @@ -171,11 +197,10 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo '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 +249,6 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo $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 +268,7 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo /** * Validating of super product option value * - * @param array $attribute + * @param array $attributeId * @param array $value * @param array $options * @return boolean @@ -272,26 +296,57 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo 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 +357,6 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo $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 ded54996233..3453334b431 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 e2bf595398a..fb4f9bb2eb7 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 f8f503579c7..65f1c14fa12 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 8adc3b0e82f..2d06f3d75e8 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 bf93aae3aa0..6867d5b3b24 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 fd1c7e7db51..efc7f64167a 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 88c8327f827..24b7c6f9d73 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 ea509fac42c..f1db0a9f108 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 63fa4697d10..28789b5455a 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 e0b4805cb7f..b762f2a13ea 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 9c5121d15fc..e5c94172ba0 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/Controller/Product/View/Interface.php b/app/code/core/Mage/Catalog/Controller/Product/View/Interface.php index 4f2a6e97905..8e9f505193d 100644 --- a/app/code/core/Mage/Catalog/Controller/Product/View/Interface.php +++ b/app/code/core/Mage/Catalog/Controller/Product/View/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/Exception.php b/app/code/core/Mage/Catalog/Exception.php index 7a572a962a4..724265ed906 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 80ef7ac266d..bcbe25149ab 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 b8ed28b5a70..658e212f3ac 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 ec849e2dfdf..1ec0743468e 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) */ diff --git a/app/code/core/Mage/Catalog/Helper/Image.php b/app/code/core/Mage/Catalog/Helper/Image.php index 5aa6e8de7c5..1f92f4cd3aa 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) */ @@ -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 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract 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 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract $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 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract 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 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract 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 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract 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 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract } /** - * Enter description here... + * Get current Image model * * @return Mage_Catalog_Model_Product_Image */ @@ -292,12 +397,23 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract 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 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract */ 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, @@ -478,13 +617,15 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract * * @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; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Catalog/Helper/Map.php b/app/code/core/Mage/Catalog/Helper/Map.php index 3ecff8dab94..e819ffb4861 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 f98e05e6edf..c8f77a811d5 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 index 4ab7c80ae54..378b7691706 100644 --- 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) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/Compare.php b/app/code/core/Mage/Catalog/Helper/Product/Compare.php index 1a289e89655..5da6aff01b0 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 71764ca435e..b435e3ce0b9 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 4352261c416..f5575f1646f 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 e7c26da5f22..59b11e85858 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 f57ea7a23be..53aaa083d4c 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 8a3a77ea788..3b9bb2507bd 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 ebf84900627..0d1f4350866 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 099cad5956a..d5734c71d4a 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 ca1e37eb9f4..274ff167527 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 0b015ec24e6..6d80ae11415 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 8d1deddc64e..66351872826 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) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Api.php b/app/code/core/Mage/Catalog/Model/Category/Api.php index 209b47adac4..4f7236d16a6 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 685fcd6a164..aa76e428596 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 51013ee567d..db9bf721ac0 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 ddd8489b9b3..3328b324e0a 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 1d67a5098cd..b9f07718ea0 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 12f184a16ed..c7473ae2d8e 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 f8075237b99..f883af5e3a4 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 26428f5716b..47d2e1841ca 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 51fb658ec73..36a74271d76 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 210c973559a..d306e18be4a 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 5c14ae71341..5561f00b30b 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 550e8d87ebd..0074a5d9ba0 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 0eba5f4ab0b..1019e09db8f 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 da4f57bc156..80c4885f8f1 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 c1f120ee1af..8f2eebbe6f3 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 0cb4c858d8d..eeb8ceab810 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 083830e6854..1a3ff1f946c 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) */ @@ -556,10 +556,7 @@ class Mage_Catalog_Model_Convert_Adapter_Product } catch (Exception $e) { if (!$e instanceof Mage_Dataflow_Model_Convert_Exception) { $this->addException( - Mage::helper('Mage_Catalog_Helper_Data')->__( - 'An error occurred while saving the collection, aborting. Error message: %s', - $e->getMessage() - ), + Mage::helper('Mage_Catalog_Helper_Data')->__('An error occurred while saving the collection, aborting. Error message: %s', $e->getMessage()), Mage_Dataflow_Model_Convert_Exception::FATAL ); } @@ -586,10 +583,7 @@ class Mage_Catalog_Model_Convert_Adapter_Product if (!is_null($this->getBatchParams('store'))) { $store = $this->getStoreById($this->getBatchParams('store')); } else { - $message = Mage::helper('Mage_Catalog_Helper_Data')->__( - 'Skipping import row, required field "%s" is not defined.', - 'store' - ); + $message = Mage::helper('Mage_Catalog_Helper_Data')->__('Skipping import row, required field "%s" is not defined.', 'store'); Mage::throwException($message); } } else { @@ -597,10 +591,7 @@ class Mage_Catalog_Model_Convert_Adapter_Product } if ($store === false) { - $message = Mage::helper('Mage_Catalog_Helper_Data')->__( - 'Skipping import row, store "%s" field does not exist.', - $importData['store'] - ); + $message = Mage::helper('Mage_Catalog_Helper_Data')->__('Skipping import row, store "%s" field does not exist.', $importData['store']); Mage::throwException($message); } @@ -622,11 +613,7 @@ class Mage_Catalog_Model_Convert_Adapter_Product */ if (empty($importData['type']) || !isset($productTypes[strtolower($importData['type'])])) { $value = isset($importData['type']) ? $importData['type'] : ''; - $message = Mage::helper('Mage_Catalog_Helper_Data')->__( - 'Skip import row, is not valid value "%s" for field "%s"', - $value, - 'type' - ); + $message = Mage::helper('Mage_Catalog_Helper_Data')->__('Skip import row, is not valid value "%s" for field "%s"', $value, 'type'); Mage::throwException($message); } $product->setTypeId($productTypes[strtolower($importData['type'])]); @@ -635,11 +622,7 @@ class Mage_Catalog_Model_Convert_Adapter_Product */ if (empty($importData['attribute_set']) || !isset($productAttributeSets[$importData['attribute_set']])) { $value = isset($importData['attribute_set']) ? $importData['attribute_set'] : ''; - $message = Mage::helper('Mage_Catalog_Helper_Data')->__( - 'Skip import row, the value "%s" is invalid for field "%s"', - $value, - 'attribute_set' - ); + $message = Mage::helper('Mage_Catalog_Helper_Data')->__('Skip import row, the value "%s" is invalid for field "%s"', $value, 'attribute_set'); Mage::throwException($message); } $product->setAttributeSetId($productAttributeSets[$importData['attribute_set']]); @@ -647,10 +630,7 @@ class Mage_Catalog_Model_Convert_Adapter_Product foreach ($this->_requiredFields as $field) { $attribute = $this->getAttribute($field); if (!isset($importData[$field]) && $attribute && $attribute->getIsRequired()) { - $message = Mage::helper('Mage_Catalog_Helper_Data')->__( - 'Skipping import row, required field "%s" for new products is not defined.', - $field - ); + $message = Mage::helper('Mage_Catalog_Helper_Data')->__('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/Convert/Parser/Product.php b/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php index 0ca79d1abbd..66b69b8f51c 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 bd48204076d..723a83d42e1 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 5947b4f0004..2e892c7585e 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 58028a83837..d7ab088c0cd 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/Index.php b/app/code/core/Mage/Catalog/Model/Index.php index 00bf3666a96..f064673283b 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 36406301ebd..fc0a8632cba 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) */ diff --git a/app/code/core/Mage/Catalog/Model/Layer.php b/app/code/core/Mage/Catalog/Model/Layer.php index 1e1ae32fedd..fae12386447 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) */ 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 79e6739b6fb..952779a3dc2 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 @@ abstract class Mage_Catalog_Model_Layer_Filter_Abstract extends Varien_Object { 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 199cf14b76d..4c92b0a8a85 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) */ @@ -69,7 +69,7 @@ class Mage_Catalog_Model_Layer_Filter_Attribute extends Mage_Catalog_Model_Layer * 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 @@ class Mage_Catalog_Model_Layer_Filter_Attribute extends Mage_Catalog_Model_Layer 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/Category.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Category.php index 5f50435fa59..4f031ee71dd 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 8cad0330dcc..289733df0ca 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 5186d283dbc..f5c7fca79d0 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 @@ class Mage_Catalog_Model_Layer_Filter_Item extends Varien_Object 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 d09fac9945b..14f119f7ccd 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) */ @@ -40,6 +40,9 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil { 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'; const RANGE_CALCULATION_MANUAL = 'manual'; @@ -107,10 +110,6 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil } } - while (ceil($maxPrice / $range) > 25) { - $range *= 10; - } - $this->setData('price_range', $range); } @@ -146,6 +145,19 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil $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); } @@ -182,34 +194,57 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil $formattedFromPrice = $store->formatPrice($fromPrice); if (empty($toPrice)) { return Mage::helper('Mage_Catalog_Helper_Data')->__('%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('Mage_Catalog_Helper_Data')->__('%s - %s', $formattedFromPrice, $store->formatPrice($toPrice - .01)); + if ($fromPrice != $toPrice) { + $toPrice -= .01; + } + return Mage::helper('Mage_Catalog_Helper_Data')->__('%s - %s', $formattedFromPrice, $store->formatPrice($toPrice)); } } /** - * 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('Mage_Catalog_Model_Layer_Filter_Price_Algorithm'); + $appliedInterval = $this->getInterval(); + if ($appliedInterval) { + $algorithmModel->setLimits($appliedInterval[0], $appliedInterval[1]); + } $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'], + 'value' => (($separator['from'] == 0) ? '' : $separator['from']) + . '-' . $separator['to'] . $this->_getAdditionalRequestData(), 'count' => $separator['count'], ); } @@ -226,6 +261,8 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil { if (Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_CALCULATION) == self::RANGE_CALCULATION_AUTO) { return $this->_getCalculatedItemsData(); + } elseif ($this->getInterval()) { + return array(); } $range = $this->getPriceRange(); @@ -262,6 +299,27 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil 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 !== '' && (float)$v <= 0) { + return false; + } + } + + return $filter; + } + /** * Apply price range filter * @@ -281,20 +339,31 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil } //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), @@ -370,4 +439,56 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil { 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); + } + + /** + * 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_AUTO) { + return Mage::helper('Mage_Catalog_Helper_Data')->__('Clear Price'); + } + + return parent::getClearLinkText(); + } } 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 57c79a0187b..8d2a8afe8cc 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) */ @@ -35,6 +35,7 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm { const MIN_POSSIBLE_PRICE = .01; const TEN_POWER_ROUNDING_FACTOR = 4; + const INTERVAL_DEFLECTION_LIMIT = .3; /** * Sorted array of all products prices @@ -58,39 +59,134 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm protected $_skippedQuantilesUpperLimits = array(); /** - * Set products prices + * Upper prices limit + * + * @var null|float + */ + protected $_upperLimit = null; + + /** + * Lower prices limit + * + * @var null|float + */ + protected $_lowerLimit = null; + + /** + * Search index of price, that satisfy conditions to be less or greater-or-equal than $value + * Returns -1 if index was not found + * + * @param float $value + * @param null|array $limits search [from, to] + * @param bool $isLess (to be less or greater-or-equal) + * @return int + */ + protected function _binarySearch($value, $limits = null, $isLess = true) + { + 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] + || ($isLess && $this->_prices[$limits[1]] < $value) + || (!$isLess && $this->_prices[$limits[0]] >= $value) + ) { + return -1; + } + + if ($limits[1] - $limits[0] <= 1) { + if ($isLess) { + return ($this->_prices[$limits[0]] < $value) ? $limits[1] : $limits[0]; + } else { + return ($this->_prices[$limits[1]] >= $value) ? $limits[0] : $limits[1]; + } + } + + $separator = floor(($limits[0] + $limits[1]) / 2); + if ($isLess) { + if ($this->_prices[$separator] < $value) { + $limits[0] = $separator + 1; + } else { + $limits[1] = $separator; + } + } else { + if ($this->_prices[$separator] >= $value) { + $limits[1] = $separator - 1; + } else { + $limits[0] = $separator; + } + } + + return $this->_binarySearch($value, array($limits[0], $limits[1]), $isLess); + } + + /** + * Check prices to be in limits interval * - * @param array $prices * @return Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ - public function setPrices(array $prices) + protected function _checkPrices() { - $this->_prices = $prices; - sort($this->_prices); - $this->_intervalsNumber = null; - $this->_skippedQuantilesUpperLimits = array(); + if (is_null($this->_prices)) { + return $this; + } + if (!is_null($this->_upperLimit) || !is_null($this->_lowerLimit)) { + $right = is_null($this->_upperLimit) + ? (count($this->_prices) - 1) + : $this->_binarySearch($this->_upperLimit, null, false); + $left = is_null($this->_lowerLimit) + ? 0 + : $this->_binarySearch($this->_lowerLimit, array(0, $right)); + if ($left > $right) { + $this->_prices = array(); + } else { + $this->_prices = array_slice($this->_prices, $left, $right - $left + 1); + } + } return $this; } /** - * Get min price + * Set lower and upper limit for algorithm * - * @return float + * @param null|float $lowerLimit + * @param null|float $upperLimit + * @return Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ - public function getMinPrice() + public function setLimits($lowerLimit = null, $upperLimit = null) { - return empty($this->_prices) ? 0 : $this->_prices[0]; + $this->_lowerLimit = empty($lowerLimit) ? null : (float)$lowerLimit; + $this->_upperLimit = empty($upperLimit) ? null : (float)$upperLimit; + $this->_checkPrices(); + return $this; } /** - * Get max price + * Set products prices * - * @return float + * @param array $prices due to performance issue prices should be sorted (by DBMS engine) + * @return Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ - public function getMaxPrice() + public function setPrices(array $prices) { - return (empty($this->_prices)) ? 0 : $this->_prices[count($this->_prices) - 1]; + $this->_prices = $prices; + + $this->_checkPrices(); + $this->_intervalsNumber = null; + $this->_skippedQuantilesUpperLimits = array(); + + return $this; } /** @@ -105,7 +201,8 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm } $pricesCount = count($this->_prices); - if ($pricesCount < 2 || ($this->getMaxPrice() - $this->getMinPrice() == 0)) { + $priceRange = empty($this->_prices) ? 0 : ($this->_prices[count($this->_prices) - 1] - $this->_prices[0]); + if ($pricesCount < 2 || ($priceRange == 0)) { //Same price couldn't be separated with several intervals $this->_intervalsNumber = 1; return $this->_intervalsNumber; @@ -118,10 +215,10 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm $sumSquares += $price * $price; } - if ($pricesCount * $sumSquares - $sum * $sum == 0) { + if ($pricesCount * $sumSquares - $sum * $sum <= 0) { $intervalsNumber = 1000; } else { - $intervalsNumber = ($this->getMaxPrice() - $this->getMinPrice()) * pow($pricesCount, 5 / 6) + $intervalsNumber = $priceRange * pow($pricesCount, 5 / 6) * sqrt(($pricesCount - 1) / ($pricesCount * $sumSquares - $sum * $sum)) / 3.5; } $this->_intervalsNumber = min(max(ceil($intervalsNumber), 2), 10); @@ -129,6 +226,16 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm return $this->_intervalsNumber; } + /** + * Get intervals number with checking skipped quantiles + * + * @return int + */ + protected function _getCalculatedIntervalsNumber() + { + return max(1, $this->getIntervalsNumber() - count($this->_skippedQuantilesUpperLimits)); + } + /** * Get quantile * @@ -210,19 +317,16 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm // 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); + + $result = array(); + 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) { @@ -235,13 +339,34 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm $lowerPrice, $upperPrice, $returnEmpty, $roundingFactorCoefficient ); if ($roundPrices) { - return array($roundingFactorCoefficient, $roundPrices); + $result[round($roundingFactorCoefficient / self::MIN_POSSIBLE_PRICE)] = $roundPrices; } } $tenPower /= 10; } - return array(self::MIN_POSSIBLE_PRICE, array()); + return empty($result) ? array(1 => array()) : $result; + } + + /** + * 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; + } + } } /** @@ -255,76 +380,44 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm 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, + $index = $this->_binarySearch( + $this->_prices[$quantileInterval[1]], + array(0, $quantileInterval[0]), + false + ); + if ($index != -1) { + $bestRoundPrice = $this->_findRoundPrice( + $this->_prices[$index] + 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( + $index = $this->_binarySearch( + $this->_prices[$quantileInterval[0]] + self::MIN_POSSIBLE_PRICE / 10, + array($quantileInterval[1]) + ); + if ($index != -1) { + $upperBestRoundPrice = $this->_findRoundPrice( $this->_prices[$quantileInterval[0]] + self::MIN_POSSIBLE_PRICE / 10, - $this->_prices[$i], + $this->_prices[$index], false ); - if (!empty($bestRoundPrice)) { - if ($upperRoundingFactor >= $roundingFactor) { - if ($upperRoundingFactor > $roundingFactor) { - $bestRoundPrice = $upperBestRoundPrice; - } else { - $bestRoundPrice = array_merge($bestRoundPrice, $upperBestRoundPrice); - } - } - } else { - $bestRoundPrice = $upperBestRoundPrice; - } + $this->_mergeRoundPrices($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; - } + $bestRoundPrice = $this->_findRoundPrice( + $this->_prices[$quantileInterval[0]] + self::MIN_POSSIBLE_PRICE / 10, + $this->_prices[$quantileInterval[1]] + ); } if (empty($bestRoundPrice)) { @@ -332,8 +425,46 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm return $bestRoundPrice; } - sort($bestRoundPrice); - return $bestRoundPrice; + ksort($bestRoundPrice, SORT_NUMERIC); + foreach ($bestRoundPrice as $index => &$bestRoundPriceValues) { + if (empty($bestRoundPriceValues)) { + unset($bestRoundPrice[$index]); + } else { + sort($bestRoundPriceValues); + } + } + return array_reverse($bestRoundPrice); + } + + /** + * Get separator nearest to quantile among the separators + * + * @param int $quantileNumber + * @param array $separators + * @param int $priceIndex + * @return bool|array [separatorPrice, pricesCount] + */ + protected function _findBestSeparator($quantileNumber, $separators, $priceIndex) + { + $result = false; + + $i = $priceIndex; + $pricesCount = count($this->_prices); + while ($i < $pricesCount && !empty($separators)) { + $i = $this->_binarySearch($separators[0], array($i)); + if ($i == -1) { + break; + } + + $separator = array_shift($separators); + + $deflection = abs(($quantileNumber + 1) * $pricesCount - $i * $this->_getCalculatedIntervalsNumber()); + if (!$result || $deflection < $result[0]) { + $result = array($deflection, $separator, $i - $priceIndex); + } + } + + return $result ? $result : false; } /** @@ -343,6 +474,7 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ public function calculateSeparators() { + $this->_checkPrices(); $separators = array(); for ($i = 1; $i < $this->getIntervalsNumber(); ++$i) { $separators[] = $this->_findPriceSeparator($i); @@ -351,8 +483,9 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm $i = 0; $result = array(); - $lastSeparator = 0; + $lastSeparator = is_null($this->_lowerLimit) ? 0 : $this->_lowerLimit; $quantile = 0; + $pricesPerInterval = $pricesCount / $this->_getCalculatedIntervalsNumber(); while (!empty($separators) && ($i < $pricesCount)) { while (!empty($separators) && empty($separators[0])) { array_shift($separators); @@ -360,59 +493,49 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm 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']; + $separatorCandidate = false; + $newLastSeparator = $lastSeparator; + while (!empty($separators[0]) && !array_key_exists($quantile, $result)) { + $separatorsPortion = array_shift($separators[0]); + $bestSeparator = $this->_findBestSeparator($quantile, $separatorsPortion, $i); + if ($bestSeparator && $bestSeparator[2] > 0) { + $isEqualPrice = ($this->_prices[$i] == $this->_prices[$i + $bestSeparator[2] - 1]) + ? $this->_prices[$i] + : false; + $separatorData = array( + 'from' => ($isEqualPrice !== false) ? $isEqualPrice : $lastSeparator, + 'to' => ($isEqualPrice !== false) ? $isEqualPrice : $bestSeparator[1], + 'count' => $bestSeparator[2], + ); + if (abs(1 - $bestSeparator[2] / $pricesPerInterval) <= self::INTERVAL_DEFLECTION_LIMIT) { + $newLastSeparator = $bestSeparator[1]; + $result[$quantile] = $separatorData; + } elseif (!$separatorCandidate || $bestSeparator[0] < $separatorCandidate[0]) { + $separatorCandidate = array($bestSeparator[0], $separatorData, $bestSeparator[1]); } - ++$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]); + if (!array_key_exists($quantile, $result) && $separatorCandidate) { + $newLastSeparator = $separatorCandidate[2]; + $result[$quantile] = $separatorCandidate[1]; } + + if (array_key_exists($quantile, $result)) { + $lastSeparator = $newLastSeparator; + $i = $this->_binarySearch($lastSeparator, array($i)); + array_shift($separators); + } + ++$quantile; + } + if ($i < $pricesCount) { + $isEqualPrice = ($this->_prices[$i] == $this->_prices[$pricesCount - 1]) ? $this->_prices[$i] : false; + $result[$quantile] = array( + 'from' => $isEqualPrice ? $isEqualPrice : $lastSeparator, + 'to' => $isEqualPrice ? $isEqualPrice : (is_null($this->_upperLimit) ? '' : $this->_upperLimit), + 'count' => $pricesCount - $i, + ); } 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 90b71dfdae5..2f2a0630ae9 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 53dd9ff1c0e..f0522220368 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) */ diff --git a/app/code/core/Mage/Catalog/Model/Product.php b/app/code/core/Mage/Catalog/Model/Product.php index 793a99d1ff3..0e533dfd228 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) */ @@ -601,6 +601,16 @@ class Mage_Catalog_Model_Product extends Mage_Catalog_Model_Abstract return Mage::getSingleton('Mage_Catalog_Model_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 * @@ -1025,6 +1035,7 @@ class Mage_Catalog_Model_Product extends Mage_Catalog_Model_Abstract $this->getWebsiteIds(); $this->getCategoryIds(); + /* @var $newProduct Mage_Catalog_Model_Product */ $newProduct = Mage::getModel('Mage_Catalog_Model_Product')->setData($this->getData()) ->setIsDuplicate(true) ->setOriginalId($this->getId()) @@ -1040,16 +1051,6 @@ class Mage_Catalog_Model_Product extends Mage_Catalog_Model_Abstract 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(); @@ -1800,6 +1801,7 @@ class Mage_Catalog_Model_Product extends Mage_Catalog_Model_Abstract */ public function reset() { + $this->unlockAttributes(); $this->_clearData(); return $this; } diff --git a/app/code/core/Mage/Catalog/Model/Product/Action.php b/app/code/core/Mage/Catalog/Model/Product/Action.php index 3cbd1b198df..49e38dcf609 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 560c4cbbfb3..e42af757c16 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 @@ class Mage_Catalog_Model_Product_Api extends Mage_Catalog_Model_Api_Resource ->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 @@ class Mage_Catalog_Model_Product_Api extends Mage_Catalog_Model_Api_Resource } foreach ($product->getTypeInstance()->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 @@ class Mage_Catalog_Model_Product_Api extends Mage_Catalog_Model_Api_Resource 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'])) { @@ -441,4 +452,4 @@ class Mage_Catalog_Model_Product_Api extends Mage_Catalog_Model_Api_Resource $this->_fault('product_attribute_set_not_valid'); } } -} // Class Mage_Catalog_Model_Product_Api End +} // Class Mage_Catalog_Model_Product_Api End \ No newline at end of file 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 d4dd81d0387..92f1bbf57ef 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 @@ class Mage_Catalog_Model_Product_Api_V2 extends Mage_Catalog_Model_Product_Api ->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 @@ class Mage_Catalog_Model_Product_Api_V2 extends Mage_Catalog_Model_Product_Api foreach ($product->getTypeInstance()->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 @@ class Mage_Catalog_Model_Product_Api_V2 extends Mage_Catalog_Model_Product_Api 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('Mage_Catalog_Model_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 282afd419df..645e85549bf 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 2702ee9c02e..b5f3ffa7c60 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 97657baac24..dbd87d3ef91 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 new file mode 100644 index 00000000000..2e905bd9fdc --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.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_Catalog + * @copyright 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 product group price backend attribute model + * + * @category Mage + * @package Mage_Catalog + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice'); + } + + /** + * Error message when duplicates + * + * @return string + */ + protected function _getDuplicateErrorMessage() + { + return Mage::helper('Mage_Catalog_Helper_Data')->__('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 00000000000..13a7f95eda1 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php @@ -0,0 +1,369 @@ +<?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_Catalog + * @copyright 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 product abstract group price backend attribute model + * + * @category Mage + * @package Mage_Catalog + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Directory_Model_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('Mage_Catalog_Model_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/Media.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php index 62f794efc4c..b317be56439 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 @@ class Mage_Catalog_Model_Product_Attribute_Backend_Media extends Mage_Eav_Model_ } } + Mage::dispatchEvent('catalog_product_media_save_before', array('product' => $object, 'images' => $value)); + $object->setData($attrCode, $value); return $this; @@ -268,6 +270,9 @@ class Mage_Catalog_Model_Product_Attribute_Backend_Media extends Mage_Eav_Model_ if (!$file || !file_exists($file)) { Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__('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 5f8c81e8f40..e59929419d9 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 51717e2a0eb..16538c868e1 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 d93615a5496..eb4fd4a8d64 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 69c5ccc83ac..ce16f66300d 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 95994762aa6..a3634a2ee98 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 d6a4dcf844d..3e2f1743fee 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) */ @@ -32,15 +32,9 @@ * @package Mage_Catalog * @author Magento Core Team <core@magentocommerce.com> */ -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 @@ class Mage_Catalog_Model_Product_Attribute_Backend_Tierprice extends Mage_Catalo /** * 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('Mage_Directory_Model_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('Mage_Catalog_Helper_Data')->__('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('Mage_Catalog_Helper_Data')->__('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('Mage_Catalog_Model_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('Mage_Catalog_Helper_Data')->__('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/Backend/Urlkey.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Urlkey.php index 77f104864f4..9aec762c739 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 d000d4b84dd..4c23bbeb26a 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 61a090f4f8b..729254cbe7d 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Group.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Group.php @@ -21,7 +21,7 @@ * @category Mage * @package Mage_Catalog * @author Magento Core Team <core@magentocommerce.com> - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.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 6a5ee18d2cd..32b036caab8 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 e0f2ba5e8cb..c150248937c 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 9c8b6358cf5..3682034b372 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 517251b6e5c..34b7fce6559 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 2fc8399ec54..b757fbf92d4 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 52881a9a14b..1c4f246ca1d 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 76f452e8355..71f4c849be8 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_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/Catalog/Model/Product/Attribute/Source/Layout.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Layout.php index 319faac5615..e5b54ff7728 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 97c5cf2f72a..23a6496f333 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 136e8d7d887..78fa19ccfc4 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 ee91f6ead60..eebd5f55bfc 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 e5587b26b74..9c98fb945d6 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 9a705373133..e04b3716918 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 e1ed15e1b61..d2543b612f9 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 f0a69057e94..1b4cec5a3c7 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 e814f712217..463d4b0a33a 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 df5a4ef6d03..f6d61046155 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 0b4aebfaa49..9aa55caeb31 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 acb9492bdef..65d83bc7a7c 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 146cf4e9b3b..8e542c2d7c2 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 9eaf1058f48..d12d4a45fab 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 e5fad36d501..690941b2223 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) */ @@ -296,4 +296,14 @@ class Mage_Catalog_Model_Product_Flat_Indexer extends Mage_Core_Model_Abstract $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/Flat/Observer.php b/app/code/core/Mage/Catalog/Model/Product/Flat/Observer.php index 5c8e3026ccc..2f8fa8d5bed 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 1674ff74f46..7dcab3a6d58 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 4ede822b5cd..6f1915a6b97 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 76b4b675c73..0171de4a0a2 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 @@ -103,7 +103,7 @@ class Mage_Catalog_Model_Product_Indexer_Flat extends Mage_Index_Model_Indexer_A return false; } - $data = $event->getNewData(); + $data = $event->getNewData(); if (isset($data[self::EVENT_MATCH_RESULT_KEY])) { return $data[self::EVENT_MATCH_RESULT_KEY]; } @@ -205,7 +205,7 @@ class Mage_Catalog_Model_Product_Indexer_Flat extends Mage_Index_Model_Indexer_A * 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) { @@ -237,7 +237,12 @@ class Mage_Catalog_Model_Product_Indexer_Flat extends Mage_Index_Model_Indexer_A $reindexData['catalog_product_flat_action_type'] = $actionObject->getActionType(); } - if (isset($attrData['price']) || isset($attrData['name'])) { + $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; } @@ -330,4 +335,14 @@ class Mage_Catalog_Model_Product_Indexer_Flat extends Mage_Index_Model_Indexer_A { $this->_getIndexer()->reindexAll(); } + + /** + * Retrieve list of attribute codes, that are used in flat + * + * @return array + */ + protected function _getFlatAttributes() + { + return Mage::getModel('Mage_Catalog_Model_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 483eba1bcb1..f700beb49f5 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 68958123f57..553a0610c9e 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 fde0633f707..d81d7f6053c 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 de6a3c967fd..279a0a7eab5 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 0f1f7e43dde..76022f467b0 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 b98bdd5a578..73d01256911 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) */ 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 22967e06ed7..5077e60cc6f 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 f77f544f826..4380c13c998 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 64885d4e37d..1bd2a3b6a34 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 4c046bed474..9669ed349a0 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 a70d42a3e20..79ea5e5f970 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 cd760d82490..bb07dc8ac17 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) */ @@ -415,19 +415,15 @@ class Mage_Catalog_Model_Product_Option_Type_File extends Mage_Catalog_Model_Pro $result = array(); foreach ($errors as $errorCode) { if ($errorCode == Zend_Validate_File_ExcludeExtension::FALSE_EXTENSION) { - $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("The file '%s' for '%s' has an invalid extension", - $fileInfo['title'], $option->getTitle()); + $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("The file '%s' for '%s' has an invalid extension", $fileInfo['title'], $option->getTitle()); } elseif ($errorCode == Zend_Validate_File_Extension::FALSE_EXTENSION) { - $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("The file '%s' for '%s' has an invalid extension", - $fileInfo['title'], $option->getTitle()); + $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("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('Mage_Catalog_Helper_Data')->__("Maximum allowed image size for '%s' is %sx%s px.", - $option->getTitle(), $option->getImageSizeX(), $option->getImageSizeY()); + $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("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('Mage_Catalog_Helper_Data')->__("The file '%s' you uploaded is larger than %s Megabytes allowed by server", - $fileInfo['title'], $this->_bytesToMbytes($this->_getUploadMaxFilesize())); + $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("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 @@ class Mage_Catalog_Model_Product_Option_Type_File extends Mage_Catalog_Model_Pro { $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('Mage_Catalog_Helper_Data')->__('px.'); } else { $sizes = ''; 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 6629f42eb6c..68e09f0cee4 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 bed8add1747..001ba1c7234 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 ada97f40eb7..b06b79ec3f0 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 122153f7ab3..1b26ff27d97 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 763f7eacdef..1bef883999c 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 bab3e4db0e3..a2a2e02cf06 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 32708ed5929..2e337bce21e 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 6ceaeeac128..c91dfe0ed6b 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) */ 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 7b15e4be375..1fadfd95e73 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 95f2e733600..28d7ac63e02 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 52153b04b96..f2012a3745f 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) */ @@ -389,18 +389,20 @@ class Mage_Catalog_Model_Product_Type_Configurable extends Mage_Catalog_Model_Pr if ($product->getCanSaveConfigurableAttributes()) { $product->canAffectOptions(true); - if ($data = $product->getConfigurableAttributesData()) { - if (!empty($data)) { - foreach ($data as $attribute) { - if (!empty($attribute['values'])) { - $product->setTypeHasOptions(true); - $product->setTypeHasRequiredOptions(true); - break; - } + $data = $product->getConfigurableAttributesData(); + if (!empty($data)) { + foreach ($data as $attribute) { + if (!empty($attribute['values'])) { + $product->setTypeHasOptions(true); + $product->setTypeHasRequiredOptions(true); + break; } } } } + foreach ($this->getConfigurableAttributes($product) as $attribute) { + $product->setData($attribute->getProductAttribute()->getAttributeCode(), null); + } return $this; } 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 780d703de0a..b1d3c405208 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 a13b9ccd2f2..04df156bb2a 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 @@ class Mage_Catalog_Model_Product_Type_Configurable_Price extends Mage_Catalog_Mo 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() - ->setStoreFilter($product->getStore(), $product); + ->setStoreFilter($product->getStore(), $product); $attributes = $product->getTypeInstance() - ->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 @@ class Mage_Catalog_Model_Product_Type_Configurable_Price extends Mage_Catalog_Mo 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 26cc0b64858..370d4d76a79 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 710d83b102c..3420f086683 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 ae67fa56c92..9fa5946ee79 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) */ @@ -48,24 +48,39 @@ class Mage_Catalog_Model_Product_Type_Price } /** - * Get product final price + * Get base price with apply Group, Tier, Special prises * - * @param double $qty - * @param Mage_Catalog_Model_Product $product - * @return double + * @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 + * + * @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->_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)); + Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product, 'qty' => $qty)); $finalPrice = $product->getData('final_price'); $finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice); @@ -80,13 +95,65 @@ class Mage_Catalog_Model_Product_Type_Price 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 * * @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) { @@ -104,9 +171,9 @@ class Mage_Catalog_Model_Product_Type_Price /** * 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) { @@ -197,8 +264,8 @@ class Mage_Catalog_Model_Product_Type_Price * 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) { @@ -220,11 +287,11 @@ class Mage_Catalog_Model_Product_Type_Price } /** - * 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) { @@ -244,10 +311,10 @@ class Mage_Catalog_Model_Product_Type_Price } /** - * 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) { @@ -259,8 +326,8 @@ class Mage_Catalog_Model_Product_Type_Price * * @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) { @@ -268,12 +335,11 @@ class Mage_Catalog_Model_Product_Type_Price $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); } } @@ -355,6 +421,16 @@ class Mage_Catalog_Model_Product_Type_Price * @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/Product/Type/Simple.php b/app/code/core/Mage/Catalog/Model/Product/Type/Simple.php index f527948789d..9e8ca639b6b 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 54d63646f57..1f0d0a4fde3 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 df57627c62b..5415617cfc7 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 736d69a1dd6..02f8e04a92d 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 8007f503446..387ea78f93f 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 e31f9deca64..25333e81ffb 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) */ @@ -202,7 +202,7 @@ abstract class Mage_Catalog_Model_Resource_Abstract extends Mage_Eav_Model_Entit 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/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Attribute.php index b3903a3e285..b4740bee3a6 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 28956b5f4c9..5648a447a4d 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 040c1e122bb..5dcbc06e206 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 890af7ec37c..44787591df8 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 4d835a53947..e5ea45593ae 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 84816549755..4734621a970 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 0beea60c437..be435f41a29 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 68274fdb1ed..259bf8e1db9 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 44fb77318b1..1de0b3f75e3 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) */ 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 461c3c563d2..6a25ee9e3ad 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 830a4acfb52..324551213c5 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 974c52722ae..970f31d9425 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 b891597e077..7ab9f009781 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 b60fa96ee6a..194e16e7a0a 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 690c74b61bc..25f7667a57f 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) */ 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 76d1ea88fea..69723d77b98 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 a88e042f598..2caa16643fd 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 684b2fda4a7..1ca16bad8d4 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 @@ class Mage_Catalog_Model_Resource_Layer_Filter_Decimal extends Mage_Core_Model_R $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 @@ class Mage_Catalog_Model_Resource_Layer_Filter_Decimal extends Mage_Core_Model_R $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 9e8d89826af..a8d04b9fde6 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) */ @@ -159,7 +159,7 @@ class Mage_Catalog_Model_Resource_Layer_Filter_Price extends Mage_Core_Model_Res 'range' => $rangeExpr, 'count' => $countExpr )); - $select->group($rangeExpr); + $select->group($rangeExpr)->order("$rangeExpr ASC"); return $connection->fetchPairs($select); } @@ -181,7 +181,7 @@ class Mage_Catalog_Model_Resource_Layer_Filter_Price extends Mage_Core_Model_Res $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); } @@ -221,13 +221,17 @@ class Mage_Catalog_Model_Resource_Layer_Filter_Price extends Mage_Core_Model_Res $additional = join('', $response->getAdditionalCalculations()); $maxPriceExpr = new Zend_Db_Expr( - "({$table}.min_price {$additional}) * ". $connection->quote($filter->getCurrencyRate()) + "ROUND(({$table}.min_price {$additional}) * " . $connection->quote($filter->getCurrencyRate()) . ", 2)" ); - $select->columns(array($maxPriceExpr)); + $select->columns(array($maxPriceExpr))->order("$maxPriceExpr ASC"); $prices = $connection->fetchCol($select); - $algorithm->setPrices($prices); + if ($filter->getInterval() && count($prices) <= $filter->getIntervalDivisionLimit()) { + $algorithm->setPrices(array()); + } else { + $algorithm->setPrices($prices); + } return $prices; } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Product.php index 112c5d87b6c..6d9dc25cb69 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) */ @@ -630,7 +630,7 @@ class Mage_Catalog_Model_Resource_Product extends Mage_Catalog_Model_Resource_Ab /** * Retrieve product entities info * - * @param null $columns + * @param array|string|null $columns * @return array */ public function getProductEntitiesInfo($columns = null) @@ -641,9 +641,12 @@ class Mage_Catalog_Model_Resource_Product extends Mage_Catalog_Model_Resource_Ab if (empty($columns) || !is_array($columns)) { $columns = $this->_getDefaultAttributes(); } - $select = $this->_getReadAdapter()->select() + + $adapter = $this->_getReadAdapter(); + $select = $adapter->select() ->from($this->getTable('catalog_product_entity'), $columns); - return $this->_getReadAdapter()->fetchAll($select); + + return $adapter->fetchAll($select); } /** @@ -681,4 +684,4 @@ class Mage_Catalog_Model_Resource_Product extends Mage_Catalog_Model_Resource_Ab $images = $read->fetchAll($select); return $images; } -} +} \ No newline at end of file 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 9d9d6ce56dd..90401af50e9 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 new file mode 100755 index 00000000000..1a29638502a --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php @@ -0,0 +1,46 @@ +<?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_Catalog + * @copyright 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 product group price backend attribute model + * + * @category Mage + * @package Mage_Catalog + * @author Magento Core Team <core@magentocommerce.com> + */ +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_entity_group_price', 'value_id'); + } +} \ No newline at end of file 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 00000000000..e3786d0e1a3 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/Abstract.php @@ -0,0 +1,147 @@ +<?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_Catalog + * @copyright 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 product abstract price backend attribute model with customer group specific + * + * @category Mage + * @package Mage_Catalog + * @author Magento Core Team <core@magentocommerce.com> + */ +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/Image.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php index 6ea707808c9..9ab82537d03 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 b24c8321022..51a256abfed 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 b5d9c69fe5d..f1c316838b6 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) */ @@ -32,7 +32,8 @@ * @package Mage_Catalog * @author Magento Core Team <core@magentocommerce.com> */ -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,88 +45,27 @@ class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice extends Ma } /** - * Load Tier Prices for product + * Add qty column * - * @param int $productId - * @param int $websiteId - * @return Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice + * @param array $columns + * @return array */ - public function loadPriceData($productId, $websiteId = null) + protected function _loadPriceDataColumns($columns) { - $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 - */ - 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); + $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/Backend/Urlkey.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php index 9a238ead17d..1e17780ca2a 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 c7cf5fdf8d2..d00f2b62b97 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 @@ class Mage_Catalog_Model_Resource_Product_Attribute_Collection } /** - * 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) @@ -173,11 +174,13 @@ class Mage_Catalog_Model_Resource_Product_Attribute_Collection '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', + 'additional_table.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 d1367a705c4..b0492af8dd7 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) */ @@ -1458,6 +1458,17 @@ class Mage_Catalog_Model_Resource_Product_Collection extends Mage_Catalog_Model_ * @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'])) { @@ -1480,11 +1491,12 @@ class Mage_Catalog_Model_Resource_Product_Collection extends Mage_Catalog_Model_ $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)); 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 b545d410c1b..6ecf33ad949 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 38f1b555b4c..5285c85d956 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 141a87dfb1e..77b096d86cb 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 ebece7e0583..8fb31af465a 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 @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -17,1322 +17,1314 @@ * 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_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * + * @category Mage + * @package Mage_Catalog + * @copyright 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 Product Flat Indexer Resource Model - * - * @category Mage - * @package Mage_Catalog - * @author Magento Core Team <core@magentocommerce.com> - */ -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'; - - /** - * Attribute codes for flat - * - * @var array - */ - protected $_attributeCodes; - - /** - * Attribute objects for flat cache - * - * @var array - */ - protected $_attributes; - - /** - * Required system attributes for preload - * - * @var array - */ - protected $_systemAttributes = array('status', 'required_options', 'tax_class_id', 'weight'); - - /** - * Eav Catalog_Product Entity Type Id - * - * @var int - */ - protected $_entityTypeId; - - /** - * Flat table columns cache - * - * @var array - */ - protected $_columns; - - /** - * Flat table indexes cache - * - * @var array - */ - protected $_indexes; - - /** - * Product Type Instances cache - * - * @var array - */ - protected $_productTypes; - - /** - * Exists flat tables cache - * - * @var array - */ - protected $_existsFlatTables = array(); - - /** - * Flat tables which were prepared - * - * @var array - */ - protected $_preparedFlatTables = array(); - - /** - * Initialize connection - * - */ - protected function _construct() - { - $this->_init('catalog_product_entity', 'entity_id'); - } - - /** - * Rebuild Catalog Product Flat Data - * - * @param Mage_Core_Model_Store|int $store - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function rebuild($store = null) - { - if ($store === null) { - foreach (Mage::app()->getStores() as $store) { - $this->rebuild($store->getId()); - } - $flag = $this->getFlatHelper()->getFlag(); - $flag->setIsBuild(true)->save(); - - return $this; - } - - $storeId = (int)Mage::app()->getStore($store)->getId(); - - $this->prepareFlatTable($storeId); - $this->cleanNonWebsiteProducts($storeId); - $this->updateStaticAttributes($storeId); - $this->updateEavAttributes($storeId); - $this->updateEventAttributes($storeId); - $this->updateRelationProducts($storeId); - $this->cleanRelationProducts($storeId); - - return $this; - } - - /** - * Retrieve Catalog Product Flat helper - * - * @return Mage_Catalog_Helper_Product_Flat - */ - public function getFlatHelper() - { - return Mage::helper('Mage_Catalog_Helper_Product_Flat'); - } - - /** - * Retrieve attribute codes using for flat - * - * @return array - */ - public function getAttributeCodes() - { - if ($this->_attributeCodes === null) { - $adapter = $this->_getReadAdapter(); - $this->_attributeCodes = array(); - - $attributeNodes = Mage::getConfig() - ->getNode(self::XML_NODE_ATTRIBUTE_NODES) - ->children(); - foreach ($attributeNodes as $node) { - $attributes = Mage::getConfig()->getNode((string)$node)->asArray(); - $attributes = array_keys($attributes); - $this->_systemAttributes = array_unique(array_merge($attributes, $this->_systemAttributes)); - } - - $bind = array( - 'backend_type' => Mage_Eav_Model_Entity_Attribute_Abstract::TYPE_STATIC, - 'entity_type_id' => $this->getEntityTypeId() - ); - - $select = $adapter->select() - ->from(array('main_table' => $this->getTable('eav_attribute'))) - ->join( - array('additional_table' => $this->getTable('catalog_eav_attribute')), - 'additional_table.attribute_id = main_table.attribute_id' - ) - ->where('main_table.entity_type_id = :entity_type_id'); - $whereCondition = array( - 'main_table.backend_type = :backend_type', - $adapter->quoteInto('additional_table.is_used_for_promo_rules = ?', 1), - $adapter->quoteInto('additional_table.used_in_product_listing = ?', 1), - $adapter->quoteInto('additional_table.used_for_sort_by = ?', 1), - $adapter->quoteInto('main_table.attribute_code IN(?)', $this->_systemAttributes) - ); - if ($this->getFlatHelper()->isAddFilterableAttributes()) { - $whereCondition[] = $adapter->quoteInto('additional_table.is_filterable > ?', 0); - } - - $select->where(implode(' OR ', $whereCondition)); - $attributesData = $adapter->fetchAll($select, $bind); - Mage::getSingleton('Mage_Eav_Model_Config') - ->importAttributesData($this->getEntityType(), $attributesData); - - foreach ($attributesData as $data) { - $this->_attributeCodes[$data['attribute_id']] = $data['attribute_code']; - } - unset($attributesData); - } - - return $this->_attributeCodes; - } - - /** - * Retrieve entity type - * - * @return string - */ - public function getEntityType() - { - return Mage_Catalog_Model_Product::ENTITY; - } - - /** - * Retrieve Catalog Entity Type Id - * - * @return int - */ - public function getEntityTypeId() - { - if ($this->_entityTypeId === null) { - $this->_entityTypeId = Mage::getResourceModel('Mage_Catalog_Model_Resource_Config') - ->getEntityTypeId(); - } - return $this->_entityTypeId; - } - - /** - * Retrieve attribute objects for flat - * - * @return array - */ - public function getAttributes() - { - if ($this->_attributes === null) { - $this->_attributes = array(); - $attributeCodes = $this->getAttributeCodes(); - $entity = Mage::getSingleton('Mage_Eav_Model_Config') - ->getEntityType($this->getEntityType()) - ->getEntity(); - - foreach ($attributeCodes as $attributeCode) { - $attribute = Mage::getSingleton('Mage_Eav_Model_Config') - ->getAttribute($this->getEntityType(), $attributeCode) - ->setEntity($entity); - try { - // check if exists source and backend model. - // To prevent exception when some module was disabled - $attribute->usesSource() && $attribute->getSource(); - $attribute->getBackend(); - $this->_attributes[$attributeCode] = $attribute; - } catch (Exception $e) { - Mage::logException($e); - } - } - } - - return $this->_attributes; - } - - /** - * Retrieve loaded attribute by code - * - * @param string $attributeCode - * @throws Mage_Core_Exception - * @return Mage_Eav_Model_Entity_Attribute - */ - public function getAttribute($attributeCode) - { - $attributes = $this->getAttributes(); - if (!isset($attributes[$attributeCode])) { - $attribute = Mage::getModel('Mage_Catalog_Model_Resource_Eav_Attribute') - ->loadByCode($this->getEntityTypeId(), $attributeCode); - if (!$attribute->getId()) { - Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__('Invalid attribute %s', $attributeCode)); - } - $entity = Mage::getSingleton('Mage_Eav_Model_Config') - ->getEntityType($this->getEntityType()) - ->getEntity(); - $attribute->setEntity($entity); - - return $attribute; - } - - return $attributes[$attributeCode]; - } - - /** - * Retrieve Catalog Product Flat Table name - * - * @param int $storeId - * @return string - */ - public function getFlatTableName($storeId) - { - return sprintf('%s_%s', $this->getTable('catalog_product_flat'), $storeId); - } - - /** - * Retrieve catalog product flat columns array in old format (used before MMDB support) - * - * @return array - */ - protected function _getFlatColumnsOldDefinition() - { - $columns = array(); - $columns['entity_id'] = array( - 'type' => 'int(10)', - 'unsigned' => true, - 'is_null' => false, - 'default' => null, - 'extra' => null - ); - if ($this->getFlatHelper()->isAddChildData()) { - $columns['child_id'] = array( - 'type' => 'int(10)', - 'unsigned' => true, - 'is_null' => true, - 'default' => null, - 'extra' => null - ); - $columns['is_child'] = array( - 'type' => 'tinyint(1)', - 'unsigned' => true, - 'is_null' => false, - 'default' => 0, - 'extra' => null - ); - } - $columns['attribute_set_id'] = array( - 'type' => 'smallint(5)', - 'unsigned' => true, - 'is_null' => false, - 'default' => 0, - 'extra' => null - ); - $columns['type_id'] = array( - 'type' => 'varchar(32)', - 'unsigned' => false, - 'is_null' => false, - 'default' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, - 'extra' => null - ); - - return $columns; - } - - /** - * Retrieve catalog product flat columns array in DDL format - * - * @return array - */ - protected function _getFlatColumnsDdlDefinition() - { - $columns = array(); - $columns['entity_id'] = array( - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'length' => null, - 'unsigned' => true, - 'nullable' => false, - 'default' => false, - 'primary' => true, - 'comment' => 'Entity Id' - ); - if ($this->getFlatHelper()->isAddChildData()) { - $columns['child_id'] = array( - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'length' => null, - 'unsigned' => true, - 'nullable' => true, - 'default' => null, - 'primary' => true, - 'comment' => 'Child Id' - ); - $columns['is_child'] = array( - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'length' => 1, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Checks If Entity Is Child' - ); - } - $columns['attribute_set_id'] = array( - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'length' => 5, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Set Id' - ); - $columns['type_id'] = array( - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'unsigned' => false, - 'nullable' => false, - 'default' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, - 'comment' => 'Type Id' - ); - - return $columns; - } - - /** - * Retrieve catalog product flat table columns array - * - * @return array - */ - public function getFlatColumns() - { - if ($this->_columns === null) { - if (Mage::helper('Mage_Core_Helper_Data')->useDbCompatibleMode()) { - $this->_columns = $this->_getFlatColumnsOldDefinition(); - } else { - $this->_columns = $this->_getFlatColumnsDdlDefinition(); - } - - foreach ($this->getAttributes() as $attribute) { - /** @var $attribute Mage_Eav_Model_Entity_Attribute_Abstract */ - $columns = $attribute - ->setFlatAddFilterableAttributes($this->getFlatHelper()->isAddFilterableAttributes()) - ->setFlatAddChildData($this->getFlatHelper()->isAddChildData()) - ->getFlatColumns(); - if ($columns !== null) { - $this->_columns = array_merge($this->_columns, $columns); - } - } - - $columnsObject = new Varien_Object(); - $columnsObject->setColumns($this->_columns); - Mage::dispatchEvent('catalog_product_flat_prepare_columns', - array('columns' => $columnsObject) - ); - $this->_columns = $columnsObject->getColumns(); - } - - return $this->_columns; - } - - /** - * Retrieve catalog product flat table indexes array - * - * @return array - */ - public function getFlatIndexes() - { - if ($this->_indexes === null) { - $this->_indexes = array(); - - if ($this->getFlatHelper()->isAddChildData()) { - $this->_indexes['PRIMARY'] = array( - 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, - 'fields' => array('entity_id', 'child_id') - ); - $this->_indexes['IDX_CHILD'] = array( - 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, - 'fields' => array('child_id') - ); - $this->_indexes['IDX_IS_CHILD'] = array( - 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, - 'fields' => array('entity_id', 'is_child') - ); - } else { - $this->_indexes['PRIMARY'] = array( - 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, - 'fields' => array('entity_id') - ); - } - $this->_indexes['IDX_TYPE_ID'] = array( - 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, - 'fields' => array('type_id') - ); - $this->_indexes['IDX_ATTRIBUTE_SET'] = array( - 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, - 'fields' => array('attribute_set_id') - ); - - foreach ($this->getAttributes() as $attribute) { - /** @var $attribute Mage_Eav_Model_Entity_Attribute */ - $indexes = $attribute - ->setFlatAddFilterableAttributes($this->getFlatHelper()->isAddFilterableAttributes()) - ->setFlatAddChildData($this->getFlatHelper()->isAddChildData()) - ->getFlatIndexes(); - if ($indexes !== null) { - $this->_indexes = array_merge($this->_indexes, $indexes); - } - } - - $indexesObject = new Varien_Object(); - $indexesObject->setIndexes($this->_indexes); - Mage::dispatchEvent('catalog_product_flat_prepare_indexes', array( - 'indexes' => $indexesObject - )); - $this->_indexes = $indexesObject->getIndexes(); - } - - return $this->_indexes; - } - - /** - * Compare Flat style with Describe style columns - * If column a different - return false - * - * @param array $column - * @param array $describe - * @return bool - */ - protected function _compareColumnProperties($column, $describe) - { - return Mage::getResourceHelper('Mage_Catalog')->compareIndexColumnProperties($column, $describe); - } - - /** - * Retrieve UNIQUE HASH for a Table foreign key - * - * @param string $priTableName the target table name - * @param string $priColumnName the target table column name - * @param string $refTableName the reference table name - * @param string $refColumnName the reference table column name - * @return string - */ - public function getFkName($priTableName, $priColumnName, $refTableName, $refColumnName) - { - return Mage::getSingleton('Mage_Core_Model_Resource') - ->getFkName($priTableName, $priColumnName, $refTableName, $refColumnName); - } - - /** - * Prepare flat table for store - * - * @param int $storeId - * @throws Mage_Core_Exception - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function prepareFlatTable($storeId) - { - if (isset($this->_preparedFlatTables[$storeId])) { - return $this; - } - $adapter = $this->_getWriteAdapter(); - $tableName = $this->getFlatTableName($storeId); - - // Extract columns we need to have in flat table - $columns = $this->getFlatColumns(); - if (Mage::helper('Mage_Core_Helper_Data')->useDbCompatibleMode()) { - /* Convert old format of flat columns to new MMDB format that uses DDL types and definitions */ - foreach ($columns as $key => $column) { - $columns[$key] = Mage::getResourceHelper('Mage_Core')->convertOldColumnDefinition($column); - } - } - - // Extract indexes we need to have in flat table - $indexesNeed = $this->getFlatIndexes(); - - $maxIndex = Mage::getConfig()->getNode(self::XML_NODE_MAX_INDEX_COUNT); - if (count($indexesNeed) > $maxIndex) { - Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__("The Flat Catalog module has a limit of %2\$d filterable and/or sortable attributes. Currently there are %1\$d of them. Please reduce the number of filterable/sortable attributes in order to use this module", count($indexesNeed), $maxIndex)); - } - - // Process indexes to create names for them in MMDB-style and reformat to common index definition - $indexKeys = array(); - $indexProps = array_values($indexesNeed); - $upperPrimaryKey = strtoupper(Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY); - foreach ($indexProps as $i => $indexProp) { - $indexName = $adapter->getIndexName($tableName, $indexProp['fields'], $indexProp['type']); - $indexProp['type'] = strtoupper($indexProp['type']); - if ($indexProp['type'] == $upperPrimaryKey) { - $indexKey = $upperPrimaryKey; - } else { - $indexKey = $indexName; - } - - $indexProps[$i] = array( - 'KEY_NAME' => $indexName, - 'COLUMNS_LIST' => $indexProp['fields'], - 'INDEX_TYPE' => strtolower($indexProp['type']) - ); - $indexKeys[$i] = $indexKey; - } - $indexesNeed = array_combine($indexKeys, $indexProps); // Array with index names as keys, except for primary - - // Foreign keys - $foreignEntityKey = $this->getFkName($tableName, 'entity_id', 'catalog_product_entity', 'entity_id'); - $foreignChildKey = $this->getFkName($tableName, 'child_id', 'catalog_product_entity', 'entity_id'); - - // Create table or modify existing one - if (!$this->_isFlatTableExists($storeId)) { - /** @var $table Varien_Db_Ddl_Table */ - $table = $adapter->newTable($tableName); - foreach ($columns as $fieldName => $fieldProp) { - $table->addColumn( - $fieldName, - $fieldProp['type'], - isset($fieldProp['length']) ? $fieldProp['length'] : null, - array( - 'nullable' => isset($fieldProp['nullable']) ? (bool)$fieldProp['nullable'] : false, - 'unsigned' => isset($fieldProp['unsigned']) ? (bool)$fieldProp['unsigned'] : false, - 'default' => isset($fieldProp['default']) ? $fieldProp['default'] : false, - 'primary' => false, - ), - isset($fieldProp['comment']) ? $fieldProp['comment'] : $fieldName - ); - } - - foreach ($indexesNeed as $indexProp) { - $table->addIndex($indexProp['KEY_NAME'], $indexProp['COLUMNS_LIST'], - array('type' => $indexProp['INDEX_TYPE'])); - } - - $table->addForeignKey($foreignEntityKey, - 'entity_id', $this->getTable('catalog_product_entity'), 'entity_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE); - - if ($this->getFlatHelper()->isAddChildData()) { - $table->addForeignKey($foreignChildKey, - 'child_id', $this->getTable('catalog_product_entity'), 'entity_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE); - } - $table->setComment("Catalog Product Flat (Store {$storeId})"); - - $adapter->createTable($table); - - $this->_existsFlatTables[$storeId] = true; - } else { - $adapter->resetDdlCache($tableName); - - // Sort columns into added/altered/dropped lists - $describe = $adapter->describeTable($tableName); - $addColumns = array_diff_key($columns, $describe); - $dropColumns = array_diff_key($describe, $columns); - $modifyColumns = array(); - foreach ($columns as $field => $fieldProp) { - if (isset($describe[$field]) && !$this->_compareColumnProperties($fieldProp, $describe[$field])) { - $modifyColumns[$field] = $fieldProp; - } - } - - // Sort indexes into added/dropped lists. Altered indexes are put into both lists. - $addIndexes = array(); - $dropIndexes = array(); - $indexesNow = $adapter->getIndexList($tableName); // Note: primary is always stored under 'PRIMARY' key - $newIndexes = $indexesNeed; - foreach ($indexesNow as $key => $indexNow) { - if (isset($indexesNeed[$key])) { - $indexNeed = $indexesNeed[$key]; - if (($indexNeed['INDEX_TYPE'] != $indexNow['INDEX_TYPE']) - || ($indexNeed['COLUMNS_LIST'] != $indexNow['COLUMNS_LIST'])) { - $dropIndexes[$key] = $indexNow; - $addIndexes[$key] = $indexNeed; - } - unset($newIndexes[$key]); - } else { - $dropIndexes[$key] = $indexNow; - } - } - $addIndexes = $addIndexes + $newIndexes; - - // Compose contstraints - $addConstraints = array(); - $addConstraints[$foreignEntityKey] = array( - 'table_index' => 'entity_id', - 'ref_table' => $this->getTable('catalog_product_entity'), - 'ref_index' => 'entity_id', - 'on_update' => Varien_Db_Ddl_Table::ACTION_CASCADE, - 'on_delete' => Varien_Db_Ddl_Table::ACTION_CASCADE - ); - - // Additional data from childs - $isAddChildData = $this->getFlatHelper()->isAddChildData(); - if (!$isAddChildData && isset($describe['is_child'])) { - $adapter->delete($tableName, array('is_child = ?' => 1)); - $adapter->dropForeignKey($tableName, $foreignChildKey); - } - if ($isAddChildData && !isset($describe['is_child'])) { - $adapter->delete($tableName); - $dropIndexes['PRIMARY'] = $indexesNow['PRIMARY']; - $addIndexes['PRIMARY'] = $indexesNeed['PRIMARY']; - - $addConstraints[$foreignChildKey] = array( - 'table_index' => 'child_id', - 'ref_table' => $this->getTable('catalog_product_entity'), - 'ref_index' => 'entity_id', - 'on_update' => Varien_Db_Ddl_Table::ACTION_CASCADE, - 'on_delete' => Varien_Db_Ddl_Table::ACTION_CASCADE - ); - } - - // Drop constraints - foreach (array_keys($adapter->getForeignKeys($tableName)) as $constraintName) { - $adapter->dropForeignKey($tableName, $constraintName); - } - - // Drop indexes - foreach ($dropIndexes as $indexProp) { - $adapter->dropIndex($tableName, $indexProp['KEY_NAME']); - } - - // Drop columns - foreach (array_keys($dropColumns) as $columnName) { - $adapter->dropColumn($tableName, $columnName); - } - - // Modify columns - foreach ($modifyColumns as $columnName => $columnProp) { - $columnProp = array_change_key_case($columnProp, CASE_UPPER); - if (!isset($columnProp['COMMENT'])) { - $columnProp['COMMENT'] = ucwords(str_replace('_', ' ', $columnName)); - } - $adapter->changeColumn($tableName, $columnName, $columnName, $columnProp); - } - - // Add columns - foreach ($addColumns as $columnName => $columnProp) { - $columnProp = array_change_key_case($columnProp, CASE_UPPER); - if (!isset($columnProp['COMMENT'])) { - $columnProp['COMMENT'] = ucwords(str_replace('_', ' ', $columnName)); - } - $adapter->addColumn($tableName, $columnName, $columnProp); - } - - // Add indexes - foreach ($addIndexes as $indexProp) { - $adapter->addIndex($tableName, $indexProp['KEY_NAME'], $indexProp['COLUMNS_LIST'], - $indexProp['INDEX_TYPE']); - } - - // Add constraints - foreach ($addConstraints as $constraintName => $constraintProp) { - $adapter->addForeignKey($constraintName, $tableName, - $constraintProp['table_index'], - $constraintProp['ref_table'], - $constraintProp['ref_index'], - $constraintProp['on_delete'], - $constraintProp['on_update'] - ); - } - } - - $this->_preparedFlatTables[$storeId] = true; - - return $this; - } - - /** - * Add or Update static attributes - * - * @param int $storeId - * @param int|array $productIds update only product(s) - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function updateStaticAttributes($storeId, $productIds = null) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - $adapter = $this->_getWriteAdapter(); - $websiteId = (int)Mage::app()->getStore($storeId)->getWebsite()->getId(); - /* @var $status Mage_Eav_Model_Entity_Attribute */ - $status = $this->getAttribute('status'); - - $fieldList = array('entity_id', 'type_id', 'attribute_set_id'); - $colsList = array('entity_id', 'type_id', 'attribute_set_id'); - if ($this->getFlatHelper()->isAddChildData()) { - $fieldList = array_merge($fieldList, array('child_id', 'is_child')); - $isChild = new Zend_Db_Expr('0'); - $colsList = array_merge($colsList, array('entity_id', $isChild)); - } - - $columns = $this->getFlatColumns(); - $bind = array( - 'website_id' => $websiteId, - 'store_id' => $storeId, - 'entity_type_id' => (int)$status->getEntityTypeId(), - 'attribute_id' => (int)$status->getId() - ); - - $fieldExpr = $adapter->getCheckSql('t2.value_id > 0', 't2.value', 't1.value'); - $select = $this->_getWriteAdapter()->select() - ->from(array('e' => $this->getTable('catalog_product_entity')), $colsList) - ->join( - array('wp' => $this->getTable('catalog_product_website')), - 'e.entity_id = wp.product_id AND wp.website_id = :website_id', - array()) - ->joinLeft( - array('t1' => $status->getBackend()->getTable()), - 'e.entity_id = t1.entity_id', - array()) - ->joinLeft( - array('t2' => $status->getBackend()->getTable()), - 't2.entity_id = t1.entity_id' - . ' AND t1.entity_type_id = t2.entity_type_id' - . ' AND t1.attribute_id = t2.attribute_id' - . ' AND t2.store_id = :store_id', - array()) - ->where('t1.entity_type_id = :entity_type_id') - ->where('t1.attribute_id = :attribute_id') - ->where('t1.store_id = ?', Mage_Core_Model_App::ADMIN_STORE_ID) - ->where("{$fieldExpr} = ?", Mage_Catalog_Model_Product_Status::STATUS_ENABLED); - foreach ($this->getAttributes() as $attributeCode => $attribute) { - /** @var $attribute Mage_Eav_Model_Entity_Attribute */ - if ($attribute->getBackend()->getType() == 'static') { - if (!isset($columns[$attributeCode])) { - continue; - } - $fieldList[] = $attributeCode; - $select->columns($attributeCode, 'e'); - } - } - - if ($productIds !== null) { - $select->where('e.entity_id IN(?)', $productIds); - } - - $sql = $select->insertFromSelect($this->getFlatTableName($storeId), $fieldList); - $adapter->query($sql, $bind); - - return $this; - } - - /** - * Remove non website products - * - * @param int $storeId - * @param int|array $productIds - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function cleanNonWebsiteProducts($storeId, $productIds = null) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - - $websiteId = (int)Mage::app()->getStore($storeId)->getWebsite()->getId(); - $adapter = $this->_getWriteAdapter(); - - $joinCondition = array( - 'e.entity_id = wp.product_id', - 'wp.website_id = :website_id' - ); - if ($this->getFlatHelper()->isAddChildData()) { - $joinCondition[] = 'e.child_id = wp.product_id'; - } - $bind = array('website_id' => $websiteId); - $select = $adapter->select() - ->from(array('e' => $this->getFlatTableName($storeId)), null) - ->joinLeft( - array('wp' => $this->getTable('catalog_product_website')), - implode(' AND ', $joinCondition), - array()); - if ($productIds !== null) { - $condition = array( - $adapter->quoteInto('e.entity_id IN(?)', $productIds) - ); - if ($this->getFlatHelper()->isAddChildData()) { - $condition[] = $adapter->quoteInto('e.child_id IN(?)', $productIds); - } - $select->where(implode(' OR ', $condition)); - } - - $sql = $select->deleteFromSelect('e'); - $adapter->query($sql, $bind); - - return $this; - } - - /** - * Update attribute flat data - * - * @param Mage_Eav_Model_Entity_Attribute $attribute - * @param int $storeId - * @param int|array $productIds update only product(s) - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function updateAttribute($attribute, $storeId, $productIds = null) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - $adapter = $this->_getWriteAdapter(); - $flatTableName = $this->getFlatTableName($storeId); - $describe = $adapter->describeTable($flatTableName); - - if ($attribute->getBackend()->getType() == 'static') { - if (!isset($describe[$attribute->getAttributeCode()])) { - return $this; - } - - $select = $adapter->select() - ->join( - array('main_table' => $this->getTable('catalog_product_entity')), - 'main_table.entity_id = e.entity_id', - array($attribute->getAttributeCode() => 'main_table.' . $attribute->getAttributeCode()) - ); - if ($this->getFlatHelper()->isAddChildData()) { - $select->where('e.is_child = ?', 0); - } - if ($productIds !== null) { - $select->where('main_table.entity_id IN(?)', $productIds); - } - - $sql = $select->crossUpdateFromSelect(array('e' => $flatTableName)); - $adapter->query($sql); - } else { - $columns = $attribute->getFlatColumns(); - if (!$columns) { - return $this; - } - foreach (array_keys($columns) as $columnName) { - if (!isset($describe[$columnName])) { - return $this; - } - } - - $select = $attribute->getFlatUpdateSelect($storeId); - if ($select instanceof Varien_Db_Select) { - if ($productIds !== null) { - $select->where('e.entity_id IN(?)', $productIds); - } - - $sql = $select->crossUpdateFromSelect(array('e' => $flatTableName)); - $adapter->query($sql); - } - } - - return $this; - } - - /** - * Update non static EAV attributes flat data - * - * @param int $storeId - * @param int|array $productIds update only product(s) - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function updateEavAttributes($storeId, $productIds = null) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - - foreach ($this->getAttributes() as $attribute) { - /* @var $attribute Mage_Eav_Model_Entity_Attribute */ - if ($attribute->getBackend()->getType() != 'static') { - $this->updateAttribute($attribute, $storeId, $productIds); - } - } - return $this; - } - - /** - * Update events observer attributes - * - * @param int $storeId - */ - public function updateEventAttributes($storeId = null) - { - Mage::dispatchEvent('catalog_product_flat_rebuild', array( - 'store_id' => $storeId, - 'table' => $this->getFlatTableName($storeId) - )); - } - - /** - * Retrieve Product Type Instances - * as key - type code, value - instance model - * - * @return array - */ - public function getProductTypeInstances() - { - if ($this->_productTypes === null) { - $this->_productTypes = array(); - $productEmulator = new Varien_Object(); - - foreach (array_keys(Mage_Catalog_Model_Product_Type::getTypes()) as $typeId) { - $productEmulator->setTypeId($typeId); - $this->_productTypes[$typeId] = Mage::getSingleton('Mage_Catalog_Model_Product_Type') - ->factory($productEmulator); - } - } - return $this->_productTypes; - } - - /** - * Update relation products - * - * @param int $storeId - * @param int|array $productIds Update child product(s) only - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function updateRelationProducts($storeId, $productIds = null) - { - if (!$this->getFlatHelper()->isAddChildData() || !$this->_isFlatTableExists($storeId)) { - return $this; - } - - $adapter = $this->_getWriteAdapter(); - - foreach ($this->getProductTypeInstances() as $typeInstance) { - if (!$typeInstance->isComposite()) { - continue; - } - $relation = $typeInstance->getRelationInfo(); - if ($relation - && $relation->getTable() - && $relation->getParentFieldName() - && $relation->getChildFieldName() - ) { - $columns = $this->getFlatColumns(); - $fieldList = array_keys($columns); - unset($columns['entity_id']); - unset($columns['child_id']); - unset($columns['is_child']); - - $select = $adapter->select() - ->from( - array('t' => $this->getTable($relation->getTable())), - array($relation->getParentFieldName(), $relation->getChildFieldName(), new Zend_Db_Expr('1'))) - ->join( - array('e' => $this->getFlatTableName($storeId)), - "e.entity_id = t.{$relation->getChildFieldName()}", - array_keys($columns) - ); - if ($relation->getWhere() !== null) { - $select->where($relation->getWhere()); - } - if ($productIds !== null) { - $cond = array( - $adapter->quoteInto("{$relation->getChildFieldName()} IN(?)", $productIds), - $adapter->quoteInto("{$relation->getParentFieldName()} IN(?)", $productIds) - ); - - $select->where(implode(' OR ', $cond)); - } - $sql = $select->insertFromSelect($this->getFlatTableName($storeId), $fieldList); - $adapter->query($sql); - } - } - - return $this; - } - - /** - * Update children data from parent - * - * @param int $storeId - * @param int|array $productIds - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function updateChildrenDataFromParent($storeId, $productIds = null) - { - if (!$this->getFlatHelper()->isAddChildData() || !$this->_isFlatTableExists($storeId)) { - return $this; - } - $adapter = $this->_getWriteAdapter(); - - $select = $adapter->select(); - foreach (array_keys($this->getFlatColumns()) as $columnName) { - if ($columnName == 'entity_id' || $columnName == 'child_id' || $columnName == 'is_child') { - continue; - } - $select->columns(array($columnName => new Zend_Db_Expr('t1.' . $columnName))); - } - $select - ->joinLeft( - array('t1' => $this->getFlatTableName($storeId)), - $adapter->quoteInto('t2.child_id = t1.entity_id AND t1.is_child = ?', 0), - array()) - ->where('t2.is_child = ?', 1); - - if ($productIds !== null) { - $select->where('t2.child_id IN(?)', $productIds); - } - - $sql = $select->crossUpdateFromSelect(array('t2' => $this->getFlatTableName($storeId))); - $adapter->query($sql); - - return $this; - } - - /** - * Clean unused relation products - * - * @param int $storeId - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function cleanRelationProducts($storeId) - { - if (!$this->getFlatHelper()->isAddChildData()) { - return $this; - } - - foreach ($this->getProductTypeInstances() as $typeInstance) { - if (!$typeInstance->isComposite()) { - continue; - } - $adapter = $this->_getWriteAdapter(); - $relation = $typeInstance->getRelationInfo(); - if ($relation - && $relation->getTable() - && $relation->getParentFieldName() - && $relation->getChildFieldName() - ) { - $select = $this->_getWriteAdapter()->select() - ->distinct(true) - ->from( - $this->getTable($relation->getTable()), - "{$relation->getParentFieldName()}" - ); - $joinLeftCond = array( - "e.entity_id = t.{$relation->getParentFieldName()}", - "e.child_id = t.{$relation->getChildFieldName()}" - ); - if ($relation->getWhere() !== null) { - $select->where($relation->getWhere()); - $joinLeftCond[] = $relation->getWhere(); - } - - $entitySelect = new Zend_Db_Expr($select->__toString()); - - $select = $adapter->select() - ->from(array('e' => $this->getFlatTableName($storeId)), null) - ->joinLeft( - array('t' => $this->getTable($relation->getTable())), - implode(' AND ', $joinLeftCond), - array()) - ->where('e.is_child = ?', 1) - ->where('e.entity_id IN(?)', $entitySelect) - ->where("t.{$relation->getChildFieldName()} IS NULL"); - - $sql = $select->deleteFromSelect('e'); - $adapter->query($sql); - } - } - - return $this; - } - - /** - * Remove product data from flat - * - * @param int|array $productIds - * @param int $storeId - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function removeProduct($productIds, $storeId) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - $adapter = $this->_getWriteAdapter(); - $cond = array( - $adapter->quoteInto('entity_id IN(?)', $productIds) - ); - if ($this->getFlatHelper()->isAddChildData()) { - $cond[] = $adapter->quoteInto('child_id IN(?)', $productIds); - } - $cond = implode(' OR ', $cond); - $adapter->delete($this->getFlatTableName($storeId), $cond); - - return $this; - } - - /** - * Remove children from parent product - * - * @param int|array $productIds - * @param int $storeId - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function removeProductChildren($productIds, $storeId) - { - if (!$this->getFlatHelper()->isAddChildData()) { - return $this; - } - $whereExpr = array( - 'entity_id IN(?)' => $productIds, - 'is_child = ?' => 1 - ); - $this->_getWriteAdapter()->delete($this->getFlatTableName($storeId), $whereExpr); - - return $this; - } - - /** - * Update flat data for product - * - * @param int|array $productIds - * @param int $storeId - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function updateProduct($productIds, $storeId) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - - $this->saveProduct($productIds, $storeId); - - Mage::dispatchEvent('catalog_product_flat_update_product', array( - 'store_id' => $storeId, - 'table' => $this->getFlatTableName($storeId), - 'product_ids' => $productIds - )); - - return $this; - } - - /** - * Save product(s) data for store - * - * @param int|array $productIds - * @param int $storeId - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function saveProduct($productIds, $storeId) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - - $this->updateStaticAttributes($storeId, $productIds); - $this->updateEavAttributes($storeId, $productIds); - - return $this; - } - - /** - * Delete flat table process - * - * @param int $storeId - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function deleteFlatTable($storeId) - { - if ($this->_isFlatTableExists($storeId)) { - $this->_getWriteAdapter()->dropTable($this->getFlatTableName($storeId)); - } - - return $this; - } - - /** - * Check is flat table for store exists - * - * @param int $storeId - * @return bool - */ - protected function _isFlatTableExists($storeId) - { - if (!isset($this->_existsFlatTables[$storeId])) { - $tableName = $this->getFlatTableName($storeId); - $isTableExists = $this->_getWriteAdapter()->isTableExists($tableName); - - $this->_existsFlatTables[$storeId] = $isTableExists ? true : false; - } - - return $this->_existsFlatTables[$storeId]; - } - - /** - * Retrieve previous key from array by key - * - * @param array $array - * @param mixed $key - * @return mixed - */ - protected function _arrayPrevKey(array $array, $key) - { - $prev = false; - foreach (array_keys($array) as $k) { - if ($k == $key) { - return $prev; - } - $prev = $k; - } - return false; - } - - /** - * Retrieve next key from array by key - * - * @param array $array - * @param mixed $key - * @return mixed - */ - protected function _arrayNextKey(array $array, $key) - { - $next = false; - foreach (array_keys($array) as $k) { - if ($next === true) { - return $k; - } - if ($k == $key) { - $next = true; - } - } - return false; - } - - /** - * Prepare flat tables for all stores - * - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function prepareFlatTables() - { + */ + + +/** + * Catalog Product Flat Indexer Resource Model + * + * @category Mage + * @package Mage_Catalog + * @author Magento Core Team <core@magentocommerce.com> + */ +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'; + + /** + * Attribute codes for flat + * + * @var array + */ + protected $_attributeCodes; + + /** + * Attribute objects for flat cache + * + * @var array + */ + protected $_attributes; + + /** + * Required system attributes for preload + * + * @var array + */ + protected $_systemAttributes = array('status', 'required_options', 'tax_class_id', 'weight'); + + /** + * Eav Catalog_Product Entity Type Id + * + * @var int + */ + protected $_entityTypeId; + + /** + * Flat table columns cache + * + * @var array + */ + protected $_columns; + + /** + * Flat table indexes cache + * + * @var array + */ + protected $_indexes; + + /** + * Product Type Instances cache + * + * @var array + */ + protected $_productTypes; + + /** + * Exists flat tables cache + * + * @var array + */ + protected $_existsFlatTables = array(); + + /** + * Flat tables which were prepared + * + * @var array + */ + protected $_preparedFlatTables = array(); + + /** + * Initialize connection + * + */ + protected function _construct() + { + $this->_init('catalog_product_entity', 'entity_id'); + } + + /** + * Rebuild Catalog Product Flat Data + * + * @param Mage_Core_Model_Store|int $store + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function rebuild($store = null) + { + if ($store === null) { + foreach (Mage::app()->getStores() as $store) { + $this->rebuild($store->getId()); + } + $flag = $this->getFlatHelper()->getFlag(); + $flag->setIsBuild(true)->save(); + + return $this; + } + + $storeId = (int)Mage::app()->getStore($store)->getId(); + + $this->prepareFlatTable($storeId); + $this->cleanNonWebsiteProducts($storeId); + $this->updateStaticAttributes($storeId); + $this->updateEavAttributes($storeId); + $this->updateEventAttributes($storeId); + $this->updateRelationProducts($storeId); + $this->cleanRelationProducts($storeId); + + return $this; + } + + /** + * Retrieve Catalog Product Flat helper + * + * @return Mage_Catalog_Helper_Product_Flat + */ + public function getFlatHelper() + { + return Mage::helper('Mage_Catalog_Helper_Product_Flat'); + } + + /** + * Retrieve attribute codes using for flat + * + * @return array + */ + public function getAttributeCodes() + { + if ($this->_attributeCodes === null) { + $adapter = $this->_getReadAdapter(); + $this->_attributeCodes = array(); + + $attributeNodes = Mage::getConfig() + ->getNode(self::XML_NODE_ATTRIBUTE_NODES) + ->children(); + foreach ($attributeNodes as $node) { + $attributes = Mage::getConfig()->getNode((string)$node)->asArray(); + $attributes = array_keys($attributes); + $this->_systemAttributes = array_unique(array_merge($attributes, $this->_systemAttributes)); + } + + $bind = array( + 'backend_type' => Mage_Eav_Model_Entity_Attribute_Abstract::TYPE_STATIC, + 'entity_type_id' => $this->getEntityTypeId() + ); + + $select = $adapter->select() + ->from(array('main_table' => $this->getTable('eav_attribute'))) + ->join( + array('additional_table' => $this->getTable('catalog_eav_attribute')), + 'additional_table.attribute_id = main_table.attribute_id' + ) + ->where('main_table.entity_type_id = :entity_type_id'); + $whereCondition = array( + 'main_table.backend_type = :backend_type', + $adapter->quoteInto('additional_table.is_used_for_promo_rules = ?', 1), + $adapter->quoteInto('additional_table.used_in_product_listing = ?', 1), + $adapter->quoteInto('additional_table.used_for_sort_by = ?', 1), + $adapter->quoteInto('main_table.attribute_code IN(?)', $this->_systemAttributes) + ); + if ($this->getFlatHelper()->isAddFilterableAttributes()) { + $whereCondition[] = $adapter->quoteInto('additional_table.is_filterable > ?', 0); + } + + $select->where(implode(' OR ', $whereCondition)); + $attributesData = $adapter->fetchAll($select, $bind); + Mage::getSingleton('Mage_Eav_Model_Config') + ->importAttributesData($this->getEntityType(), $attributesData); + + foreach ($attributesData as $data) { + $this->_attributeCodes[$data['attribute_id']] = $data['attribute_code']; + } + unset($attributesData); + } + + return $this->_attributeCodes; + } + + /** + * Retrieve entity type + * + * @return string + */ + public function getEntityType() + { + return Mage_Catalog_Model_Product::ENTITY; + } + + /** + * Retrieve Catalog Entity Type Id + * + * @return int + */ + public function getEntityTypeId() + { + if ($this->_entityTypeId === null) { + $this->_entityTypeId = Mage::getResourceModel('Mage_Catalog_Model_Resource_Config') + ->getEntityTypeId(); + } + return $this->_entityTypeId; + } + + /** + * Retrieve attribute objects for flat + * + * @return array + */ + public function getAttributes() + { + if ($this->_attributes === null) { + $this->_attributes = array(); + $attributeCodes = $this->getAttributeCodes(); + $entity = Mage::getSingleton('Mage_Eav_Model_Config') + ->getEntityType($this->getEntityType()) + ->getEntity(); + + foreach ($attributeCodes as $attributeCode) { + $attribute = Mage::getSingleton('Mage_Eav_Model_Config') + ->getAttribute($this->getEntityType(), $attributeCode) + ->setEntity($entity); + try { + // check if exists source and backend model. + // To prevent exception when some module was disabled + $attribute->usesSource() && $attribute->getSource(); + $attribute->getBackend(); + $this->_attributes[$attributeCode] = $attribute; + } catch (Exception $e) { + Mage::logException($e); + } + } + } + + return $this->_attributes; + } + + /** + * Retrieve loaded attribute by code + * + * @param string $attributeCode + * @throws Mage_Core_Exception + * @return Mage_Eav_Model_Entity_Attribute + */ + public function getAttribute($attributeCode) + { + $attributes = $this->getAttributes(); + if (!isset($attributes[$attributeCode])) { + $attribute = Mage::getModel('Mage_Catalog_Model_Resource_Eav_Attribute') + ->loadByCode($this->getEntityTypeId(), $attributeCode); + if (!$attribute->getId()) { + Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__('Invalid attribute %s', $attributeCode)); + } + $entity = Mage::getSingleton('Mage_Eav_Model_Config') + ->getEntityType($this->getEntityType()) + ->getEntity(); + $attribute->setEntity($entity); + + return $attribute; + } + + return $attributes[$attributeCode]; + } + + /** + * Retrieve Catalog Product Flat Table name + * + * @param int $storeId + * @return string + */ + public function getFlatTableName($storeId) + { + return sprintf('%s_%s', $this->getTable('catalog_product_flat'), $storeId); + } + + /** + * Retrieve catalog product flat columns array in old format (used before MMDB support) + * + * @return array + */ + protected function _getFlatColumnsOldDefinition() + { + $columns = array(); + $columns['entity_id'] = array( + 'type' => 'int(10)', + 'unsigned' => true, + 'is_null' => false, + 'default' => null, + 'extra' => null + ); + if ($this->getFlatHelper()->isAddChildData()) { + $columns['child_id'] = array( + 'type' => 'int(10)', + 'unsigned' => true, + 'is_null' => true, + 'default' => null, + 'extra' => null + ); + $columns['is_child'] = array( + 'type' => 'tinyint(1)', + 'unsigned' => true, + 'is_null' => false, + 'default' => 0, + 'extra' => null + ); + } + $columns['attribute_set_id'] = array( + 'type' => 'smallint(5)', + 'unsigned' => true, + 'is_null' => false, + 'default' => 0, + 'extra' => null + ); + $columns['type_id'] = array( + 'type' => 'varchar(32)', + 'unsigned' => false, + 'is_null' => false, + 'default' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, + 'extra' => null + ); + + return $columns; + } + + /** + * Retrieve catalog product flat columns array in DDL format + * + * @return array + */ + protected function _getFlatColumnsDdlDefinition() + { + $columns = array(); + $columns['entity_id'] = array( + 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, + 'length' => null, + 'unsigned' => true, + 'nullable' => false, + 'default' => false, + 'primary' => true, + 'comment' => 'Entity Id' + ); + if ($this->getFlatHelper()->isAddChildData()) { + $columns['child_id'] = array( + 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, + 'length' => null, + 'unsigned' => true, + 'nullable' => true, + 'default' => null, + 'primary' => true, + 'comment' => 'Child Id' + ); + $columns['is_child'] = array( + 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, + 'length' => 1, + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + 'comment' => 'Checks If Entity Is Child' + ); + } + $columns['attribute_set_id'] = array( + 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, + 'length' => 5, + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + 'comment' => 'Attribute Set Id' + ); + $columns['type_id'] = array( + 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'length' => 32, + 'unsigned' => false, + 'nullable' => false, + 'default' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, + 'comment' => 'Type Id' + ); + + return $columns; + } + + /** + * Retrieve catalog product flat table columns array + * + * @return array + */ + public function getFlatColumns() + { + if ($this->_columns === null) { + if (Mage::helper('Mage_Core_Helper_Data')->useDbCompatibleMode()) { + $this->_columns = $this->_getFlatColumnsOldDefinition(); + } else { + $this->_columns = $this->_getFlatColumnsDdlDefinition(); + } + + foreach ($this->getAttributes() as $attribute) { + /** @var $attribute Mage_Eav_Model_Entity_Attribute_Abstract */ + $columns = $attribute + ->setFlatAddFilterableAttributes($this->getFlatHelper()->isAddFilterableAttributes()) + ->setFlatAddChildData($this->getFlatHelper()->isAddChildData()) + ->getFlatColumns(); + if ($columns !== null) { + $this->_columns = array_merge($this->_columns, $columns); + } + } + + $columnsObject = new Varien_Object(); + $columnsObject->setColumns($this->_columns); + Mage::dispatchEvent('catalog_product_flat_prepare_columns', + array('columns' => $columnsObject) + ); + $this->_columns = $columnsObject->getColumns(); + } + + return $this->_columns; + } + + /** + * Retrieve catalog product flat table indexes array + * + * @return array + */ + public function getFlatIndexes() + { + if ($this->_indexes === null) { + $this->_indexes = array(); + + if ($this->getFlatHelper()->isAddChildData()) { + $this->_indexes['PRIMARY'] = array( + 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, + 'fields' => array('entity_id', 'child_id') + ); + $this->_indexes['IDX_CHILD'] = array( + 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, + 'fields' => array('child_id') + ); + $this->_indexes['IDX_IS_CHILD'] = array( + 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, + 'fields' => array('entity_id', 'is_child') + ); + } else { + $this->_indexes['PRIMARY'] = array( + 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, + 'fields' => array('entity_id') + ); + } + $this->_indexes['IDX_TYPE_ID'] = array( + 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, + 'fields' => array('type_id') + ); + $this->_indexes['IDX_ATTRIBUTE_SET'] = array( + 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, + 'fields' => array('attribute_set_id') + ); + + foreach ($this->getAttributes() as $attribute) { + /** @var $attribute Mage_Eav_Model_Entity_Attribute */ + $indexes = $attribute + ->setFlatAddFilterableAttributes($this->getFlatHelper()->isAddFilterableAttributes()) + ->setFlatAddChildData($this->getFlatHelper()->isAddChildData()) + ->getFlatIndexes(); + if ($indexes !== null) { + $this->_indexes = array_merge($this->_indexes, $indexes); + } + } + + $indexesObject = new Varien_Object(); + $indexesObject->setIndexes($this->_indexes); + Mage::dispatchEvent('catalog_product_flat_prepare_indexes', array( + 'indexes' => $indexesObject + )); + $this->_indexes = $indexesObject->getIndexes(); + } + + return $this->_indexes; + } + + /** + * Compare Flat style with Describe style columns + * If column a different - return false + * + * @param array $column + * @param array $describe + * @return bool + */ + protected function _compareColumnProperties($column, $describe) + { + return Mage::getResourceHelper('Mage_Catalog')->compareIndexColumnProperties($column, $describe); + } + + /** + * Retrieve UNIQUE HASH for a Table foreign key + * + * @param string $priTableName the target table name + * @param string $priColumnName the target table column name + * @param string $refTableName the reference table name + * @param string $refColumnName the reference table column name + * @return string + */ + public function getFkName($priTableName, $priColumnName, $refTableName, $refColumnName) + { + return Mage::getSingleton('Mage_Core_Model_Resource') + ->getFkName($priTableName, $priColumnName, $refTableName, $refColumnName); + } + + /** + * Prepare flat table for store + * + * @param int $storeId + * @throws Mage_Core_Exception + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function prepareFlatTable($storeId) + { + if (isset($this->_preparedFlatTables[$storeId])) { + return $this; + } + $adapter = $this->_getWriteAdapter(); + $tableName = $this->getFlatTableName($storeId); + + // Extract columns we need to have in flat table + $columns = $this->getFlatColumns(); + if (Mage::helper('Mage_Core_Helper_Data')->useDbCompatibleMode()) { + /* Convert old format of flat columns to new MMDB format that uses DDL types and definitions */ + foreach ($columns as $key => $column) { + $columns[$key] = Mage::getResourceHelper('Mage_Core')->convertOldColumnDefinition($column); + } + } + + // Extract indexes we need to have in flat table + $indexesNeed = $this->getFlatIndexes(); + + $maxIndex = Mage::getConfig()->getNode(self::XML_NODE_MAX_INDEX_COUNT); + if (count($indexesNeed) > $maxIndex) { + Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__("The Flat Catalog module has a limit of %2\$d filterable and/or sortable attributes. Currently there are %1\$d of them. Please reduce the number of filterable/sortable attributes in order to use this module", count($indexesNeed), $maxIndex)); + } + + // Process indexes to create names for them in MMDB-style and reformat to common index definition + $indexKeys = array(); + $indexProps = array_values($indexesNeed); + $upperPrimaryKey = strtoupper(Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY); + foreach ($indexProps as $i => $indexProp) { + $indexName = $adapter->getIndexName($tableName, $indexProp['fields'], $indexProp['type']); + $indexProp['type'] = strtoupper($indexProp['type']); + if ($indexProp['type'] == $upperPrimaryKey) { + $indexKey = $upperPrimaryKey; + } else { + $indexKey = $indexName; + } + + $indexProps[$i] = array( + 'KEY_NAME' => $indexName, + 'COLUMNS_LIST' => $indexProp['fields'], + 'INDEX_TYPE' => strtolower($indexProp['type']) + ); + $indexKeys[$i] = $indexKey; + } + $indexesNeed = array_combine($indexKeys, $indexProps); // Array with index names as keys, except for primary + + // Foreign keys + $foreignEntityKey = $this->getFkName($tableName, 'entity_id', 'catalog_product_entity', 'entity_id'); + $foreignChildKey = $this->getFkName($tableName, 'child_id', 'catalog_product_entity', 'entity_id'); + + // Create table or modify existing one + if (!$this->_isFlatTableExists($storeId)) { + /** @var $table Varien_Db_Ddl_Table */ + $table = $adapter->newTable($tableName); + foreach ($columns as $fieldName => $fieldProp) { + $table->addColumn( + $fieldName, + $fieldProp['type'], + isset($fieldProp['length']) ? $fieldProp['length'] : null, + array( + 'nullable' => isset($fieldProp['nullable']) ? (bool)$fieldProp['nullable'] : false, + 'unsigned' => isset($fieldProp['unsigned']) ? (bool)$fieldProp['unsigned'] : false, + 'default' => isset($fieldProp['default']) ? $fieldProp['default'] : false, + 'primary' => false, + ), + isset($fieldProp['comment']) ? $fieldProp['comment'] : $fieldName + ); + } + + foreach ($indexesNeed as $indexProp) { + $table->addIndex($indexProp['KEY_NAME'], $indexProp['COLUMNS_LIST'], + array('type' => $indexProp['INDEX_TYPE'])); + } + + $table->addForeignKey($foreignEntityKey, + 'entity_id', $this->getTable('catalog_product_entity'), 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE); + + if ($this->getFlatHelper()->isAddChildData()) { + $table->addForeignKey($foreignChildKey, + 'child_id', $this->getTable('catalog_product_entity'), 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE); + } + $table->setComment("Catalog Product Flat (Store {$storeId})"); + + $adapter->createTable($table); + + $this->_existsFlatTables[$storeId] = true; + } else { + $adapter->resetDdlCache($tableName); + + // Sort columns into added/altered/dropped lists + $describe = $adapter->describeTable($tableName); + $addColumns = array_diff_key($columns, $describe); + $dropColumns = array_diff_key($describe, $columns); + $modifyColumns = array(); + foreach ($columns as $field => $fieldProp) { + if (isset($describe[$field]) && !$this->_compareColumnProperties($fieldProp, $describe[$field])) { + $modifyColumns[$field] = $fieldProp; + } + } + + // Sort indexes into added/dropped lists. Altered indexes are put into both lists. + $addIndexes = array(); + $dropIndexes = array(); + $indexesNow = $adapter->getIndexList($tableName); // Note: primary is always stored under 'PRIMARY' key + $newIndexes = $indexesNeed; + foreach ($indexesNow as $key => $indexNow) { + if (isset($indexesNeed[$key])) { + $indexNeed = $indexesNeed[$key]; + if (($indexNeed['INDEX_TYPE'] != $indexNow['INDEX_TYPE']) + || ($indexNeed['COLUMNS_LIST'] != $indexNow['COLUMNS_LIST'])) { + $dropIndexes[$key] = $indexNow; + $addIndexes[$key] = $indexNeed; + } + unset($newIndexes[$key]); + } else { + $dropIndexes[$key] = $indexNow; + } + } + $addIndexes = $addIndexes + $newIndexes; + + // Compose contstraints + $addConstraints = array(); + $addConstraints[$foreignEntityKey] = array( + 'table_index' => 'entity_id', + 'ref_table' => $this->getTable('catalog_product_entity'), + 'ref_index' => 'entity_id', + 'on_update' => Varien_Db_Ddl_Table::ACTION_CASCADE, + 'on_delete' => Varien_Db_Ddl_Table::ACTION_CASCADE + ); + + // Additional data from childs + $isAddChildData = $this->getFlatHelper()->isAddChildData(); + if (!$isAddChildData && isset($describe['is_child'])) { + $adapter->delete($tableName, array('is_child = ?' => 1)); + $adapter->dropForeignKey($tableName, $foreignChildKey); + } + if ($isAddChildData && !isset($describe['is_child'])) { + $adapter->delete($tableName); + $dropIndexes['PRIMARY'] = $indexesNow['PRIMARY']; + $addIndexes['PRIMARY'] = $indexesNeed['PRIMARY']; + + $addConstraints[$foreignChildKey] = array( + 'table_index' => 'child_id', + 'ref_table' => $this->getTable('catalog_product_entity'), + 'ref_index' => 'entity_id', + 'on_update' => Varien_Db_Ddl_Table::ACTION_CASCADE, + 'on_delete' => Varien_Db_Ddl_Table::ACTION_CASCADE + ); + } + + // Drop constraints + foreach (array_keys($adapter->getForeignKeys($tableName)) as $constraintName) { + $adapter->dropForeignKey($tableName, $constraintName); + } + + // Drop indexes + foreach ($dropIndexes as $indexProp) { + $adapter->dropIndex($tableName, $indexProp['KEY_NAME']); + } + + // Drop columns + foreach (array_keys($dropColumns) as $columnName) { + $adapter->dropColumn($tableName, $columnName); + } + + // Modify columns + foreach ($modifyColumns as $columnName => $columnProp) { + $columnProp = array_change_key_case($columnProp, CASE_UPPER); + if (!isset($columnProp['COMMENT'])) { + $columnProp['COMMENT'] = ucwords(str_replace('_', ' ', $columnName)); + } + $adapter->changeColumn($tableName, $columnName, $columnName, $columnProp); + } + + // Add columns + foreach ($addColumns as $columnName => $columnProp) { + $columnProp = array_change_key_case($columnProp, CASE_UPPER); + if (!isset($columnProp['COMMENT'])) { + $columnProp['COMMENT'] = ucwords(str_replace('_', ' ', $columnName)); + } + $adapter->addColumn($tableName, $columnName, $columnProp); + } + + // Add indexes + foreach ($addIndexes as $indexProp) { + $adapter->addIndex($tableName, $indexProp['KEY_NAME'], $indexProp['COLUMNS_LIST'], + $indexProp['INDEX_TYPE']); + } + + // Add constraints + foreach ($addConstraints as $constraintName => $constraintProp) { + $adapter->addForeignKey($constraintName, $tableName, + $constraintProp['table_index'], + $constraintProp['ref_table'], + $constraintProp['ref_index'], + $constraintProp['on_delete'], + $constraintProp['on_update'] + ); + } + } + + $this->_preparedFlatTables[$storeId] = true; + + return $this; + } + + /** + * Add or Update static attributes + * + * @param int $storeId + * @param int|array $productIds update only product(s) + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function updateStaticAttributes($storeId, $productIds = null) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + $adapter = $this->_getWriteAdapter(); + $websiteId = (int)Mage::app()->getStore($storeId)->getWebsite()->getId(); + /* @var $status Mage_Eav_Model_Entity_Attribute */ + $status = $this->getAttribute('status'); + + $fieldList = array('entity_id', 'type_id', 'attribute_set_id'); + $colsList = array('entity_id', 'type_id', 'attribute_set_id'); + if ($this->getFlatHelper()->isAddChildData()) { + $fieldList = array_merge($fieldList, array('child_id', 'is_child')); + $isChild = new Zend_Db_Expr('0'); + $colsList = array_merge($colsList, array('entity_id', $isChild)); + } + + $columns = $this->getFlatColumns(); + $bind = array( + 'website_id' => $websiteId, + 'store_id' => $storeId, + 'entity_type_id' => (int)$status->getEntityTypeId(), + 'attribute_id' => (int)$status->getId() + ); + + $fieldExpr = $adapter->getCheckSql('t2.value_id > 0', 't2.value', 't1.value'); + $select = $this->_getWriteAdapter()->select() + ->from(array('e' => $this->getTable('catalog_product_entity')), $colsList) + ->join( + array('wp' => $this->getTable('catalog_product_website')), + 'e.entity_id = wp.product_id AND wp.website_id = :website_id', + array()) + ->joinLeft( + array('t1' => $status->getBackend()->getTable()), + 'e.entity_id = t1.entity_id', + array()) + ->joinLeft( + array('t2' => $status->getBackend()->getTable()), + 't2.entity_id = t1.entity_id' + . ' AND t1.entity_type_id = t2.entity_type_id' + . ' AND t1.attribute_id = t2.attribute_id' + . ' AND t2.store_id = :store_id', + array()) + ->where('t1.entity_type_id = :entity_type_id') + ->where('t1.attribute_id = :attribute_id') + ->where('t1.store_id = ?', Mage_Core_Model_App::ADMIN_STORE_ID) + ->where("{$fieldExpr} = ?", Mage_Catalog_Model_Product_Status::STATUS_ENABLED); + foreach ($this->getAttributes() as $attributeCode => $attribute) { + /** @var $attribute Mage_Eav_Model_Entity_Attribute */ + if ($attribute->getBackend()->getType() == 'static') { + if (!isset($columns[$attributeCode])) { + continue; + } + $fieldList[] = $attributeCode; + $select->columns($attributeCode, 'e'); + } + } + + if ($productIds !== null) { + $select->where('e.entity_id IN(?)', $productIds); + } + + $sql = $select->insertFromSelect($this->getFlatTableName($storeId), $fieldList); + $adapter->query($sql, $bind); + + return $this; + } + + /** + * Remove non website products + * + * @param int $storeId + * @param int|array $productIds + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function cleanNonWebsiteProducts($storeId, $productIds = null) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + + $websiteId = (int)Mage::app()->getStore($storeId)->getWebsite()->getId(); + $adapter = $this->_getWriteAdapter(); + + $joinCondition = array( + 'e.entity_id = wp.product_id', + 'wp.website_id = :website_id' + ); + if ($this->getFlatHelper()->isAddChildData()) { + $joinCondition[] = 'e.child_id = wp.product_id'; + } + $bind = array('website_id' => $websiteId); + $select = $adapter->select() + ->from(array('e' => $this->getFlatTableName($storeId)), null) + ->joinLeft( + array('wp' => $this->getTable('catalog_product_website')), + implode(' AND ', $joinCondition), + array()); + if ($productIds !== null) { + $condition = array( + $adapter->quoteInto('e.entity_id IN(?)', $productIds) + ); + if ($this->getFlatHelper()->isAddChildData()) { + $condition[] = $adapter->quoteInto('e.child_id IN(?)', $productIds); + } + $select->where(implode(' OR ', $condition)); + } + + $sql = $select->deleteFromSelect('e'); + $adapter->query($sql, $bind); + + return $this; + } + + /** + * Update attribute flat data + * + * @param Mage_Eav_Model_Entity_Attribute $attribute + * @param int $storeId + * @param int|array $productIds update only product(s) + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function updateAttribute($attribute, $storeId, $productIds = null) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + $adapter = $this->_getWriteAdapter(); + $flatTableName = $this->getFlatTableName($storeId); + $describe = $adapter->describeTable($flatTableName); + + if ($attribute->getBackend()->getType() == 'static') { + if (!isset($describe[$attribute->getAttributeCode()])) { + return $this; + } + + $select = $adapter->select() + ->join( + array('main_table' => $this->getTable('catalog_product_entity')), + 'main_table.entity_id = e.entity_id', + array($attribute->getAttributeCode() => 'main_table.' . $attribute->getAttributeCode()) + ); + if ($this->getFlatHelper()->isAddChildData()) { + $select->where('e.is_child = ?', 0); + } + if ($productIds !== null) { + $select->where('main_table.entity_id IN(?)', $productIds); + } + + $sql = $select->crossUpdateFromSelect(array('e' => $flatTableName)); + $adapter->query($sql); + } else { + $columns = $attribute->getFlatColumns(); + if (!$columns) { + return $this; + } + foreach (array_keys($columns) as $columnName) { + if (!isset($describe[$columnName])) { + return $this; + } + } + + $select = $attribute->getFlatUpdateSelect($storeId); + if ($select instanceof Varien_Db_Select) { + if ($productIds !== null) { + $select->where('e.entity_id IN(?)', $productIds); + } + + $sql = $select->crossUpdateFromSelect(array('e' => $flatTableName)); + $adapter->query($sql); + } + } + + return $this; + } + + /** + * Update non static EAV attributes flat data + * + * @param int $storeId + * @param int|array $productIds update only product(s) + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function updateEavAttributes($storeId, $productIds = null) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + + foreach ($this->getAttributes() as $attribute) { + /* @var $attribute Mage_Eav_Model_Entity_Attribute */ + if ($attribute->getBackend()->getType() != 'static') { + $this->updateAttribute($attribute, $storeId, $productIds); + } + } + return $this; + } + + /** + * Update events observer attributes + * + * @param int $storeId + */ + public function updateEventAttributes($storeId = null) + { + Mage::dispatchEvent('catalog_product_flat_rebuild', array( + 'store_id' => $storeId, + 'table' => $this->getFlatTableName($storeId) + )); + } + + /** + * Retrieve Product Type Instances + * as key - type code, value - instance model + * + * @return array + */ + public function getProductTypeInstances() + { + if ($this->_productTypes === null) { + $this->_productTypes = array(); + $productEmulator = new Varien_Object(); + + foreach (array_keys(Mage_Catalog_Model_Product_Type::getTypes()) as $typeId) { + $productEmulator->setTypeId($typeId); + $this->_productTypes[$typeId] = Mage::getSingleton('Mage_Catalog_Model_Product_Type') + ->factory($productEmulator); + } + } + return $this->_productTypes; + } + + /** + * Update relation products + * + * @param int $storeId + * @param int|array $productIds Update child product(s) only + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function updateRelationProducts($storeId, $productIds = null) + { + if (!$this->getFlatHelper()->isAddChildData() || !$this->_isFlatTableExists($storeId)) { + return $this; + } + + $adapter = $this->_getWriteAdapter(); + + foreach ($this->getProductTypeInstances() as $typeInstance) { + if (!$typeInstance->isComposite()) { + continue; + } + $relation = $typeInstance->getRelationInfo(); + if ($relation + && $relation->getTable() + && $relation->getParentFieldName() + && $relation->getChildFieldName() + ) { + $columns = $this->getFlatColumns(); + $fieldList = array_keys($columns); + unset($columns['entity_id']); + unset($columns['child_id']); + unset($columns['is_child']); + + $select = $adapter->select() + ->from( + array('t' => $this->getTable($relation->getTable())), + array($relation->getParentFieldName(), $relation->getChildFieldName(), new Zend_Db_Expr('1'))) + ->join( + array('e' => $this->getFlatTableName($storeId)), + "e.entity_id = t.{$relation->getChildFieldName()}", + array_keys($columns) + ); + if ($relation->getWhere() !== null) { + $select->where($relation->getWhere()); + } + if ($productIds !== null) { + $cond = array( + $adapter->quoteInto("{$relation->getChildFieldName()} IN(?)", $productIds), + $adapter->quoteInto("{$relation->getParentFieldName()} IN(?)", $productIds) + ); + + $select->where(implode(' OR ', $cond)); + } + $sql = $select->insertFromSelect($this->getFlatTableName($storeId), $fieldList); + $adapter->query($sql); + } + } + + return $this; + } + + /** + * Update children data from parent + * + * @param int $storeId + * @param int|array $productIds + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function updateChildrenDataFromParent($storeId, $productIds = null) + { + if (!$this->getFlatHelper()->isAddChildData() || !$this->_isFlatTableExists($storeId)) { + return $this; + } + $adapter = $this->_getWriteAdapter(); + + $select = $adapter->select(); + foreach (array_keys($this->getFlatColumns()) as $columnName) { + if ($columnName == 'entity_id' || $columnName == 'child_id' || $columnName == 'is_child') { + continue; + } + $select->columns(array($columnName => new Zend_Db_Expr('t1.' . $columnName))); + } + $select + ->joinLeft( + array('t1' => $this->getFlatTableName($storeId)), + $adapter->quoteInto('t2.child_id = t1.entity_id AND t1.is_child = ?', 0), + array()) + ->where('t2.is_child = ?', 1); + + if ($productIds !== null) { + $select->where('t2.child_id IN(?)', $productIds); + } + + $sql = $select->crossUpdateFromSelect(array('t2' => $this->getFlatTableName($storeId))); + $adapter->query($sql); + + return $this; + } + + /** + * Clean unused relation products + * + * @param int $storeId + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function cleanRelationProducts($storeId) + { + if (!$this->getFlatHelper()->isAddChildData()) { + return $this; + } + + foreach ($this->getProductTypeInstances() as $typeInstance) { + if (!$typeInstance->isComposite()) { + continue; + } + $adapter = $this->_getWriteAdapter(); + $relation = $typeInstance->getRelationInfo(); + if ($relation + && $relation->getTable() + && $relation->getParentFieldName() + && $relation->getChildFieldName() + ) { + $select = $this->_getWriteAdapter()->select() + ->distinct(true) + ->from( + $this->getTable($relation->getTable()), + "{$relation->getParentFieldName()}" + ); + $joinLeftCond = array( + "e.entity_id = t.{$relation->getParentFieldName()}", + "e.child_id = t.{$relation->getChildFieldName()}" + ); + if ($relation->getWhere() !== null) { + $select->where($relation->getWhere()); + $joinLeftCond[] = $relation->getWhere(); + } + + $entitySelect = new Zend_Db_Expr($select->__toString()); + + $select = $adapter->select() + ->from(array('e' => $this->getFlatTableName($storeId)), null) + ->joinLeft( + array('t' => $this->getTable($relation->getTable())), + implode(' AND ', $joinLeftCond), + array()) + ->where('e.is_child = ?', 1) + ->where('e.entity_id IN(?)', $entitySelect) + ->where("t.{$relation->getChildFieldName()} IS NULL"); + + $sql = $select->deleteFromSelect('e'); + $adapter->query($sql); + } + } + + return $this; + } + + /** + * Remove product data from flat + * + * @param int|array $productIds + * @param int $storeId + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function removeProduct($productIds, $storeId) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + $adapter = $this->_getWriteAdapter(); + $cond = array( + $adapter->quoteInto('entity_id IN(?)', $productIds) + ); + if ($this->getFlatHelper()->isAddChildData()) { + $cond[] = $adapter->quoteInto('child_id IN(?)', $productIds); + } + $cond = implode(' OR ', $cond); + $adapter->delete($this->getFlatTableName($storeId), $cond); + + return $this; + } + + /** + * Remove children from parent product + * + * @param int|array $productIds + * @param int $storeId + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function removeProductChildren($productIds, $storeId) + { + if (!$this->getFlatHelper()->isAddChildData()) { + return $this; + } + $whereExpr = array( + 'entity_id IN(?)' => $productIds, + 'is_child = ?' => 1 + ); + $this->_getWriteAdapter()->delete($this->getFlatTableName($storeId), $whereExpr); + + return $this; + } + + /** + * Update flat data for product + * + * @param int|array $productIds + * @param int $storeId + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function updateProduct($productIds, $storeId) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + + $this->saveProduct($productIds, $storeId); + + Mage::dispatchEvent('catalog_product_flat_update_product', array( + 'store_id' => $storeId, + 'table' => $this->getFlatTableName($storeId), + 'product_ids' => $productIds + )); + + return $this; + } + + /** + * Save product(s) data for store + * + * @param int|array $productIds + * @param int $storeId + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function saveProduct($productIds, $storeId) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + + $this->updateStaticAttributes($storeId, $productIds); + $this->updateEavAttributes($storeId, $productIds); + + return $this; + } + + /** + * Delete flat table process + * + * @param int $storeId + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function deleteFlatTable($storeId) + { + if ($this->_isFlatTableExists($storeId)) { + $this->_getWriteAdapter()->dropTable($this->getFlatTableName($storeId)); + } + + return $this; + } + + /** + * Check is flat table for store exists + * + * @param int $storeId + * @return bool + */ + protected function _isFlatTableExists($storeId) + { + if (!isset($this->_existsFlatTables[$storeId])) { + $tableName = $this->getFlatTableName($storeId); + $isTableExists = $this->_getWriteAdapter()->isTableExists($tableName); + + $this->_existsFlatTables[$storeId] = $isTableExists ? true : false; + } + + return $this->_existsFlatTables[$storeId]; + } + + /** + * Retrieve previous key from array by key + * + * @param array $array + * @param mixed $key + * @return mixed + */ + protected function _arrayPrevKey(array $array, $key) + { + $prev = false; + foreach (array_keys($array) as $k) { + if ($k == $key) { + return $prev; + } + $prev = $k; + } + return false; + } + + /** + * Retrieve next key from array by key + * + * @param array $array + * @param mixed $key + * @return mixed + */ + protected function _arrayNextKey(array $array, $key) + { + $next = false; + foreach (array_keys($array) as $k) { + if ($next === true) { + return $k; + } + if ($k == $key) { + $next = true; + } + } + 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); - } - return $this; - } - - /** - * Transactional rebuild Catalog Product Flat Data - * - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function reindexAll() - { - $this->prepareFlatTables(); - $this->beginTransaction(); - try { - $this->rebuild(); - $this->commit(); - } catch (Exception $e) { - $this->rollBack(); - throw $e; - } - return $this; - } -} + $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; + } +} \ No newline at end of file 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 2cd11ec583d..b1742c68d64 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 58225ad20cf..9b5362f6a12 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 b78d1a72fb3..8046cf03a9c 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) */ 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 d8eeadc217d..5e220a5fb43 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 1349247c98c..26049c32eb9 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 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source ) ->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 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source $select->where(Mage::getResourceHelper('Mage_Catalog')->getIsNullNotNullCondition('pis.value', 'pid.value')); - if (!is_null($entityIds)) { - $select->where('pid.entity_id IN(?)', $entityIds); - } - /** * Add additional external limitation */ @@ -290,4 +290,4 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source } return $this->getTable('catalog_product_index_eav_tmp'); } -} \ No newline at end of file +} 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 80c34ad8929..e2949d2d063 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) */ @@ -169,6 +169,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model if ($indexer->getIsComposite()) { $this->_copyRelationIndexData($productId); $this->_prepareTierPriceIndex($productId); + $this->_prepareGroupPriceIndex($productId); $indexer->reindexEntity($productId); } else { $parentIds = $this->getProductParentsByChild($productId); @@ -177,6 +178,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model $processIds = array_merge($processIds, array_keys($parentIds)); $this->_copyRelationIndexData(array_keys($parentIds), $productId); $this->_prepareTierPriceIndex($processIds); + $this->_prepareGroupPriceIndex($processIds); $indexer->reindexEntity($productId); $parentByType = array(); @@ -189,6 +191,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model } } else { $this->_prepareTierPriceIndex($productId); + $this->_prepareGroupPriceIndex($productId); $indexer->reindexEntity($productId); } } @@ -371,6 +374,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model $this->clearTemporaryIndexTable(); $this->_prepareWebsiteDateTable(); $this->_prepareTierPriceIndex(); + $this->_prepareGroupPriceIndex(); $indexers = $this->getTypeIndexers(); foreach ($indexers as $indexer) { @@ -397,6 +401,16 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model 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 * @@ -440,6 +454,49 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model 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->getTable('catalog_product_entity_group_price')), + array('entity_id')) + ->join( + array('cg' => $this->getTable('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 ef9828635de..9e50d208d5e 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) */ @@ -170,20 +170,26 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable ->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); @@ -192,7 +198,10 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable $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); @@ -206,9 +215,13 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable .' 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); 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 6c7d929b3ba..026a59b8b02 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) */ @@ -220,6 +220,11 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default '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 @@ -237,6 +242,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default $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); @@ -247,14 +253,17 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default $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)) { @@ -304,7 +313,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default if ($this->useIdxTable()) { return $this->getTable('catalog_product_index_price_opt_agr_idx'); } - return $this->getTable('catalog_product_index_price_opt_agr_idx'); + return $this->getTable('catalog_product_index_price_opt_agr_tmp'); } /** @@ -403,16 +412,22 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default $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); @@ -461,10 +476,16 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default $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); @@ -480,6 +501,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default '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); @@ -493,9 +515,13 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default .' 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); @@ -522,7 +548,8 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default '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(); @@ -548,6 +575,16 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default 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 bfcac8c95a4..b8f2671d5ea 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) */ @@ -103,13 +103,14 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Grouped '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() + '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') + '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/Indexer/Price/Interface.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Interface.php index f590e1b3b42..f0b22210318 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 011563141f8..d8cfafa401a 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 4e452dba7a3..a382b405d20 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 ea9de7b0eb7..ac7668d36b3 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 bed92f6bb49..f20811bfb83 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 d4531437bf2..986ca7aee0c 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) */ 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 b6ea1a68b90..8dd0bfd44c6 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 8c1675c1f2d..c4186d1e216 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 a8e6cf6ec44..0cfe7589694 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 0e6f685568e..668a0550046 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 4fd38d4662b..094831d6a87 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) */ 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 900cb52653a..20ed35f2452 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 425dbf15649..29d59fa6c1a 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 59bfba75697..c72960147c3 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 9e9dd740ac3..d036d770c17 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 380d987a1dc..29eaf768aeb 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) */ @@ -484,7 +484,7 @@ class Mage_Catalog_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup '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 @@ class Mage_Catalog_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup 'sort_order' => 6, 'visible' => false, ), + 'group_price' => array( + 'type' => 'decimal', + 'label' => 'Group Price', + 'input' => 'text', + 'backend' => 'Mage_Catalog_Model_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 08fad62f32b..bdaad52a56b 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 @@ class Mage_Catalog_Model_Resource_Url extends Mage_Core_Model_Resource_Db_Abstra 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('Mage_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 * @@ -1310,12 +1344,26 @@ class Mage_Catalog_Model_Resource_Url extends Mage_Core_Model_Resource_Db_Abstra */ 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/Session.php b/app/code/core/Mage/Catalog/Model/Session.php index f36cb475c59..d859a9e2cce 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 af34c4f5e9a..849c208d23b 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 3d42873a4ea..d6c75997fef 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 d5e4ee82e69..f43f689532f 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 0c1e21708b1..5112981988e 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 166619c0653..97d673e2f1a 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 @@ class Mage_Catalog_Model_Url } // 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; @@ -694,7 +704,6 @@ class Mage_Catalog_Model_Url if (isset($this->_rewrites[$idPath])) { $this->_rewrite = $this->_rewrites[$idPath]; $existingRequestPath = $this->_rewrites[$idPath]->getRequestPath(); - $existingRequestPath = str_replace($suffix, '', $existingRequestPath); } if ($category->getUrlKey() == '') { @@ -715,8 +724,8 @@ class Mage_Catalog_Model_Url true, $category->getStoreId()); $requestPath = $parentPath . $urlKey . $categoryUrlSuffix; - if (isset($existingRequestPath) && $existingRequestPath == $requestPath) { - return $requestPath.$suffix; + if (isset($existingRequestPath) && $existingRequestPath == $requestPath . $suffix) { + return $existingRequestPath; } if ($this->_deleteOldTargetPath($requestPath, $idPath, $storeId)) { @@ -740,7 +749,7 @@ class Mage_Catalog_Model_Url { $finalOldTargetPath = $this->getResource()->findFinalTargetPath($requestPath, $storeId); if ($finalOldTargetPath && $finalOldTargetPath == $idPath) { - $this->getResource()->deleteRewrite($requestPath, $storeId); + $this->getResource()->deleteRewriteRecord($requestPath, $storeId, true); return true; } @@ -788,18 +797,21 @@ class Mage_Catalog_Model_Url 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(); } diff --git a/app/code/core/Mage/Catalog/controllers/CategoryController.php b/app/code/core/Mage/Catalog/controllers/CategoryController.php index 8801359ecbc..94f9cd49af6 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 e62be353722..eb7be117fa3 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 518996a92a8..c37faa4000c 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 c30282ceee8..3ba82f2988d 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) */ diff --git a/app/code/core/Mage/Catalog/controllers/Seo/SitemapController.php b/app/code/core/Mage/Catalog/controllers/Seo/SitemapController.php index 5b23b7bf43b..914ff48adef 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 e386348f781..37fbb8d9d74 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.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 b921169d4ba..afb034af56a 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 new file mode 100644 index 00000000000..5d78b856262 --- /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 @@ +<?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_Catalog + * @copyright 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_Catalog_Model_Resource_Setup */ +$installer = $this; + +/** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ +$attribute = $installer->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/adminhtml.xml b/app/code/core/Mage/Catalog/etc/adminhtml.xml index 6845e60c0c5..870118d399a 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) */ --> diff --git a/app/code/core/Mage/Catalog/etc/api.xml b/app/code/core/Mage/Catalog/etc/api.xml index cc7a02ae18d..389b61938a9 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 eaf855261b0..3bd81a75c91 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) */ --> <config> <modules> <Mage_Catalog> - <version>1.6.0.0.8</version> + <version>1.6.0.0.11</version> </Mage_Catalog> </modules> <global> @@ -392,6 +392,9 @@ <layered_navigation> <price_range_calculation>auto</price_range_calculation> <price_range_step>100</price_range_step> + <price_range_max_intervals>10</price_range_max_intervals> + <one_price_interval>0</one_price_interval> + <interval_division_limit>9</interval_division_limit> </layered_navigation> </catalog> <system> diff --git a/app/code/core/Mage/Catalog/etc/convert.xml b/app/code/core/Mage/Catalog/etc/convert.xml index d661e84f4a8..9b6bae2511c 100644 --- a/app/code/core/Mage/Catalog/etc/convert.xml +++ b/app/code/core/Mage/Catalog/etc/convert.xml @@ -21,30 +21,30 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <convert version="1.0"> - <container name="catalog_file" type="dataflow/convert_adapter_io"> + <container name="catalog_file" type="Mage_Dataflow_Model_Convert_Adapter_Io"> <var name="path">/tmp</var> <var name="filename">test.xml</var> </container> <profile name="import_products_from_excel_xml"> - <action method="load" type="dataflow/convert_adapter_io"> + <action method="load" type="Mage_Dataflow_Model_Convert_Adapter_Io"> <var name="filename">products.xml</var> </action> - <action method="parse" type="dataflow/convert_parser_xml_excel"> + <action method="parse" type="Mage_Dataflow_Model_Convert_Parser_Xml_Excel"> <var name="single_sheet">Products</var> </action> - <action method="parse" type="catalog/convert_parser_product"/> + <action method="parse" type="Mage_Catalog_Model_Convert_Parser_Product"/> - <action method="validate" type="dataflow/convert_validator_dryrun"/> + <action method="validate" type="Mage_Dataflow_Model_Convert_Validator_Dryrun"/> <action method="save" type="eav/convert_adapter_collection"/> </profile> @@ -54,15 +54,15 @@ <var name="entity_type">catalog/product</var> </action> - <action method="unparse" type="catalog/convert_parser_product"/> + <action method="unparse" type="Mage_Catalog_Model_Convert_Parser_Product"/> - <action method="unparse" type="dataflow/convert_parser_xml_excel"> + <action method="unparse" type="Mage_Dataflow_Model_Convert_Parser_Xml_Excel"> <var name="single_sheet">Products</var> </action> - <action method="validate" type="dataflow/convert_validator_dryrun"/> + <action method="validate" type="Mage_Dataflow_Model_Convert_Validator_Dryrun"/> - <action method="save" type="dataflow/convert_adapter_io"> + <action method="save" type="Mage_Dataflow_Model_Convert_Adapter_Io"> <var name="filename">products.xml</var> </action> </profile> @@ -70,23 +70,23 @@ <profile name="import_catalog"> <action method="load" use="catalog_file"/> - <action method="parse" type="dataflow/convert_parser_xml_excel"/> + <action method="parse" type="Mage_Dataflow_Model_Convert_Parser_Xml_Excel"/> - <action method="save" type="catalog/convert_adapter_catalog"/> + <action method="save" type="Mage_Catalog_Model_Convert_Adapter_Catalog"/> </profile> <profile name="export_catalog"> - <action method="load" type="catalog/convert_adapter_catalog"/> + <action method="load" type="Mage_Catalog_Model_Convert_Adapter_Catalog"/> - <action method="unparse" type="dataflow/convert_parser_xml_excel"/> + <action method="unparse" type="Mage_Dataflow_Model_Convert_Parser_Xml_Excel"/> <action method="save" use="catalog_file"/> </profile> <profile name="export_catalog_to_http"> - <action method="load" type="catalog/convert_adapter_catalog"/> + <action method="load" type="Mage_Catalog_Model_Convert_Adapter_Catalog"/> - <action method="unparse" type="dataflow/convert_parser_xml_excel"/> + <action method="unparse" type="Mage_Dataflow_Model_Convert_Parser_Xml_Excel"/> <action method="save" type="Mage_Dataflow_Model_Convert_Adapter_Http"> <var name="Content-Disposition">attachment; filename=catalog.xml</var> diff --git a/app/code/core/Mage/Catalog/etc/fieldset.xml b/app/code/core/Mage/Catalog/etc/fieldset.xml index 7d7b53e1736..9310bb06098 100644 --- a/app/code/core/Mage/Catalog/etc/fieldset.xml +++ b/app/code/core/Mage/Catalog/etc/fieldset.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 edee67a3ea4..80eb337ed88 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) */ --> @@ -64,6 +64,7 @@ <label>Products per Page on Grid Allowed Values</label> <comment>Comma-separated.</comment> <frontend_type>text</frontend_type> + <validate>validate-per-page-value-list</validate> <!--<source_model>Mage_Adminhtml_Model_System_Config_Source_Catalog_GridPerPage</source_model>--> <sort_order>2</sort_order> <show_in_default>1</show_in_default> @@ -74,6 +75,7 @@ <label>Products per Page on Grid Default Value</label> <comment>Must be in the allowed values list.</comment> <frontend_type>text</frontend_type> + <validate>validate-per-page-value</validate> <!--<source_model>Mage_Adminhtml_Model_System_Config_Source_Catalog_GridPerPage</source_model>--> <sort_order>3</sort_order> <show_in_default>1</show_in_default> @@ -84,6 +86,7 @@ <label>Products per Page on List Allowed Values</label> <comment>Comma-separated.</comment> <frontend_type>text</frontend_type> + <validate>validate-per-page-value-list</validate> <!--<source_model>Mage_Adminhtml_Model_System_Config_Source_Catalog_GridPerPage</source_model>--> <sort_order>4</sort_order> <show_in_default>1</show_in_default> @@ -94,6 +97,7 @@ <label>Products per Page on List Default Value</label> <comment>Must be in the allowed values list.</comment> <frontend_type>text</frontend_type> + <validate>validate-per-page-value</validate> <!--<source_model>Mage_Adminhtml_Model_System_Config_Source_Catalog_ListPerPage</source_model>--> <sort_order>5</sort_order> <show_in_default>1</show_in_default> @@ -320,12 +324,46 @@ <price_range_step translate="label"> <label>Default Price Navigation Step</label> <frontend_type>text</frontend_type> + <validate>validate-number validate-number-range number-range-0.01-1000000000</validate> <sort_order>2</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> <depends><price_range_calculation>manual</price_range_calculation></depends> </price_range_step> + <price_range_max_intervals translate="label comment"> + <label>Maximum Number of Price Intervals</label> + <comment>Maximum number of price intervals is 100</comment> + <frontend_type>text</frontend_type> + <validate>validate-digits validate-digits-range digits-range-2-100</validate> + <sort_order>3</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><price_range_calculation>manual</price_range_calculation></depends> + </price_range_max_intervals> + <one_price_interval translate="label comment"> + <label>Display Price Interval as One Price</label> + <comment>This setting will be applied when all prices in the specific price interval are equal.</comment> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>4</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><price_range_calculation>auto</price_range_calculation></depends> + </one_price_interval> + <interval_division_limit translate="label comment"> + <label>Interval Division Limit</label> + <comment>Please specify the number of products, that will not be divided into subintervals.</comment> + <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> + <validate>validate-digits validate-digits-range digits-range-1-10000</validate> + <depends><price_range_calculation>auto</price_range_calculation></depends> + </interval_division_limit> </fields> </layered_navigation> <navigation translate="label"> diff --git a/app/code/core/Mage/Catalog/etc/view.xml b/app/code/core/Mage/Catalog/etc/view.xml index 76a39e60da1..de0d81c393a 100644 --- a/app/code/core/Mage/Catalog/etc/view.xml +++ b/app/code/core/Mage/Catalog/etc/view.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/widget.xml b/app/code/core/Mage/Catalog/etc/widget.xml index 6d6e0071771..62044a87fc7 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 9ead1befc3c..b3581446854 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-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 00000000000..6c8b7018097 --- /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 @@ +<?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_Catalog + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +$installFile = dirname(__FILE__) . DS . 'upgrade-1.6.0.0.8-1.6.0.0.9.php'; +if (file_exists($installFile)) { + include $installFile; +} + +/** @var $installer Mage_Catalog_Model_Resource_Setup */ +$installer = $this; +/** @var $connection Varien_Db_Adapter_Pdo_Mysql */ +$connection = $installer->getConnection(); +$memoryTables = array( + 'catalog_category_anc_categs_index_tmp', + 'catalog_category_anc_products_index_tmp', + 'catalog_category_product_index_enbl_tmp', + 'catalog_category_product_index_tmp', + 'catalog_product_index_eav_decimal_tmp', + 'catalog_product_index_eav_tmp', + 'catalog_product_index_price_cfg_opt_agr_tmp', + 'catalog_product_index_price_cfg_opt_tmp', + 'catalog_product_index_price_final_tmp', + 'catalog_product_index_price_opt_agr_tmp', + 'catalog_product_index_price_opt_tmp', + 'catalog_product_index_price_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-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 6a72f55bfa1..6eb029d70c7 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 b86687dafad..0297c8e0643 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 00000000000..05161ad2d0e --- /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 @@ +<?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_Catalog + * @copyright 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_Catalog_Model_Resource_Setup */ +$installer = $this; + +$attributeId = $this->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.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 1ca57f4d7bc..09815b5d601 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 e2c7a5701a0..b6ab94d335e 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 752f2bbde06..4b2e2979668 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 fd578cc350b..b3468b6cd58 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 009a51b26ca..1408a7911fb 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 3402e5fad68..8bd9574ff64 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 new file mode 100644 index 00000000000..e447c63a6a9 --- /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 @@ +<?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_Catalog + * @copyright 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_Catalog_Model_Resource_Setup */ +$installer = $this; +$connection = $installer->getConnection(); + +/** + * Create table 'catalog_product_entity_group_price' + */ +$table = $installer->getConnection() + ->newTable($installer->getTable('catalog_product_entity_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_entity_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_entity_group_price', array('entity_id')), + array('entity_id')) + ->addIndex($installer->getIdxName('catalog_product_entity_group_price', array('customer_group_id')), + array('customer_group_id')) + ->addIndex($installer->getIdxName('catalog_product_entity_group_price', array('website_id')), + array('website_id')) + ->addForeignKey( + $installer->getFkName( + 'catalog_product_entity_group_price', + 'customer_group_id', + 'customer_group', + 'customer_group_id' + ), + 'customer_group_id', $installer->getTable('customer_group'), 'customer_group_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName( + 'catalog_product_entity_group_price', + 'entity_id', + 'catalog_product_entity', + 'entity_id' + ), + 'entity_id', $installer->getTable('catalog_product_entity'), 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName( + 'catalog_product_entity_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' => 'Mage_Catalog_Model_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_group', + 'customer_group_id' + ), + 'customer_group_id', $installer->getTable('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', + 'entity_id' + ), + 'entity_id', $installer->getTable('catalog_product_entity'), '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_index_price_final_idx', + 'catalog_product_index_price_final_tmp', +); + +$priceIndexerTables = array( + 'catalog_product_index_price_opt_agr_idx', + 'catalog_product_index_price_opt_agr_tmp', + 'catalog_product_index_price_opt_idx', + 'catalog_product_index_price_opt_tmp', + 'catalog_product_index_price_idx', + 'catalog_product_index_price_tmp', + 'catalog_product_index_price_cfg_opt_agr_idx', + 'catalog_product_index_price_cfg_opt_agr_tmp', + 'catalog_product_index_price_cfg_opt_idx', + 'catalog_product_index_price_cfg_opt_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/Catalog/view/frontend/category/view.phtml b/app/code/core/Mage/Catalog/view/frontend/category/view.phtml index d562afa3c11..21c074e1fe3 100644 --- a/app/code/core/Mage/Catalog/view/frontend/category/view.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/category/widget/link/link_block.phtml b/app/code/core/Mage/Catalog/view/frontend/category/widget/link/link_block.phtml index 74c399057b3..5ffb7548195 100644 --- a/app/code/core/Mage/Catalog/view/frontend/category/widget/link/link_block.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/category/widget/link/link_inline.phtml b/app/code/core/Mage/Catalog/view/frontend/category/widget/link/link_inline.phtml index c08c9a37e9c..60fac35e87f 100644 --- a/app/code/core/Mage/Catalog/view/frontend/category/widget/link/link_inline.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/layer/filter.phtml b/app/code/core/Mage/Catalog/view/frontend/layer/filter.phtml index 012367c077c..50977c6b21e 100644 --- a/app/code/core/Mage/Catalog/view/frontend/layer/filter.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/layer/state.phtml b/app/code/core/Mage/Catalog/view/frontend/layer/state.phtml index f6d7a7828c2..02395ab901f 100644 --- a/app/code/core/Mage/Catalog/view/frontend/layer/state.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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) */ ?> @@ -40,9 +40,14 @@ <li> <a href="<?php echo $_filter->getRemoveUrl() ?>" title="<?php echo $this->__('Remove This Item') ?>" class="btn-remove"><?php echo $this->__('Remove This Item') ?></a> <span class="label"><?php echo $this->__($_filter->getName()) ?>:</span> <?php echo $this->stripTags($_filter->getLabel()) ?> + <?php + $clearLinkUrl = $_filter->getClearLinkUrl(); + if ($clearLinkUrl): + ?> + <div class="actions"><a href="<?php echo $clearLinkUrl ?>"><?php echo $this->escapeHtml($_filter->getFilter()->getClearLinkText()) ?></a></div> + <?php endif; ?> </li> <?php endforeach; ?> </ol> - <div class="actions"><a href="<?php echo $this->getClearUrl() ?>"><?php echo $this->__('Clear All') ?></a></div> </div> <?php endif; ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/layer/view.phtml b/app/code/core/Mage/Catalog/view/frontend/layer/view.phtml index ad6e3c36037..a7eda469aac 100644 --- a/app/code/core/Mage/Catalog/view/frontend/layer/view.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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) */ ?> @@ -51,6 +51,9 @@ </dl> <script type="text/javascript">decorateDataList('narrow-by-list')</script> <?php endif; ?> + <?php if ($this->getLayer()->getState()->getFilters()): ?> + <div class="actions"><a href="<?php echo $this->getClearUrl() ?>"><?php echo $this->__('Clear All') ?></a></div> + <?php endif; ?> </div> </div> <?php endif; ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/layout.xml b/app/code/core/Mage/Catalog/view/frontend/layout.xml index 398c6e2e55e..4109dfe718d 100644 --- a/app/code/core/Mage/Catalog/view/frontend/layout.xml +++ b/app/code/core/Mage/Catalog/view/frontend/layout.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/code/core/Mage/Catalog/view/frontend/msrp.js b/app/code/core/Mage/Catalog/view/frontend/msrp.js index 79a7f2c5bbd..a25b41a9047 100644 --- a/app/code/core/Mage/Catalog/view/frontend/msrp.js +++ b/app/code/core/Mage/Catalog/view/frontend/msrp.js @@ -19,7 +19,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) */ if (!window.Catalog) { diff --git a/app/code/core/Mage/Catalog/view/frontend/msrp.xml b/app/code/core/Mage/Catalog/view/frontend/msrp.xml index 01712bcc628..06a6442ebba 100644 --- a/app/code/core/Mage/Catalog/view/frontend/msrp.xml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/msrp/popup.phtml b/app/code/core/Mage/Catalog/view/frontend/msrp/popup.phtml index 2b66de76c5e..07cec3b4b3d 100644 --- a/app/code/core/Mage/Catalog/view/frontend/msrp/popup.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/navigation/left.phtml b/app/code/core/Mage/Catalog/view/frontend/navigation/left.phtml index 6581f5781c4..26b5e871736 100644 --- a/app/code/core/Mage/Catalog/view/frontend/navigation/left.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/navigation/top.phtml b/app/code/core/Mage/Catalog/view/frontend/navigation/top.phtml index f5914a1e089..26bd72708f8 100644 --- a/app/code/core/Mage/Catalog/view/frontend/navigation/top.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml index a2320c34a7d..94fd7656705 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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 */ @@ -98,7 +98,9 @@ echo substr($this->getProductAttributeValue($_item, $_attribute),0,10); break; default: ?> - <?php echo $this->helper('Mage_Catalog_Helper_Output')->productAttribute($_item, $this->getProductAttributeValue($_item, $_attribute), $_attribute->getAttributeCode()) ?> + <div class="std"> + <?php echo $this->helper('Mage_Catalog_Helper_Output')->productAttribute($_item, $this->getProductAttributeValue($_item, $_attribute), $_attribute->getAttributeCode()) ?> + </div> <?php break; } ?> </td> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/compare/sidebar.phtml b/app/code/core/Mage/Catalog/view/frontend/product/compare/sidebar.phtml index 2c58d9d28be..5f9aab55d7f 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/compare/sidebar.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/gallery.phtml b/app/code/core/Mage/Catalog/view/frontend/product/gallery.phtml index 94cf1e3528d..cc3e65c76bc 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/gallery.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/list.phtml index cd40f7fb04d..575deaf044c 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/list/related.phtml b/app/code/core/Mage/Catalog/view/frontend/product/list/related.phtml index 5a1db095cce..61df743cf28 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/list/related.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/list/toolbar.phtml b/app/code/core/Mage/Catalog/view/frontend/product/list/toolbar.phtml index fb9e2aba884..7d1cb5d1c32 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/list/toolbar.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/list/upsell.phtml b/app/code/core/Mage/Catalog/view/frontend/product/list/upsell.phtml index 7dfc2254d8e..370be367d92 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/list/upsell.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/new.phtml b/app/code/core/Mage/Catalog/view/frontend/product/new.phtml index ae59c3e0ef8..5e05660ca6b 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/new.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/price.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price.phtml index d7ba09bdfe7..8ba900687ec 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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()); @@ -55,7 +56,7 @@ <?php $_weeeTaxAttributes = $_weeeHelper->getProductWeeeAttributesForDisplay($_product); ?> <?php endif; ?> <?php $_weeeTaxAmountInclTaxes = $_weeeTaxAmount; ?> - <?php if ($_weeeHelper->isTaxable()): ?> + <?php if ($_weeeHelper->isTaxable() && !$_taxHelper->priceIncludesTax($_storeId)): ?> <?php $_attributes = $_weeeHelper->getProductWeeeAttributesForRenderer($_product, null, null, null, true); ?> <?php $_weeeTaxAmountInclTaxes = $_weeeHelper->getAmountInclTaxes($_attributes); ?> <?php endif; ?> @@ -211,13 +212,13 @@ <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPrice+$_weeeTaxAmount,true,false) ?> </span> </span> <span class="price-including-tax"> - <span class="label"><?php echo $_taxHelper->__('Incl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Incl. Tax:') ?></span> <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPriceInclTax+$_weeeTaxAmountInclTaxes,true,false) ?> </span> @@ -227,7 +228,7 @@ <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currency($_finalPrice+$_weeeTaxAmount,true,false) ?> + <?php echo $_coreHelper->currency($_finalPrice+$_weeeTaxAmountInclTaxes,true,false) ?> </span> </p> <?php endif; ?> @@ -243,7 +244,7 @@ <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPrice+$_weeeTaxAmount,true,false) ?> </span> @@ -256,7 +257,7 @@ <?php endforeach; ?> )</span> <span class="price-including-tax"> - <span class="label"><?php echo $_taxHelper->__('Incl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Incl. Tax:') ?></span> <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPriceInclTax+$_weeeTaxAmountInclTaxes,true,false) ?> </span> @@ -273,7 +274,7 @@ <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPrice+$_weeeTaxAmount,true,false) ?> </span> @@ -303,7 +304,7 @@ <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPrice,true,false) ?> </span> @@ -332,7 +333,7 @@ <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPrice,true,false) ?> </span> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp.phtml index 26dc4d8833b..bb725886798 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/price_msrp_item.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_item.phtml index 6568b923415..e6222db00f0 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_item.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/price_msrp_noform.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_noform.phtml index 929229520f8..bface0a5515 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_noform.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/price_msrp_rss.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_rss.phtml index ac14f4c1230..f0516b5cfe2 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_rss.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/view.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view.phtml index 580bf9b879c..c732dd67247 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/view/additional.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/additional.phtml index eade95b3cb7..ded93626f71 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/additional.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/view/addto.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/addto.phtml index 2e1e3b4197d..3cc816ca913 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/addto.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.phtml index 9c3f4394996..747c7ea1957 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.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/code/core/Mage/Catalog/view/frontend/product/view/attributes.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/attributes.phtml index 8332d84db51..dd49710762f 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/attributes.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/attributes.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/code/core/Mage/Catalog/view/frontend/product/view/description.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/description.phtml index dc388d3f68c..7b0f29a4c5b 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/description.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/description.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/code/core/Mage/Catalog/view/frontend/product/view/media.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/media.phtml index cd1c56a1206..e21f36a949e 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/media.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/media.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/code/core/Mage/Catalog/view/frontend/product/view/options.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options.phtml index ab35faf6cbe..67fddcdbe8d 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options.phtml @@ -20,9 +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) */ +/* @var $this Mage_Catalog_Block_Product_View_Options */ ?> <?php $_options = Mage::helper('Mage_Core_Helper_Data')->decorateArray($this->getOptions()) ?> @@ -109,20 +110,20 @@ document.observe("dom:loaded", this.reloadPrice.bind(this)); }, reloadPrice : function(){ - price = new Number(); - oldPrice = new Number(); - config = this.config; - skipIds = []; - $$('.product-custom-option').each(function(element){ + var config = this.config; + var skipIds = []; + $$('body .product-custom-option').each(function(element){ var optionId = 0; element.name.sub(/[0-9]+/, function(match){ - optionId = match[0]; + optionId = parseInt(match[0], 10); }); - if (this.config[optionId]) { + if (config[optionId]) { + var configOptions = config[optionId]; + var curConfig = {price: 0}; if (element.type == 'checkbox' || element.type == 'radio') { if (element.checked) { - if (config[optionId][element.getValue()]['price']) { - price += parseFloat(config[optionId][element.getValue()]['price']); + if (typeof configOptions[element.getValue()] != 'undefined') { + curConfig = configOptions[element.getValue()]; } } } else if(element.hasClassName('datetime-picker') && !skipIds.include(optionId)) { @@ -133,35 +134,42 @@ } }); if (dateSelected) { - price += parseFloat(this.config[optionId]); + curConfig = configOptions; skipIds[optionId] = optionId; } } else if(element.type == 'select-one' || element.type == 'select-multiple') { - if (element.options) { + if ('options' in element) { $A(element.options).each(function(selectOption){ - try { - if (selectOption.selected) { - if (typeof(this.config[optionId][selectOption.value]['oldPrice']) !== undefined) { - price += parseFloat(this.config[optionId][selectOption.value]['price']); - oldPrice += parseFloat(this.config[optionId][selectOption.value]['oldPrice']); - } + if ('selected' in selectOption && selectOption.selected) { + if (typeof(configOptions[selectOption.value]) != 'undefined') { + curConfig = configOptions[selectOption.value]; } - } catch (e) {} + } }); } } else { if (element.getValue().strip() != '') { - price += parseFloat(this.config[optionId]); + curConfig = configOptions; } } + if(element.type == 'select-multiple' && ('options' in element)) { + $A(element.options).each(function(selectOption) { + if (('selected' in selectOption) && typeof(configOptions[selectOption.value]) != 'undefined') { + if (selectOption.selected) { + curConfig = configOptions[selectOption.value]; + } else { + curConfig = {price: 0}; + } + optionsPrice.addCustomPrices(optionId + '-' + selectOption.value, curConfig); + optionsPrice.reload(); + } + }); + } else { + optionsPrice.addCustomPrices(element.id || optionId, curConfig); + optionsPrice.reload(); + } } }); - try { - optionsPrice.changePrice('config', {'price': price, 'oldPrice': oldPrice, 'optionsPriceInclTax': price}); - optionsPrice.reload(); - } catch (e) { - - } } } function validateOptionsCallback(elmId, result){ diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options/js.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/js.phtml index 19695b1e1b1..85afcffbe0a 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/js.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/js.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/code/core/Mage/Catalog/view/frontend/product/view/options/type/date.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/date.phtml index 1e46359d2ad..9796705ddfc 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/date.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/date.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/code/core/Mage/Catalog/view/frontend/product/view/options/type/default.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/default.phtml index 3754c7a5a75..70958aaf2f4 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/default.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/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/code/core/Mage/Catalog/view/frontend/product/view/options/type/file.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/file.phtml index 91019b28556..9b9f79255e3 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/file.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/file.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/code/core/Mage/Catalog/view/frontend/product/view/options/type/select.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/select.phtml index 8256d6f8afe..0f092f81b2d 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/select.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/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/code/core/Mage/Catalog/view/frontend/product/view/options/type/text.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/text.phtml index e580eb108a8..36d28358f81 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/text.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/text.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/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper.phtml index 7ed615aeeb4..5a2af78ae8c 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper.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/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper/bottom.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper/bottom.phtml index e60da29a912..90075112450 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper/bottom.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper/bottom.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/code/core/Mage/Catalog/view/frontend/product/view/price_clone.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/price_clone.phtml index 1f22129c7b6..b77641d050a 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/price_clone.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/price_clone.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/code/core/Mage/Catalog/view/frontend/product/view/tierprices.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/tierprices.phtml index 9c49868864c..a5b80e96cdf 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/tierprices.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/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/code/core/Mage/Catalog/view/frontend/product/view/type/default.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/type/default.phtml index ab82c05408c..508f32f44f2 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/type/default.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/type/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/code/core/Mage/Catalog/view/frontend/product/view/type/grouped.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/type/grouped.phtml index afb2aeccc71..2460e242a2e 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/type/grouped.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/type/grouped.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/code/core/Mage/Catalog/view/frontend/product/view/type/options/configurable.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/type/options/configurable.phtml index dac89a053f8..7162053b477 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/type/options/configurable.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/type/options/configurable.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/code/core/Mage/Catalog/view/frontend/product/widget/link/link_block.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/link/link_block.phtml index d8a1ffaad3f..c4b133b7464 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/link/link_block.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/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/code/core/Mage/Catalog/view/frontend/product/widget/link/link_inline.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/link/link_inline.phtml index 1875524734b..548a71b071c 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/link/link_inline.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/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/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_default_list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_default_list.phtml index 83f44872d0a..10fd6a5e723 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_default_list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_default_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/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_images_list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_images_list.phtml index 806ddc74705..da0e0d5053e 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_images_list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_images_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/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_names_list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_names_list.phtml index e3d6af5fae8..b5eb610c2ff 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_names_list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_names_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/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_grid.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_grid.phtml index 1adc72c3504..4770cf8da44 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_grid.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_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/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_list.phtml index ed26427e30b..8f62d3f9903 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_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/code/core/Mage/Catalog/view/frontend/rss/product/price.phtml b/app/code/core/Mage/Catalog/view/frontend/rss/product/price.phtml index 3a8e28d1e87..3c2cd2855c2 100644 --- a/app/code/core/Mage/Catalog/view/frontend/rss/product/price.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/rss/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/code/core/Mage/Catalog/view/frontend/seo/sitemap.phtml b/app/code/core/Mage/Catalog/view/frontend/seo/sitemap.phtml index 9fe1bf3a0ae..cd1af1042c9 100644 --- a/app/code/core/Mage/Catalog/view/frontend/seo/sitemap.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/seo/sitemap.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) */ ?> @@ -33,7 +33,7 @@ <?php if($_items->getSize()): ?> <ul class="sitemap"> <?php foreach ($_items as $_item): ?> - <li><a href="<?php echo $this->getItemUrl($_item) ?>"><?php echo $_item->getName() ?></a></li> + <li><a href="<?php echo $this->getItemUrl($_item) ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></li> <?php endforeach; ?> </ul> <?php else: ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/seo/sitemap/container.phtml b/app/code/core/Mage/Catalog/view/frontend/seo/sitemap/container.phtml index a9464a90823..871a26fb2f5 100644 --- a/app/code/core/Mage/Catalog/view/frontend/seo/sitemap/container.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/seo/sitemap/container.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/code/core/Mage/Catalog/view/frontend/seo/tree.phtml b/app/code/core/Mage/Catalog/view/frontend/seo/tree.phtml index d95ec13e251..91924777dbe 100644 --- a/app/code/core/Mage/Catalog/view/frontend/seo/tree.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/seo/tree.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/code/core/Mage/Catalog/view/frontend/widgets.css b/app/code/core/Mage/Catalog/view/frontend/widgets.css index 713fade8ced..3a8bf84e037 100644 --- a/app/code/core/Mage/Catalog/view/frontend/widgets.css +++ b/app/code/core/Mage/Catalog/view/frontend/widgets.css @@ -19,7 +19,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/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php index 13a67326b3c..7fa9ef4414d 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 988e1c25e03..6bc28ac2530 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 30ae4b9ba8b..9b31c74fb9e 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 8eb3caa7eeb..92c2b2ce7fe 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 fa27818018b..7764cfa676b 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 a49c1898227..693b75e9f02 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 a03000a891b..32030fc96f2 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 f1f14a1efa9..1b65ed0ef8c 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 de1f66b7f63..e9a6f77a1e6 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) */ diff --git a/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php b/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php index 4f4d34477df..18de40959e1 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 b369a6876ec..e23df7736a0 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) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Observer.php b/app/code/core/Mage/CatalogInventory/Model/Observer.php index fd2a984f9f0..1d646c5134e 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) */ 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 cfd8821ba42..d6ee2e5f823 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) */ 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 c3876e8fc83..53b33ca3bbc 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 2b468586db9..1bb04670cb6 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 dbd0d3d32bc..86a1e1b7f8d 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 8447e16d0d7..47a2bb86df8 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 8a3b33d9806..9eff95199e5 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 53d03f51908..137ced63c98 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 ef93d8b338c..5c1f8704aa7 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 e3a3d28395a..69599965246 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 320d1f4d145..1a960597ed6 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 38532358978..55b7959708d 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 a99862b0ca0..8789df2ab8f 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 3a5b450cfea..6efd72ce0ee 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) */ @@ -269,10 +269,8 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract */ 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')); } /** @@ -304,40 +302,37 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract */ 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('Mage_Customer_Model_Session')->getCustomerGroupId(); + $customerGroupId = $this->getCustomerGroupId(); + if (!$customerGroupId) { + $customerGroupId = Mage::app()->getStore()->isAdmin() + ? Mage_Customer_Model_Group::CUST_GROUP_ALL + : Mage::getSingleton('Mage_Customer_Model_Session')->getCustomerGroupId(); } - if (!array_key_exists($customerGroupId, $this->_minSaleQtyCache)) { - if ($this->getUseConfigMinSaleQty()) { - $minSaleQty = Mage::helper('Mage_CatalogInventory_Helper_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('Mage_CatalogInventory_Helper_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 */ @@ -462,49 +457,41 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract } /** - * 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; + + $maxQty = min($this->getQty() - $this->getMinQty(), $this->getMaxSaleQty()); + $divisibleMax = floor($maxQty / $qtyIncrements) * $qtyIncrements; - // Maybe qty is evenly divided - no fixture needed - if ($qty % $qtyIncrements == 0) { + 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; } /** @@ -523,9 +510,6 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract $result = new Varien_Object(); $result->setHasError(false); - /** @var $_helper Mage_CatalogInventory_Helper_Data */ - $_helper = Mage::helper('Mage_CatalogInventory_Helper_Data'); - if (!is_numeric($qty)) { $qty = Mage::app()->getLocale()->getNumber($qty); } @@ -551,22 +535,22 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract $result->setOrigQty($origQty); } - if ($this->getMinSaleQty() && ($qty) < $this->getMinSaleQty()) { + if ($this->getMinSaleQty() && $qty < $this->getMinSaleQty()) { $result->setHasError(true) ->setMessage( - $_helper->__('The minimum quantity allowed for purchase is %s.', $this->getMinSaleQty() * 1) + Mage::helper('Mage_CatalogInventory_Helper_Data')->__('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('Mage_CatalogInventory_Helper_Data')->__('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( - $_helper->__('The maximum quantity allowed for purchase is %s.', $this->getMaxSaleQty() * 1) + Mage::helper('Mage_CatalogInventory_Helper_Data')->__('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('Mage_CatalogInventory_Helper_Data')->__('Some of the products cannot be ordered in requested quantity.')) ->setQuoteMessageIndex('qty'); return $result; } @@ -583,15 +567,15 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract 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('Mage_CatalogInventory_Helper_Data')->__('This product is currently out of stock.')) + ->setQuoteMessage(Mage::helper('Mage_CatalogInventory_Helper_Data')->__('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('Mage_CatalogInventory_Helper_Data')->__('The requested quantity for "%s" is not available.', $this->getProductName()); $result->setHasError(true) ->setMessage($message) ->setQuoteMessage($message) @@ -621,16 +605,16 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract 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('Mage_CatalogInventory_Helper_Data')->__('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('Mage_CatalogInventory_Helper_Data')->__('"%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('Mage_CatalogInventory_Helper_Data')->__('The requested quantity for "%s" is not available.', $this->getProductName()) ); } } @@ -786,13 +770,14 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract } /** - * Process stock status index on item after save + * Reindex CatalogInventory save event * * @return Mage_CatalogInventory_Model_Stock_Item */ protected function _afterSave() { parent::_afterSave(); + /** @var $indexer Mage_Index_Model_Indexer */ $indexer = Mage::getSingleton('Mage_Index_Model_Indexer'); if ($this->_processIndexEvents) { 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 e18f1704b6e..ef5fd819300 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 849ff337652..f4ecc69e9b9 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 a17abf6dc1a..65f85cfb05c 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 e4c5b0e3c23..74ae128db54 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 b5b6a3092e2..3564060aeb1 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 e4609848a77..86373a28d3a 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 4e9e10ccb1b..e4da40f01f7 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 645bbb1fbf2..cbd45a47d66 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 6f0b4a7724f..846e3d9d679 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) */ --> <config> <modules> <Mage_CatalogInventory> - <version>1.6.0.0</version> + <version>1.6.0.0.1</version> </Mage_CatalogInventory> </modules> <global> @@ -250,6 +250,16 @@ </Mage_CatalogInventory> </modules> </translate> + <events> + <after_reindex_process_cataloginventory_stock> + <observers> + <cataloginventory> + <class>Mage_CatalogInventory_Model_Observer</class> + <method>reindexProductsMassAction</method> + </cataloginventory> + </observers> + </after_reindex_process_cataloginventory_stock> + </events> </adminhtml> <default> <cataloginventory> diff --git a/app/code/core/Mage/CatalogInventory/etc/system.xml b/app/code/core/Mage/CatalogInventory/etc/system.xml index 61e32a1889c..080c5eae382 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) */ --> 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 c64012236d7..117d5423ad7 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-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 00000000000..c7ef341fed1 --- /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 @@ +<?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_CatalogInventory + * @copyright 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_Eav_Model_Entity_Setup */ +$installer = $this; +/** @var $connection Varien_Db_Adapter_Pdo_Mysql */ +$connection = $installer->getConnection(); +$connection->changeTableEngine( + $installer->getTable('cataloginventory_stock_status_tmp'), + Varien_Db_Adapter_Pdo_Mysql::ENGINE_MEMORY +); diff --git a/app/code/core/Mage/CatalogInventory/view/frontend/layout.xml b/app/code/core/Mage/CatalogInventory/view/frontend/layout.xml index 97da2064e94..2905be1db62 100644 --- a/app/code/core/Mage/CatalogInventory/view/frontend/layout.xml +++ b/app/code/core/Mage/CatalogInventory/view/frontend/layout.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/code/core/Mage/CatalogInventory/view/frontend/qtyincrements.phtml b/app/code/core/Mage/CatalogInventory/view/frontend/qtyincrements.phtml index 1934a1f9759..1b56042f7b6 100644 --- a/app/code/core/Mage/CatalogInventory/view/frontend/qtyincrements.phtml +++ b/app/code/core/Mage/CatalogInventory/view/frontend/qtyincrements.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/code/core/Mage/CatalogInventory/view/frontend/stockqty/composite.phtml b/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/composite.phtml index dee5cb1078d..2de516c2640 100644 --- a/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/composite.phtml +++ b/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/composite.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/code/core/Mage/CatalogInventory/view/frontend/stockqty/default.phtml b/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/default.phtml index ba0a3c2d3f8..bf6f4977c4a 100644 --- a/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/default.phtml +++ b/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/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/code/core/Mage/CatalogRule/Helper/Data.php b/app/code/core/Mage/CatalogRule/Helper/Data.php index f3237e51ebe..9521b57dd1a 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/CatalogRule/Model/Observer.php b/app/code/core/Mage/CatalogRule/Model/Observer.php index 06a04d687aa..545d6d85527 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 @@ class Mage_CatalogRule_Model_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,6 +68,7 @@ class Mage_CatalogRule_Model_Observer * Handle cataolg_product_import_after event * * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function applyAllRules($observer) @@ -73,12 +76,15 @@ class Mage_CatalogRule_Model_Observer $resource = Mage::getResourceSingleton('Mage_CatalogRule_Model_Resource_Rule'); $resource->applyAllRulesForDateRange($resource->formatDate(mktime(0,0,0))); Mage::app()->removeCache('catalog_rules_dirty'); + 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 +129,8 @@ class Mage_CatalogRule_Model_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 +165,7 @@ class Mage_CatalogRule_Model_Observer $product->setFinalPrice($finalPrice); } } + return $this; } @@ -164,6 +173,7 @@ class Mage_CatalogRule_Model_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 +188,7 @@ class Mage_CatalogRule_Model_Observer $product->setConfigurablePrice($productPriceRule); } } + return $this; } @@ -188,14 +199,19 @@ class Mage_CatalogRule_Model_Observer * 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('Mage_CatalogRule_Model_Resource_Rule')->applyAllRulesForDateRange(); + return $this; } + /** + * Clean out calculated catalog rule prices for products + */ public function flushPriceCache() { $this->_rulePrices = array(); @@ -215,7 +231,6 @@ class Mage_CatalogRule_Model_Observer $entityId = $observer->getEvent()->getEntityId(); $customerGroupId = $observer->getEvent()->getCustomerGroupId(); $websiteId = $observer->getEvent()->getWebsiteId(); - $websiteDate = $observer->getEvent()->getWebsiteDate(); $updateFields = $observer->getEvent()->getUpdateFields(); @@ -231,6 +246,7 @@ class Mage_CatalogRule_Model_Observer * 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 +279,7 @@ class Mage_CatalogRule_Model_Observer * 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 +289,7 @@ class Mage_CatalogRule_Model_Observer 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 +302,7 @@ class Mage_CatalogRule_Model_Observer * 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 0e131c2ae61..22db5c34607 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 <core@magentocommerce.com> */ -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,43 +66,63 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A } /** - * 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())); - 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)); + 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->hasCustomerGroupIds()) { + $customerGroupIds = $object->getCustomerGroupIds(); + if (!is_array($customerGroupIds)) { + $customerGroupIds = explode(',', (string)$customerGroupIds); } + $this->bindRuleToEntity($object->getId(), $customerGroupIds, 'customer_group'); } - parent::_beforeSave($object); + + $this->updateRuleProductData($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()) { @@ -111,16 +151,15 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A Magento_Profiler::start('__MATCH_PRODUCTS__'); $productIds = $rule->getMatchingProductIds(); Magento_Profiler::stop('__MATCH_PRODUCTS__'); - $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(); - $actionStop = $rule->getStopRulesProcessing(); + $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(); + $actionStop = $rule->getStopRulesProcessing(); $rows = array(); @@ -138,8 +177,8 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A 'action_operator' => $actionOperator, 'action_amount' => $actionAmount, 'action_stop' => $actionStop, - 'sort_order' => $sortOrder, - ); + 'sort_order' => $sortOrder + ); if (count($rows) == 1000) { $write->insertMultiple($this->getTable('catalogrule_product'), $rows); @@ -151,13 +190,12 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A if (!empty($rows)) { $write->insertMultiple($this->getTable('catalogrule_product'), $rows); } - - $write->commit(); } catch (Exception $e) { $write->rollback(); throw $e; } + $write->commit(); return $this; } @@ -165,6 +203,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * Get all product ids matched for rule * * @param int $ruleId + * * @return array */ public function getRuleProductIds($ruleId) @@ -172,6 +211,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A $read = $this->_getReadAdapter(); $select = $read->select()->from($this->getTable('catalogrule_product'), 'product_id') ->where('rule_id=?', $ruleId); + return $read->fetchCol($select); } @@ -181,6 +221,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * @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 +258,9 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A /** * 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 +282,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * @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 +300,8 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A */ $select = $read->select() ->from(array('rp' => $this->getTable('catalogrule_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)) { @@ -306,20 +349,20 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A ); } 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 +378,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * @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) @@ -492,6 +536,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * * @param array $ruleData * @param null|array $productData + * * @return float */ protected function _calcRuleProductPrice($ruleData, $productData = null) @@ -519,6 +564,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * Save rule prices for products to DB * * @param array $arrData + * * @return Mage_CatalogRule_Model_Resource_Rule */ protected function _saveRuleProductPrices($arrData) @@ -527,21 +573,34 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A 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[$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); + } + + foreach ($productIds as $id => $v) { + $adapter->delete($this->getTable('catalogrule_affected_product'), + array("product_id = $id")); + $adapter->insert($this->getTable('catalogrule_affected_product'), + array('product_id' => $id)); + } + + $adapter->insertOnDuplicate($this->getTable('catalogrule_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_product_price'), $arrData); return $this; } @@ -553,7 +612,8 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * @param int $wId * @param int $gId * @param int $pId - * @return float | false + * + * @return float|bool */ public function getRulePrice($date, $wId, $gId, $pId) { @@ -566,13 +626,14 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A } /** - * 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) @@ -619,11 +680,12 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A } /** - * 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 +696,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A ->where('rule_date=?', $this->formatDate($date, false)) ->where('website_id=?', $wId) ->where('product_id=?', $pId); + return $read->fetchAll($select); } @@ -643,6 +706,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * @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 +715,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A return $this; } - $ruleId = $rule->getId(); + $ruleId = $rule->getId(); $productId = $product->getId(); $write = $this->_getWriteAdapter(); @@ -671,15 +735,13 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A } $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(); - $actionStop = $rule->getStopRulesProcessing(); + $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(); $rows = array(); try { @@ -714,6 +776,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A } $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 f0d0dafde4f..1f10d0c1260 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 <core@magentocommerce.com> */ -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('Mage_CatalogRule_Model_Rule', 'Mage_CatalogRule_Model_Resource_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('Mage_CatalogRule_Model_Rule', 'Mage_CatalogRule_Model_Resource_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 165933e8f13..4906ae1acbd 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 cdecd461587..0ba36610d18 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 d218a7432d6..0ec31299f4f 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 <core@magentocommerce.com> */ -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 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule } /** - * 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('Mage_CatalogRule_Model_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('Mage_CatalogRule_Model_Rule_Condition_Combine'); - } - public function getActionsInstance() { return Mage::getModel('Mage_CatalogRule_Model_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('Mage_CatalogRule_Helper_Data')->__("Name: %s", $this->getName()) ."\n" - . Mage::helper('Mage_CatalogRule_Helper_Data')->__("Start at: %s", $this->getStartAt()) ."\n" - . Mage::helper('Mage_CatalogRule_Helper_Data')->__("Expire at: %s", $this->getExpireAt()) ."\n" - . Mage::helper('Mage_CatalogRule_Helper_Data')->__("Customer Registered: %s", $this->getCustomerRegistered()) ."\n" - . Mage::helper('Mage_CatalogRule_Helper_Data')->__("Customer is a New Buyer: %s", $this->getCustomerNewBuyer()) ."\n" - . Mage::helper('Mage_CatalogRule_Helper_Data')->__("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 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule 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('Mage_Catalog_Model_Resource_Product_Collection') - ->addWebsiteFilter($websiteIds); + if ($this->getWebsiteIds()) { + /** @var $productCollection Mage_Catalog_Model_Resource_Product_Collection */ + $productCollection = Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Collection'); + $productCollection->addWebsiteFilter($this->getWebsiteIds()); if ($this->_productsFilter) { $productCollection->addIdFilter($this->_productsFilter); } - $this->getConditions()->collectValidatedAttributes($productCollection); Mage::getSingleton('Mage_Core_Model_Resource_Iterator')->walk( @@ -274,41 +232,21 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule * 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('Mage_Catalog_Model_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('Mage_Customer_Model_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 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule /** * 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) @@ -409,4 +347,75 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule } 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 a1d245bef8b..211d9540928 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 cbfac100fb4..a43538fd9d1 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 4b5c644561a..e7e73be49e3 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 2cdaa08c3f5..e1f9bb2c80b 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('Mage_Eav_Model_Config') - ->getAttribute(Mage_Catalog_Model_Product::ENTITY, $this->getAttribute()); - } - catch (Exception $e) { - $obj = new Varien_Object(); - $obj->setEntity(Mage::getResourceSingleton('Mage_Catalog_Model_Resource_Product')) - ->setFrontendInput('text'); - } - return $obj; - } - - /** - * Add special attributes - * - * @param array $attributes - */ - protected function _addSpecialAttributes(array &$attributes) - { - $attributes['attribute_set_id'] = Mage::helper('Mage_CatalogRule_Helper_Data')->__('Attribute Set'); - $attributes['category_ids'] = Mage::helper('Mage_CatalogRule_Helper_Data')->__('Category'); - } - - /** - * Load attribute options - * - * @return Mage_CatalogRule_Model_Rule_Condition_Product - */ - public function loadAttributeOptions() - { - $productAttributes = Mage::getResourceSingleton('Mage_Catalog_Model_Resource_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('Mage_Eav_Model_Config') - ->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getId(); - $selectOptions = Mage::getResourceModel('Mage_Eav_Model_Resource_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 = '<a href="javascript:void(0)" class="rule-chooser-trigger"><img src="' . $image . '" alt="" class="v-middle rule-chooser-trigger" title="' . Mage::helper('Mage_Rule_Helper_Data')->__('Open Chooser') . '" /></a>'; - } - 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_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('Mage_Adminhtml_Helper_Data')->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 e3ceba57555..fb33573303d 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 0f0659116c4..94b8a61f866 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 b46c1a5bc83..9cf6fd46df0 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) */ --> <config> <modules> <Mage_CatalogRule> - <version>1.6.0.1</version> + <version>1.6.0.2</version> </Mage_CatalogRule> </modules> <global> 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 b0ae7618d3c..3d275f1107e 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/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 4e8bc12a4fe..3b291214c07 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 00000000000..a158896bdb2 --- /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 @@ +<?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_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) + */ + +/* @var $installer Mage_Core_Model_Resource_Setup */ +$installer = $this; +$connection = $installer->getConnection(); + +$rulesTable = $installer->getTable('catalogrule'); +$websitesTable = $installer->getTable('core_website'); +$customerGroupsTable = $installer->getTable('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_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_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_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/CatalogSearch/Block/Advanced/Form.php b/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php index 56053346633..a4c41cf77d5 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 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template 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 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template } } - 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 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template 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 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template return 'string'; } + /** + * Build attribute select element html string + * + * @param $attribute + * @return string + */ public function getAttributeSelectElement($attribute) { $extra = ''; @@ -186,8 +212,6 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template array_unshift($options, array('value'=>'', 'label'=>Mage::helper('Mage_CatalogSearch_Helper_Data')->__('All'))); } - - return $this->_getSelectBlock() ->setName($name) ->setId($attribute->getAttributeCode()) @@ -237,6 +261,7 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template } return $block; } + /** * Retrieve advanced search model object * @@ -247,11 +272,23 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template return Mage::getSingleton('Mage_CatalogSearch_Model_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 d12acf8a7e8..15ab41f4754 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 1f290054729..482362ba402 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 8d8f7a391b1..51e73ae8413 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 9cc0dea12b2..35287c3ecaa 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 9f1a62b5f15..13e6d644c1c 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 8b05508a5ca..ad85c9090c5 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 58a890d6a47..f1b7adde523 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) */ @@ -287,8 +287,9 @@ class Mage_CatalogSearch_Helper_Data extends Mage_Core_Helper_Abstract } $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 + ) { return $this; } @@ -300,14 +301,13 @@ class Mage_CatalogSearch_Helper_Data extends Mage_Core_Helper_Abstract return $this; } - $wordsCut = array_diff($wordsFull, $wordsLike); - $wordsCut = array_map(array($this, 'escapeHtml'), $wordsCut); - $this->addNoteMessage( - $this->__('Maximum words count is %1$s. In your search query was cut next part: %2$s.', - $this->getMaxQueryWords(), - join(' ', $wordsCut) - ) - ); + if (count($wordsFull) > count($wordsLike)) { + $wordsCut = array_diff($wordsFull, $wordsLike); + $wordsCut = array_map(array($this, 'escapeHtml'), $wordsCut); + $this->addNoteMessage( + $this->__('Maximum words count is %1$s. In your search query was cut next part: %2$s.', $this->getMaxQueryWords(), join(' ', $wordsCut)) + ); + } return $this; } diff --git a/app/code/core/Mage/CatalogSearch/Model/Advanced.php b/app/code/core/Mage/CatalogSearch/Model/Advanced.php index 7be303b8d4b..b6801c949dd 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 d954b6efe10..18a4d144608 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) */ @@ -61,8 +61,9 @@ class Mage_CatalogSearch_Model_Fulltext extends Mage_Core_Model_Abstract * (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) @@ -139,11 +140,34 @@ class Mage_CatalogSearch_Model_Fulltext extends Mage_Core_Model_Abstract return Mage::getStoreConfig(self::XML_PATH_CATALOG_SEARCH_TYPE, $storeId); } + + + + + // Deprecated methods + + /** + * Set whether table changes are allowed + * + * @deprecated after 1.6.1.0 + * + * @param bool $value + * @return Mage_CatalogSearch_Model_Fulltext + */ + public function setAllowTableChanges($value = true) + { + $this->_allowTableChanges = $value; + return $this; + } + /** - * Update category'es products indexes + * Update category products indexes + * + * @deprecated after 1.6.2.0 * * @param array $productIds * @param array $categoryIds + * * @return Mage_CatalogSearch_Model_Fulltext */ public function updateCategoryIndex($productIds, $categoryIds) diff --git a/app/code/core/Mage/CatalogSearch/Model/Fulltext/Observer.php b/app/code/core/Mage/CatalogSearch/Model/Fulltext/Observer.php index e7e7dcbf99f..f8ecdcdf54c 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 1842d742d7d..c34f2124f1c 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 623e2c4d8c9..5738780c03f 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 f7ef2f3de1c..6d9b2affd1f 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/Query.php b/app/code/core/Mage/CatalogSearch/Model/Query.php index d37a4fde128..e9f24303acd 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 dc6901efc47..7f416051521 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 e3e270d572c..57fa0fc90b4 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) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php index d05efca0b3d..532ad069287 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) */ @@ -89,22 +89,6 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc 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) * @@ -138,11 +122,11 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc $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')), @@ -153,8 +137,8 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc // status and visibility filter $visibility = $this->_getSearchableAttribute('visibility'); $status = $this->_getSearchableAttribute('status'); - $visibilityVals = Mage::getSingleton('Mage_Catalog_Model_Product_Visibility')->getVisibleInSearchIds(); $statusVals = Mage::getSingleton('Mage_Catalog_Model_Product_Status')->getVisibleStatusIds(); + $allowedVisibilityValues = $this->_engine->getAllowedVisibility(); $lastProductId = 0; while (true) { @@ -168,10 +152,10 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc 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; } } @@ -180,30 +164,17 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc $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; } @@ -211,8 +182,8 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc $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]; } @@ -245,8 +216,10 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc 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_entity')), @@ -254,17 +227,17 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc ) ->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') ); @@ -277,12 +250,9 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc ->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; } /** @@ -313,6 +283,7 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc if ($this->_engine) { $this->_engine->cleanIndex($storeId, $productId); } + return $this; } @@ -361,18 +332,20 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc ->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('Mage_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); } @@ -400,7 +373,7 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc } /** - * Retrieve Searchable attributes + * Retrieve searchable attributes * * @param string $backendType * @return array @@ -410,13 +383,8 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc if (is_null($this->_searchableAttributes)) { $this->_searchableAttributes = array(); - $entityType = $this->getEavConfig()->getEntityType(Mage_Catalog_Model_Product::ENTITY); - $entity = $entityType->getEntity(); + $productAttributeCollection = Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Attribute_Collection'); - $productAttributeCollection = Mage::getResourceModel( - 'Mage_Catalog_Model_Resource_Product_Attribute_Collection' - ) - ->setEntityTypeFilter($entityType->getEntityTypeId()); if ($this->_engine && $this->_engine->allowAdvancedIndex()) { $productAttributeCollection->addToIndexFilter(true); } else { @@ -424,16 +392,27 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc } $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; } } @@ -456,14 +435,14 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc 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); } @@ -587,6 +566,7 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc { $productEmulator = new Varien_Object(); $productEmulator->setIdFieldName('entity_id'); + return $productEmulator; } @@ -623,33 +603,30 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc } } - 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; + $attributeCode = $this->_getSearchableAttribute($attributeId)->getAttributeCode(); + + if (isset($index[$attributeCode])) { + $index[$attributeCode][$entityId] = $value; + } else { + $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'])) { @@ -657,10 +634,6 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc } if ($this->_engine) { - if ($this->_engine->allowAdvancedIndex()) { - $index += $this->_engine->addAllowedAdvancedIndexField($productData); - } - return $this->_engine->prepareEntityIndex($index, $this->_separator); } @@ -678,33 +651,50 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc protected function _getAttributeValue($attributeId, $value, $storeId) { $attribute = $this->_getSearchableAttribute($attributeId); - if (!($attribute->getIsSearchable() || - $attribute->getIsVisibleInAdvancedSearch() || - $attribute->getIsFilterable() || - $attribute->getIsFilterableInSearch())) { - 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; + } + } - 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))); + } elseif ($attribute->getBackendType() == 'datetime') { + $value = $this->_getStoreDate($storeId, $value); + } else { + $inputType = $attribute->getFrontend()->getInputType(); + if ($inputType == 'price') { + $value = Mage::app()->getStore($storeId)->roundPrice($value); + } } - return preg_replace("#\s+#siu", ' ', trim(strip_tags($value))); + return $value; } /** @@ -720,6 +710,7 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc if ($this->_engine) { $this->_engine->saveEntityIndex($productId, $storeId, $index); } + return $this; } @@ -735,6 +726,7 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc if ($this->_engine) { $this->_engine->saveEntityIndexes($storeId, $productIndexes); } + return $this; } @@ -766,4 +758,24 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc return null; } + + + + + + // Deprecated methods + + /** + * 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 945d618fdab..4a0876f1acd 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 24d1c79aa60..ed4f9cef5d9 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 @@ class Mage_CatalogSearch_Model_Resource_Fulltext_Engine extends Mage_Core_Model_ */ 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 @@ class Mage_CatalogSearch_Model_Resource_Fulltext_Engine extends Mage_Core_Model_ return $this; } + /** + * Retrieve allowed visibility values for current engine + * + * @return array + */ + public function getAllowedVisibility() + { + return Mage::getSingleton('Mage_Catalog_Model_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 429a276c776..4659e58315a 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 c30736df4b8..1c76213fdf2 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 2b41954da6f..e4f845c3fbd 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 1508d4993da..2bdfecf81f2 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 c8f3c97dbcd..8fd21589c64 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 618832dae29..c5dffd0d761 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 6112ae20bce..81668bc5ba0 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 37ffcab31ea..0d85f235767 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 67aeaff046f..0999c3cfb31 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 eead9256fc1..d6cf15e0fc1 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 @@ class Mage_CatalogSearch_ResultController extends Mage_Core_Controller_Front_Act $query->setStoreId(Mage::app()->getStore()->getId()); - if ($query->getQueryText()) { + if ($query->getQueryText() != '') { if (Mage::helper('Mage_CatalogSearch_Helper_Data')->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 6fb464f2f42..514a6bb98af 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 14b1beb37e8..e35d35a25a8 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 fa29e4e878e..6b14e58457b 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 3109ed77b54..da257d44b51 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 ef2dfc3965c..aa8ae1236c5 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/view/frontend/advanced/form.phtml b/app/code/core/Mage/CatalogSearch/view/frontend/advanced/form.phtml index 2b72fa63e40..3e8e85abf13 100644 --- a/app/code/core/Mage/CatalogSearch/view/frontend/advanced/form.phtml +++ b/app/code/core/Mage/CatalogSearch/view/frontend/advanced/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) */ ?> @@ -31,6 +31,7 @@ * @see Mage_CatalogSearch_Block_Advanced_Form */ ?> +<?php $maxQueryLength= $this->helper('Mage_CatalogSearch_Helper_Data')->getMaxQueryLength();?> <div class="page-title"> <h1><?php echo $this->__('Catalog Advanced Search') ?></h1> </div> @@ -46,16 +47,16 @@ <?php switch($this->getAttributeInputType($_attribute)): case 'number': ?> <div class="input-range"> - <input type="text" name="<?php echo $_code ?>[from]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'from')) ?>" id="<?php echo $_code ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" /> + <input type="text" name="<?php echo $_code ?>[from]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'from')) ?>" id="<?php echo $_code ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" maxlength="<?php echo $maxQueryLength;?>" /> <span class="separator">-</span> - <input type="text" name="<?php echo $_code ?>[to]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'to')) ?>" id="<?php echo $_code ?>_to" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" /> + <input type="text" name="<?php echo $_code ?>[to]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'to')) ?>" id="<?php echo $_code ?>_to" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" maxlength="<?php echo $maxQueryLength;?>" /> </div> <?php break; case 'price': ?> <div class="input-range"> - <input name="<?php echo $_code ?>[from]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'from')) ?>" id="<?php echo $_code ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" type="text" /> + <input name="<?php echo $_code ?>[from]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'from')) ?>" id="<?php echo $_code ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" type="text" maxlength="<?php echo $maxQueryLength;?>" /> <span class="separator">-</span> - <input name="<?php echo $_code ?>[to]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'to')) ?>" id="<?php echo $_code ?>_to" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" type="text" /> + <input name="<?php echo $_code ?>[to]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'to')) ?>" id="<?php echo $_code ?>_to" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" type="text" maxlength="<?php echo $maxQueryLength;?>" /> <small>(<?php echo $this->getCurrency($_attribute); ?>)</small> </div> <?php break; @@ -76,7 +77,7 @@ <?php break; default: ?> <div class="input-box"> - <input type="text" name="<?php echo $_code ?>" id="<?php echo $_code ?>" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute)) ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text <?php echo $this->getAttributeValidationClass($_attribute) ?>" /> + <input type="text" name="<?php echo $_code ?>" id="<?php echo $_code ?>" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute)) ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text <?php echo $this->getAttributeValidationClass($_attribute) ?>" maxlength="<?php echo $maxQueryLength;?>" /> </div> <?php endswitch; ?> </li> diff --git a/app/code/core/Mage/CatalogSearch/view/frontend/advanced/result.phtml b/app/code/core/Mage/CatalogSearch/view/frontend/advanced/result.phtml index 2c084b73f1a..d8b08028640 100644 --- a/app/code/core/Mage/CatalogSearch/view/frontend/advanced/result.phtml +++ b/app/code/core/Mage/CatalogSearch/view/frontend/advanced/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/code/core/Mage/CatalogSearch/view/frontend/form.mini.phtml b/app/code/core/Mage/CatalogSearch/view/frontend/form.mini.phtml index 7aa1d383f99..55c58d50f70 100644 --- a/app/code/core/Mage/CatalogSearch/view/frontend/form.mini.phtml +++ b/app/code/core/Mage/CatalogSearch/view/frontend/form.mini.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/code/core/Mage/CatalogSearch/view/frontend/layout.xml b/app/code/core/Mage/CatalogSearch/view/frontend/layout.xml index 826b331379e..1eeb6d0f8e4 100644 --- a/app/code/core/Mage/CatalogSearch/view/frontend/layout.xml +++ b/app/code/core/Mage/CatalogSearch/view/frontend/layout.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/code/core/Mage/CatalogSearch/view/frontend/result.phtml b/app/code/core/Mage/CatalogSearch/view/frontend/result.phtml index 99abb41fc10..07edbd99bb8 100644 --- a/app/code/core/Mage/CatalogSearch/view/frontend/result.phtml +++ b/app/code/core/Mage/CatalogSearch/view/frontend/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/code/core/Mage/CatalogSearch/view/frontend/term.phtml b/app/code/core/Mage/CatalogSearch/view/frontend/term.phtml index 3724a06b3af..311edc6efbb 100644 --- a/app/code/core/Mage/CatalogSearch/view/frontend/term.phtml +++ b/app/code/core/Mage/CatalogSearch/view/frontend/term.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/code/core/Mage/Centinel/Block/Adminhtml/Validation.php b/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php index 4979a68fb1b..eff8637bdc7 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 a69802a3240..fd8c93b714b 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 77719079497..593abb84001 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 0304134ac43..df9fac2aec2 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 6d44192db73..56114b7a0fb 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 336015af8d7..4b9ca69a469 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 ae2b58cd1b2..8bdc60494ff 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 09ec79f48cd..4a179ca3808 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 6356deec159..fdd1b36787c 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 d5083110c9a..370b80dccc0 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 e924959694a..ea93cc9b7d7 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 59943acfd48..4096e057872 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 0a81840d91a..45fb5f96778 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 a2a6f5a75ee..b6a586b9e6c 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 e4f2b51a0d1..080235c3405 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 b235b128d31..7da0655174d 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 ba9915431c6..fbd33369be3 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 932fab32dff..e624e05c3eb 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 cccb09ad7fa..42428bcc0a7 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 9b35ddeb7ed..67eec97b25f 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/Centinel/view/adminhtml/authentication/complete.phtml b/app/code/core/Mage/Centinel/view/adminhtml/authentication/complete.phtml index c7eaa698bc2..a1d5041761f 100644 --- a/app/code/core/Mage/Centinel/view/adminhtml/authentication/complete.phtml +++ b/app/code/core/Mage/Centinel/view/adminhtml/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/code/core/Mage/Centinel/view/adminhtml/authentication/start.phtml b/app/code/core/Mage/Centinel/view/adminhtml/authentication/start.phtml index 7d57ed85cb6..11b2d86acf9 100644 --- a/app/code/core/Mage/Centinel/view/adminhtml/authentication/start.phtml +++ b/app/code/core/Mage/Centinel/view/adminhtml/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/code/core/Mage/Centinel/view/adminhtml/layout.xml b/app/code/core/Mage/Centinel/view/adminhtml/layout.xml index 68c49300a3d..905bb6d663b 100644 --- a/app/code/core/Mage/Centinel/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Centinel/view/adminhtml/layout.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/code/core/Mage/Centinel/view/adminhtml/order_create.js b/app/code/core/Mage/Centinel/view/adminhtml/order_create.js index bcd9d4149a6..2af500a1458 100644 --- a/app/code/core/Mage/Centinel/view/adminhtml/order_create.js +++ b/app/code/core/Mage/Centinel/view/adminhtml/order_create.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 centinelValidator = new Class.create(); diff --git a/app/code/core/Mage/Centinel/view/adminhtml/validation/form.phtml b/app/code/core/Mage/Centinel/view/adminhtml/validation/form.phtml index f572a48bf45..afa509dd3fa 100644 --- a/app/code/core/Mage/Centinel/view/adminhtml/validation/form.phtml +++ b/app/code/core/Mage/Centinel/view/adminhtml/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 @@ <iframe frameborder="0" border="0" id="<?php echo $this->getContainerId() ?>" src="" style="display:none;"></iframe> </div> </div> -<button onclick="cardValidator.validate()" class="scalable" type="button"><span><?php echo $this->__('Start/Reset Validation...')?></span></button> +<button onclick="cardValidator.validate()" class="scalable" type="button"><span><span><span><?php echo $this->__('Start/Reset Validation...')?></span></span></span></button> <script type="text/javascript"> //<![CDATA[ cardValidator = new centinelValidator('<?php echo $this->getMethodCode() ?>', '<?php echo $this->getFrameUrl() ?>', '<?php echo $this->getContainerId() ?>'); diff --git a/app/code/core/Mage/Centinel/view/frontend/authentication.phtml b/app/code/core/Mage/Centinel/view/frontend/authentication.phtml index f66a742dbff..7b2bd6b98f3 100644 --- a/app/code/core/Mage/Centinel/view/frontend/authentication.phtml +++ b/app/code/core/Mage/Centinel/view/frontend/authentication.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/code/core/Mage/Centinel/view/frontend/authentication/complete.phtml b/app/code/core/Mage/Centinel/view/frontend/authentication/complete.phtml index 06cabc1dc7a..db7c893b5dd 100644 --- a/app/code/core/Mage/Centinel/view/frontend/authentication/complete.phtml +++ b/app/code/core/Mage/Centinel/view/frontend/authentication/complete.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/code/core/Mage/Centinel/view/frontend/authentication/start.phtml b/app/code/core/Mage/Centinel/view/frontend/authentication/start.phtml index 61621921c0d..99841058508 100644 --- a/app/code/core/Mage/Centinel/view/frontend/authentication/start.phtml +++ b/app/code/core/Mage/Centinel/view/frontend/authentication/start.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/code/core/Mage/Centinel/view/frontend/checkout.js b/app/code/core/Mage/Centinel/view/frontend/checkout.js index 8fcd5802a97..4ad90f2fdbc 100644 --- a/app/code/core/Mage/Centinel/view/frontend/checkout.js +++ b/app/code/core/Mage/Centinel/view/frontend/checkout.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 CentinelAuthenticate = Class.create(); diff --git a/app/code/core/Mage/Centinel/view/frontend/layout.xml b/app/code/core/Mage/Centinel/view/frontend/layout.xml index 895722a79a0..17520b97b19 100644 --- a/app/code/core/Mage/Centinel/view/frontend/layout.xml +++ b/app/code/core/Mage/Centinel/view/frontend/layout.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/code/core/Mage/Centinel/view/frontend/logo.phtml b/app/code/core/Mage/Centinel/view/frontend/logo.phtml index 1f3380574ae..4533d21288d 100644 --- a/app/code/core/Mage/Centinel/view/frontend/logo.phtml +++ b/app/code/core/Mage/Centinel/view/frontend/logo.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/code/core/Mage/Checkout/Block/Agreements.php b/app/code/core/Mage/Checkout/Block/Agreements.php index ca7fb40e880..7fb1e0d35ca 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 b7bbcec70b4..037884f8f6e 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 9199eb52496..8bec7383196 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 917c9c0c704..565421bf36a 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 ba1d85dce22..68dbb1da1f0 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 4fb4fe0eb04..014b1a94d47 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 d23b958e73b..426c7d5063f 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 <core@magentocommerce.com> + * + * @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 { @@ -200,6 +203,9 @@ class Mage_Checkout_Block_Cart_Item_Renderer extends Mage_Core_Block_Template */ public function getProductName() { + if ($this->hasProductName()) { + return $this->getData('product_name'); + } return $this->getProduct()->getName(); } @@ -245,7 +251,10 @@ class Mage_Checkout_Block_Cart_Item_Renderer extends Mage_Core_Block_Template */ public function getDeleteUrl() { - $encodedUrl = $this->helper('Mage_Core_Helper_Url')->getEncodedUrl(); + if ($this->hasDeleteUrl()) { + return $this->getData('delete_url'); + } + return $this->getUrl( 'checkout/cart/delete', array( 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 9b0fde41508..075e730ab95 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 436ccc32e9d..15cfa1299ab 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 2632a84629f..c546a428ff1 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Shipping.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Shipping.php @@ -20,17 +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) */ 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 @@ class Mage_Checkout_Block_Cart_Shipping extends Mage_Checkout_Block_Cart_Abstrac } /** - * Get address model + * Get Address Model * * @return Mage_Sales_Model_Quote_Address */ @@ -53,6 +73,12 @@ class Mage_Checkout_Block_Cart_Shipping extends Mage_Checkout_Block_Cart_Abstrac 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 @@ class Mage_Checkout_Block_Cart_Shipping extends Mage_Checkout_Block_Cart_Abstrac 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('Mage_Tax_Helper_Data')->getShippingPrice( diff --git a/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php b/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php index 36e3904a50e..64062fe8526 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 9e0a7ae40da..2fd095f817d 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 74a297fd80c..33ff38290b9 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 55643932898..30376e67685 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 976aa00d0b8..e1257894ec1 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 68e982767b5..d52e3f538bf 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 ce56952bf7b..770b7e261ee 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 24783172ce6..bae432c8f5b 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 f574bdeb152..ef2db7b371a 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 02829df1190..1539f285208 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 227598603c7..3f63239bf5f 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 d8bb585067d..6dac4136ef2 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 ca2d8f8b5df..d6f0f61597f 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 40b70855f59..fb7acabdcce 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 7df37c495f7..c6eeb4437a5 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) */ @@ -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 7c7d8d0021d..1e33a2ea0c7 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) */ @@ -200,6 +200,17 @@ abstract class Mage_Checkout_Block_Onepage_Abstract extends Mage_Core_Block_Temp 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/Billing.php b/app/code/core/Mage/Checkout/Block/Onepage/Billing.php index 48ecf3abc20..8c5d2e102a1 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 e27246573a4..65600ec3432 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 66c24e04236..608ee1e84d6 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 73c02c72724..44af3f8152f 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 9015ee6b2ae..021a454e076 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 7d17eb336f8..55941718002 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 ecc5b7ecf7f..dda4358eb6b 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 54d648d33e1..f6f7b687257 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) */ @@ -69,6 +69,30 @@ class Mage_Checkout_Block_Onepage_Progress extends Mage_Checkout_Block_Onepage_A 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/Block/Onepage/Review.php b/app/code/core/Mage/Checkout/Block/Onepage/Review.php index 4c54a036b80..1c01cd32ebc 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 7fe200040fe..5ebe7ae8f5e 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 5f3be145df9..e54fa416b4d 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 8248ebd70bf..f08b6a289db 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 f72c20bea11..a1743fa5ecf 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 1d33eed05c0..61f24ae6225 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 9c552ca7c95..57a30825a43 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 0971299b282..1470638cfba 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 3046ab9cd2a..8bcf56fae2d 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 fe45674214c..35d085e5983 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 a24afc68f58..96ad047255f 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 29e4713cea4..244a8f298c5 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 e0109ff8146..478bc5c97c6 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 09c45b4d953..98827b7c4aa 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 80e090b53d9..896b8565664 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) */ diff --git a/app/code/core/Mage/Checkout/Helper/Url.php b/app/code/core/Mage/Checkout/Helper/Url.php index a85d45fc1e1..0499e68a423 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 6886c1575ee..2ad7d68cc8b 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 14a4680f24e..60a11a254e8 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 6c342e73e6c..1280cad5e69 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 ef20a7af59d..da8d6b6379d 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 ac6887a4a1d..bb5d4502602 100644 --- a/app/code/core/Mage/Checkout/Model/Cart.php +++ b/app/code/core/Mage/Checkout/Model/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) */ @@ -31,7 +31,7 @@ * @package Mage_Checkout * @author Magento Core Team <core@magentocommerce.com> */ -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; @@ -55,7 +55,7 @@ class Mage_Checkout_Model_Cart extends Varien_Object } /** - * Retrieve custome session model + * Retrieve customer session model * * @return Mage_Customer_Model_Customer */ @@ -103,6 +103,18 @@ class Mage_Checkout_Model_Cart extends Varien_Object 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 */ @@ -430,17 +442,29 @@ class Mage_Checkout_Model_Cart extends Varien_Object $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) + * + * @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/Cart/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Api.php index f5003315323..dd9cd975ac1 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 74b3e829eba..e2a2f62a20f 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 6aad5b9051f..07bc847013f 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 979e5216197..2e4d0632bb9 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 13555c3bb7b..3cefdbb84c2 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 d53eccf02fd..9c017453701 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 00000000000..12950afa9f0 --- /dev/null +++ b/app/code/core/Mage/Checkout/Model/Cart/Interface.php @@ -0,0 +1,69 @@ +<?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_Checkout + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Shopping cart interface + * + * @category Mage + * @package Mage_Checkout + * @author Magento Core Team <core@magentocommerce.com> + */ + +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 3d336f72dc7..cd27f9e8866 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 b2bc69e6bc9..535d0656435 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 b5b970cec13..a2afb1c1ab3 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) */ 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 f3868150185..691211f6d97 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 a9126b458e8..a1d6a828af3 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 e3c5a55628e..8b715950190 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 e00440b14eb..658a86b573f 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/Observer.php b/app/code/core/Mage/Checkout/Model/Observer.php index 83d647a87a0..649fadc4c63 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 a4405d36103..0e365acb211 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 30d3d373006..3142f129a8b 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 7690b6ff241..8162dc9dd29 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 d7f39115bdb..90502145299 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 e38fa852c98..1609f94dd29 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 @@ class Mage_Checkout_Model_Session extends Mage_Core_Model_Session_Abstract /** * 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 @@ class Mage_Checkout_Model_Session extends Mage_Core_Model_Session_Abstract */ public function hasQuote() { - return !(is_null($this->_quote)); + return isset($this->_quote); } /** @@ -105,10 +111,8 @@ class Mage_Checkout_Model_Session extends Mage_Core_Model_Session_Abstract Mage::dispatchEvent('custom_quote_process', array('checkout_session' => $this)); if ($this->_quote === null) { - $quote = Mage::getModel('Mage_Sales_Model_Quote') - ->setStoreId(Mage::app()->getStore()->getId()); - /** @var $quote Mage_Sales_Model_Quote */ + $quote = Mage::getModel('Mage_Sales_Model_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 396501f2336..42c2663cc26 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 ed197df6342..c40ae2f8dd3 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) */ @@ -460,33 +460,32 @@ class Mage_Checkout_Model_Type_Multishipping extends Mage_Checkout_Model_Type_Ab */ protected function _validate() { - $helper = Mage::helper('Mage_Checkout_Helper_Data'); $quote = $this->getQuote(); if (!$quote->getIsMultiShipping()) { - Mage::throwException($helper->__('Invalid checkout type.')); + Mage::throwException(Mage::helper('Mage_Checkout_Helper_Data')->__('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('Mage_Checkout_Helper_Data')->__('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('Mage_Checkout_Helper_Data')->__('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('Mage_Checkout_Helper_Data')->__('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('Mage_Checkout_Helper_Data')->__('Please check billing address information.')); } return $this; } 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 29972ad3f94..4892ed577d7 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 4710a0083e3..32cd4d3cacb 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) */ @@ -70,7 +70,7 @@ class Mage_Checkout_Model_Type_Onepage public function __construct() { $this->_helper = Mage::helper('Mage_Checkout_Helper_Data'); - $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('Mage_Checkout_Helper_Data')->__('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('Mage_Checkout_Model_Session'); $this->_customerSession = Mage::getSingleton('Mage_Customer_Model_Session'); } @@ -102,6 +102,7 @@ class Mage_Checkout_Model_Type_Onepage * 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 @@ class Mage_Checkout_Model_Type_Onepage } /* - * 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(); @@ -177,7 +178,7 @@ class Mage_Checkout_Model_Type_Onepage } /** - * Specify chceckout method + * Specify checkout method * * @param string $method * @return array @@ -185,7 +186,7 @@ class Mage_Checkout_Model_Type_Onepage public function saveCheckoutMethod($method) { if (empty($method)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); + return array('error' => -1, 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid data.')); } $this->getQuote()->setCheckoutMethod($method)->save(); @@ -220,7 +221,7 @@ class Mage_Checkout_Model_Type_Onepage public function saveBilling($data, $customerAddressId) { if (empty($data)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); + return array('error' => -1, 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid data.')); } $address = $this->getQuote()->getBillingAddress(); @@ -235,7 +236,7 @@ class Mage_Checkout_Model_Type_Onepage if ($customerAddress->getId()) { if ($customerAddress->getCustomerId() != $this->getQuote()->getCustomerId()) { return array('error' => 1, - 'message' => $this->_helper->__('Customer Address is not valid.') + 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Customer Address is not valid.') ); } @@ -261,7 +262,7 @@ class Mage_Checkout_Model_Type_Onepage $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); } @@ -289,7 +290,7 @@ class Mage_Checkout_Model_Type_Onepage */ $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); @@ -300,11 +301,14 @@ class Mage_Checkout_Model_Type_Onepage $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); } } @@ -343,8 +347,8 @@ class Mage_Checkout_Model_Type_Onepage */ protected function _validateCustomerData(array $data) { - /* @var $customerForm Mage_Customer_Model_Form */ - $customerForm = Mage::getModel('Mage_Customer_Model_Form'); + /** @var $customerForm Mage_Customer_Model_Form */ + $customerForm = Mage::getModel('Mage_Customer_Model_Form'); $customerForm->setFormCode('checkout_register') ->setIsAjaxRequest(Mage::app()->getRequest()->isAjax()); @@ -380,10 +384,13 @@ class Mage_Checkout_Model_Type_Onepage $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(); @@ -418,7 +425,7 @@ class Mage_Checkout_Model_Type_Onepage public function saveShipping($data, $customerAddressId) { if (empty($data)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); + return array('error' => -1, 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid data.')); } $address = $this->getQuote()->getShippingAddress(); @@ -433,7 +440,7 @@ class Mage_Checkout_Model_Type_Onepage if ($customerAddress->getId()) { if ($customerAddress->getCustomerId() != $this->getQuote()->getCustomerId()) { return array('error' => 1, - 'message' => $this->_helper->__('Customer Address is not valid.') + 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Customer Address is not valid.') ); } @@ -460,6 +467,7 @@ class Mage_Checkout_Model_Type_Onepage } } + $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); @@ -490,11 +498,11 @@ class Mage_Checkout_Model_Type_Onepage public function saveShippingMethod($shippingMethod) { if (empty($shippingMethod)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid shipping method.')); + return array('error' => -1, 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('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('Mage_Checkout_Helper_Data')->__('Invalid shipping method.')); } $this->getQuote()->getShippingAddress() ->setShippingMethod($shippingMethod); @@ -515,7 +523,7 @@ class Mage_Checkout_Model_Type_Onepage public function savePayment($data) { if (empty($data)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); + return array('error' => -1, 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid data.')); } $quote = $this->getQuote(); if ($quote->isVirtual()) { @@ -546,16 +554,15 @@ class Mage_Checkout_Model_Type_Onepage */ public function validate() { - $helper = Mage::helper('Mage_Checkout_Helper_Data'); $quote = $this->getQuote(); if ($quote->getIsMultiShipping()) { - Mage::throwException($helper->__('Invalid checkout type.')); + Mage::throwException(Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid checkout type.')); } if ($quote->getCheckoutMethod() == self::METHOD_GUEST && !Mage::helper('Mage_Checkout_Helper_Data')->isAllowedGuestCheckout($quote) ) { - Mage::throwException($this->_helper->__('Sorry, guest checkout is not enabled. Please try again or contact store owner.')); + Mage::throwException(Mage::helper('Mage_Checkout_Helper_Data')->__('Sorry, guest checkout is not enabled. Please try again or contact store owner.')); } } diff --git a/app/code/core/Mage/Checkout/controllers/CartController.php b/app/code/core/Mage/Checkout/controllers/CartController.php index d499b754682..1e9d64cf14a 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 @@ class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action { $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 @@ class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action $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('Mage_Checkout_Helper_Data')->__('Minimum order amount is %s', $minimumAmount); + $cart->getCheckoutSession()->addNotice($warning); } } @@ -368,9 +376,30 @@ class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action } /** - * 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 +428,21 @@ class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action $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.')); + } } /** diff --git a/app/code/core/Mage/Checkout/controllers/IndexController.php b/app/code/core/Mage/Checkout/controllers/IndexController.php index 6a5ff01a8d4..19ee4ae45ea 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 e5fb2e8c10a..30e74c65a61 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 @@ class Mage_Checkout_Multishipping_AddressController extends Mage_Core_Controller 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 dac2a21e4c2..beddd7fd7e1 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 85fc2a4f207..2c436e9f7ac 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 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action $layout->generateXml(); $layout->generateBlocks(); $output = $layout->getOutput(); + Mage::getSingleton('Mage_Core_Model_Translate_Inline')->processResponseBody($output); return $output; } @@ -167,7 +171,10 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action 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('Mage_Checkout_Helper_Data')->__('Subtotal must exceed minimum order amount'); + Mage::getSingleton('Mage_Checkout_Model_Session')->addError($error); $this->_redirect('checkout/cart'); return; @@ -442,9 +449,6 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action $this->getResponse()->setBody(Mage::helper('Mage_Core_Helper_Data')->jsonEncode($result)); } - /* @var $_order Mage_Sales_Model_Order */ - protected $_order; - /** * Get Order by quoteId * @@ -506,21 +510,6 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action } $this->getOnepage()->saveOrder(); - $storeId = Mage::app()->getStore()->getId(); - $paymentHelper = Mage::helper("Mage_Payment_Helper_Data"); - $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('Mage_Core_Model_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 362ea605569..78e1cd654b4 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 0520c4fe063..7faa6b25416 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 a3d5e383652..86399de8b57 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/fieldset.xml b/app/code/core/Mage/Checkout/etc/fieldset.xml index cf4292d1970..6f659735956 100644 --- a/app/code/core/Mage/Checkout/etc/fieldset.xml +++ b/app/code/core/Mage/Checkout/etc/fieldset.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/system.xml b/app/code/core/Mage/Checkout/etc/system.xml index f830c0d4807..5a4fd7da5e2 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/etc/translater.xml b/app/code/core/Mage/Checkout/etc/translater.xml new file mode 100644 index 00000000000..fb4f010a267 --- /dev/null +++ b/app/code/core/Mage/Checkout/etc/translater.xml @@ -0,0 +1,46 @@ +<?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_Checkout + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<translater> + <!-- opcheckout.js --> + <validate-guest translate="message" module="Mage_Checkout"> + <message>Please choose to register or to checkout as a guest</message> + </validate-guest> + <validate-shipping-methods-not-available translate="message" module="Mage_Checkout"> + <message>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.</message> + </validate-shipping-methods-not-available> + <validate-shipping-methods-required translate="message" module="Mage_Checkout"> + <message>Please specify shipping method.</message> + </validate-shipping-methods-required> + <validate-payment-methods-not-available translate="message" module="Mage_Checkout"> + <message>Your order cannot be completed at this time as there is no payment methods available for it.</message> + </validate-payment-methods-not-available> + <validate-shipping-methods-required translate="message" module="Mage_Checkout"> + <message>Please specify payment method.</message> + </validate-shipping-methods-required> + <!-- end opcheckout.js --> +</translater> 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 9b47aeb7364..58e0f51ceee 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/view/frontend/cart.phtml b/app/code/core/Mage/Checkout/view/frontend/cart.phtml index 12073bd4c6f..cb66d815158 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart.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) */ ?> @@ -99,7 +99,8 @@ <?php if($this->getContinueShoppingUrl()): ?> <button type="button" title="<?php echo $this->__('Continue Shopping') ?>" class="button btn-continue" onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button> <?php endif; ?> - <button type="submit" title="<?php echo $this->__('Update Shopping Cart') ?>" class="button btn-update"><span><span><?php echo $this->__('Update Shopping Cart') ?></span></span></button> + <button type="submit" name="update_cart_action" value="empty_cart" title="<?php echo $this->__('Clear Shopping Cart'); ?>" class="button btn-update"><span><span><?php echo $this->__('Clear Shopping Cart'); ?></span></span></button> + <button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update Shopping Cart'); ?>" class="button btn-update" style="margin-left: 5px;"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span></button> </td> </tr> </tfoot> diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/coupon.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/coupon.phtml index da21c9d8b27..09019de43b5 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/coupon.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/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/code/core/Mage/Checkout/view/frontend/cart/crosssell.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/crosssell.phtml index 1d999135a6e..117f2e83653 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/crosssell.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/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/code/core/Mage/Checkout/view/frontend/cart/item/configure/updatecart.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/item/configure/updatecart.phtml index a3b673736af..8f587723afc 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/item/configure/updatecart.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/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/code/core/Mage/Checkout/view/frontend/cart/item/default.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/item/default.phtml index 2a8c88a9cec..f3b538d7129 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/item/default.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/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,7 +62,8 @@ $canApplyMsrp = Mage::helper('Mage_Catalog_Helper_Data')->canApplyMsrp($_item->g <p class="item-msg <?php echo $message['type'] ?>">* <?php echo $message['text'] ?></p> <?php endforeach; ?> <?php endif; ?> - <?php if ($addtInfoBlock = $this->getProductAdditionalInformationBlock()):?> + <?php $addtInfoBlock = $this->getProductAdditionalInformationBlock(); ?> + <?php if ($addtInfoBlock): ?> <?php echo $addtInfoBlock->setItem($_item)->toHtml() ?> <?php endif;?> </td> diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/noItems.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/noItems.phtml index f8f4ad1c4d5..a250788582e 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/noItems.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/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 @@ </div> <div class="cart-empty"> <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> + <?php echo $this->getChildHtml('checkout_cart_empty_widget'); ?> <p><?php echo $this->__('You have no items in your shopping cart.') ?></p> <p><?php echo $this->__('Click <a href="%s">here</a> to continue shopping.', $this->getContinueShoppingUrl()) ?></p> + <?php echo $this->getChildHtml('shopping.cart.table.after'); ?> </div> diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/shipping.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/shipping.phtml index fb93862b838..5a779e9e96f 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/shipping.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/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) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/sidebar.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/sidebar.phtml index de1403608ae..da9a649fa06 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/sidebar.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/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/code/core/Mage/Checkout/view/frontend/cart/sidebar/default.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/sidebar/default.phtml index f435989d080..2d15961765c 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/sidebar/default.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/sidebar/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/code/core/Mage/Checkout/view/frontend/cart/totals.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/totals.phtml index 408c7729e84..08aaa97076a 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/totals.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/totals.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/code/core/Mage/Checkout/view/frontend/layout.xml b/app/code/core/Mage/Checkout/view/frontend/layout.xml index 0326fa3eb18..dd0e7f4545b 100644 --- a/app/code/core/Mage/Checkout/view/frontend/layout.xml +++ b/app/code/core/Mage/Checkout/view/frontend/layout.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/code/core/Mage/Checkout/view/frontend/multishipping/address/select.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/address/select.phtml index f6839df645d..76dce4488e1 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/address/select.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/address/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/code/core/Mage/Checkout/view/frontend/multishipping/addresses.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/addresses.phtml index 4ea35347aca..616ec8afd5f 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/addresses.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/addresses.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/code/core/Mage/Checkout/view/frontend/multishipping/agreements.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/agreements.phtml index 9025997feb3..3adf879495f 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/agreements.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/agreements.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/code/core/Mage/Checkout/view/frontend/multishipping/billing.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/billing.phtml index 6b8bde37ee2..49b5bf84e26 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/billing.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/billing.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/code/core/Mage/Checkout/view/frontend/multishipping/billing/items.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/billing/items.phtml index fa6fa53596e..13cc5b55bbd 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/billing/items.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/billing/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) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/item/default.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/item/default.phtml index 043d9f1cc61..a8832190076 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/item/default.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/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) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/link.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/link.phtml index 23038960e34..bae988d37ef 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/link.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/link.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/code/core/Mage/Checkout/view/frontend/multishipping/overview.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/overview.phtml index 776d715f25e..d7da0ab266b 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/overview.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/overview.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/code/core/Mage/Checkout/view/frontend/multishipping/overview/item.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/overview/item.phtml index a185dd8e431..a3a4ddd3f0b 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/overview/item.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/overview/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/code/core/Mage/Checkout/view/frontend/multishipping/payment.js b/app/code/core/Mage/Checkout/view/frontend/multishipping/payment.js index bb00820bc91..64f40723508 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/payment.js +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/payment.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 paymentForm = Class.create(); diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/shipping.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/shipping.phtml index 626f3b7d7e7..84ec7188c4b 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/shipping.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/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) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/state.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/state.phtml index a4bd5b908c4..cc9dc142de0 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/state.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/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) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/success.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/success.phtml index 871e850e16d..69dc9c2b020 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/success.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/success.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/code/core/Mage/Checkout/view/frontend/onepage.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage.phtml index 69728a038df..d8a6eddc50a 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage.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/code/core/Mage/Checkout/view/frontend/onepage/accordion.js b/app/code/core/Mage/Checkout/view/frontend/onepage/accordion.js index 2c653c1fdac..b979dbc7b42 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/accordion.js +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/accordion.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ Accordion = Class.create(); diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/agreements.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/agreements.phtml index 0e47b802ee6..877819eb11e 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/agreements.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/agreements.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/code/core/Mage/Checkout/view/frontend/onepage/billing.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/billing.phtml index ad9c3944a28..751277fc7a2 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/billing.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/billing.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) */ ?> @@ -69,6 +69,12 @@ </div> </li> <?php endfor ?> + <li class="wide"> + <label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label> + <div class="input-box"> + <input type="text" id="billing:vat_id" name="billing[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text" /> + </div> + </li> <li class="fields"> <div class="field"> <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label> @@ -167,6 +173,7 @@ <?php else:?> <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li> <?php endif; ?> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> </fieldset> </li> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/failure.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/failure.phtml index d39c6629138..d222fd1fb72 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/failure.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/failure.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/code/core/Mage/Checkout/view/frontend/onepage/link.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/link.phtml index e600392c2dc..433981d60a7 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/link.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/link.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/code/core/Mage/Checkout/view/frontend/onepage/login.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/login.phtml index 87a6f453c79..abd259f8473 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/login.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/login.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) */ ?> @@ -79,6 +79,7 @@ <input type="password" class="input-text required-entry" id="login-password" name="login[password]" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> </fieldset> </form> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/payment.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/payment.phtml index 133963a6bc2..94e51a966ef 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/payment.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/payment.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/code/core/Mage/Checkout/view/frontend/onepage/payment/methods.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/payment/methods.phtml index 733df800739..eb8f2ac2cf9 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/payment/methods.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/payment/methods.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/code/core/Mage/Checkout/view/frontend/onepage/progress.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/progress.phtml index 30fc86d915f..60d5a71e65b 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/progress.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/progress.phtml @@ -20,9 +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) */ +/* @var $this Mage_Checkout_Block_Onepage_Progress */ ?> <div class="block block-progress opc-block-progress"> <div class="block-title"> @@ -31,9 +32,10 @@ <div class="block-content"> <dl> <?php if ($this->getCheckout()->getStepData('billing', 'is_show')): ?> - <?php if($this->getCheckout()->getStepData('billing', 'complete')): ?> + <?php if ($this->isStepComplete('billing')): ?> <dt class="complete"> - <?php echo $this->__('Billing Address') ?> <span class="separator">|</span> <a href="#billing" onclick="checkout.accordion.openSection('opc-billing'); return false;"><?php echo $this->__('Change') ?></a> + <?php echo $this->__('Billing Address') ?> <span class="separator">|</span> + <a href="#billing" onclick="checkout.gotoSection('billing'); return false;"><?php echo $this->__('Change') ?></a> </dt> <dd class="complete"> <address><?php echo $this->getBilling()->format('html') ?></address> @@ -46,9 +48,10 @@ <?php endif; ?> <?php if ($this->getCheckout()->getStepData('shipping', 'is_show')): ?> - <?php if($this->getCheckout()->getStepData('shipping', 'complete')): ?> + <?php if ($this->isStepComplete('shipping')): ?> <dt class="complete"> - <?php echo $this->__('Shipping Address') ?> <span class="separator">|</span> <a href="#payment" onclick="checkout.accordion.openSection('opc-shipping');return false;"><?php echo $this->__('Change') ?></a> + <?php echo $this->__('Shipping Address') ?> <span class="separator">|</span> + <a href="#payment" onclick="checkout.gotoSection('shipping');return false;"><?php echo $this->__('Change') ?></a> </dt> <dd class="complete"> <address><?php echo $this->getShipping()->format('html') ?></address> @@ -61,9 +64,10 @@ <?php endif; ?> <?php if ($this->getCheckout()->getStepData('shipping_method', 'is_show')): ?> - <?php if($this->getCheckout()->getStepData('shipping_method', 'complete')): ?> + <?php if ($this->isStepComplete('shipping_method')): ?> <dt class="complete"> - <?php echo $this->__('Shipping Method') ?> <span class="separator">|</span> <a href="#shipping_method" onclick="checkout.accordion.openSection('opc-shipping_method'); return false;"><?php echo $this->__('Change') ?></a> + <?php echo $this->__('Shipping Method') ?> <span class="separator">|</span> + <a href="#shipping_method" onclick="checkout.gotoSection('shipping_method'); return false;"><?php echo $this->__('Change') ?></a> </dt> <dd class="complete"> <?php if ($this->getShippingMethod()): ?> @@ -92,9 +96,10 @@ <?php endif; ?> <?php if ($this->getCheckout()->getStepData('payment', 'is_show')): ?> - <?php if($this->getCheckout()->getStepData('payment', 'complete')): ?> + <?php if ($this->isStepComplete('payment')): ?> <dt class="complete"> - <?php echo $this->__('Payment Method') ?> <span class="separator">|</span> <a href="#payment" onclick="checkout.accordion.openSection('opc-payment'); return false;"><?php echo $this->__('Change') ?></a> + <?php echo $this->__('Payment Method') ?> <span class="separator">|</span> + <a href="#payment" onclick="checkout.gotoSection('payment'); return false;"><?php echo $this->__('Change') ?></a> </dt> <dd class="complete"> <?php echo $this->getPaymentHtml() ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/review.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/review.phtml index 3e552f77a8c..a3576c5544a 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/review.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/review.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/code/core/Mage/Checkout/view/frontend/onepage/review/button.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/review/button.phtml index 03c38a29485..25ab8746452 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/review/button.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/review/button.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/code/core/Mage/Checkout/view/frontend/onepage/review/info.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/review/info.phtml index 372f0ab299a..4ed6474be9d 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/review/info.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/review/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/code/core/Mage/Checkout/view/frontend/onepage/review/item.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/review/item.phtml index b4f58355fec..2769e48c3b6 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/review/item.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/review/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/code/core/Mage/Checkout/view/frontend/onepage/review/totals.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/review/totals.phtml index 33a0d547a5e..645e82dc303 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/review/totals.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/review/totals.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/code/core/Mage/Checkout/view/frontend/onepage/shipping.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping.phtml index ab6e75e79f3..8c1e116ab94 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/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) */ ?> @@ -68,6 +68,12 @@ </div> </li> <?php endfor ?> + <li class="wide"> + <label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label> + <div class="input-box"> + <input type="text" id="shipping:vat_id" name="shipping[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()); ?>" title="<?php echo $this->__('VAT Number'); ?>" class="input-text" /> + </div> + </li> <li class="fields"> <div class="field"> <label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method.phtml index 0418308d1be..cbaaa6a0899 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method.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/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/additional.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/additional.phtml index 16d4ee0b92c..337b33deec0 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/additional.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/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/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/available.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/available.phtml index e40dd339e85..436d9dbc3df 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/available.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/available.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/code/core/Mage/Checkout/view/frontend/opcheckout.js b/app/code/core/Mage/Checkout/view/frontend/opcheckout.js index ae83e7e2b5e..d792a8cda8a 100644 --- a/app/code/core/Mage/Checkout/view/frontend/opcheckout.js +++ b/app/code/core/Mage/Checkout/view/frontend/opcheckout.js @@ -19,7 +19,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 Checkout = Class.create(); @@ -38,17 +38,37 @@ Checkout.prototype = { this.loadWaiting = false; this.steps = ['login', 'billing', 'shipping', 'shipping_method', 'payment', 'review']; - //this.onSetMethod = this.nextStep.bindAsEventListener(this); + this.accordion.sections.each(function(section) { + Event.observe($(section).down('.step-title'), 'click', this._onSectionClick.bindAsEventListener(this)); + }.bind(this)); this.accordion.disallowAccessToNextSections = true; }, + /** + * Section header click handler + * + * @param event + */ + _onSectionClick: function(event) { + var section = $(Event.element(event).up().up()); + if (section.hasClassName('allow')) { + Event.stop(event); + this.gotoSection(section.readAttribute('id').replace('opc-', '')); + return false; + } + }, + ajaxFailure: function(){ location.href = this.failureUrl; }, - reloadProgressBlock: function(){ - var updater = new Ajax.Updater('checkout-progress-wrapper', this.progressUrl, {method: 'get', onFailure: this.ajaxFailure.bind(this)}); + reloadProgressBlock: function(toStep) { + var updater = new Ajax.Updater('checkout-progress-wrapper', this.progressUrl, { + method: 'get', + onFailure: this.ajaxFailure.bind(this), + parameters: toStep ? {toStep: toStep} : null + }); }, reloadReviewBlock: function(){ @@ -90,9 +110,10 @@ Checkout.prototype = { gotoSection: function(section) { - section = $('opc-'+section); - section.addClassName('allow'); - this.accordion.openSection(section); + var sectionElement = $('opc-'+section); + sectionElement.addClassName('allow'); + this.accordion.openSection('opc-'+section); + this.reloadProgressBlock(section); }, setMethod: function(){ @@ -118,6 +139,7 @@ Checkout.prototype = { alert(Translator.translate('Please choose to register or to checkout as a guest')); return false; } + document.body.fire('login:setMethod', {method : this.method}); }, setBilling: function() { @@ -134,7 +156,6 @@ Checkout.prototype = { } // this refreshes the checkout progress column - this.reloadProgressBlock(); // if ($('billing:use_for_shipping') && $('billing:use_for_shipping').checked){ // shipping.syncWithBilling(); @@ -151,21 +172,18 @@ Checkout.prototype = { }, setShipping: function() { - this.reloadProgressBlock(); //this.nextStep(); this.gotoSection('shipping_method'); //this.accordion.openNextSection(true); }, setShippingMethod: function() { - this.reloadProgressBlock(); //this.nextStep(); this.gotoSection('payment'); //this.accordion.openNextSection(true); }, setPayment: function() { - this.reloadProgressBlock(); //this.nextStep(); this.gotoSection('review'); //this.accordion.openNextSection(true); @@ -198,7 +216,6 @@ Checkout.prototype = { } if (response.goto_section) { - this.reloadProgressBlock(); this.gotoSection(response.goto_section); return true; } @@ -308,6 +325,7 @@ Billing.prototype = { resetLoadWaiting: function(transport){ checkout.setLoadWaiting(false); + document.body.fire('billing-request:completed', {transport: transport}); }, /** @@ -877,7 +895,6 @@ Review.prototype = { if (response.goto_section) { checkout.gotoSection(response.goto_section); - checkout.reloadProgressBlock(); } } }, diff --git a/app/code/core/Mage/Checkout/view/frontend/success.phtml b/app/code/core/Mage/Checkout/view/frontend/success.phtml index c34f4bebf65..bc9ddce297b 100644 --- a/app/code/core/Mage/Checkout/view/frontend/success.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/success.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/code/core/Mage/Checkout/view/frontend/total/default.phtml b/app/code/core/Mage/Checkout/view/frontend/total/default.phtml index d5a397b0cb2..14a47172a4e 100644 --- a/app/code/core/Mage/Checkout/view/frontend/total/default.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/total/default.phtml @@ -20,14 +20,14 @@ * * @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) */ ?> <tr> <th colspan="<?php echo $this->getColspan(); ?>" style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right"> <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><strong><?php endif; ?> - <?php echo $this->getTotal()->getTitle() ?> + <?php echo $this->escapeHtml($this->getTotal()->getTitle()); ?> <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?></strong><?php endif; ?> </th> <td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right"> diff --git a/app/code/core/Mage/Checkout/view/frontend/total/nominal.phtml b/app/code/core/Mage/Checkout/view/frontend/total/nominal.phtml index 721a1dfd1a0..2f6387f85be 100644 --- a/app/code/core/Mage/Checkout/view/frontend/total/nominal.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/total/nominal.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/code/core/Mage/Checkout/view/frontend/total/tax.phtml b/app/code/core/Mage/Checkout/view/frontend/total/tax.phtml index 21f954487c6..5a4c01e8291 100644 --- a/app/code/core/Mage/Checkout/view/frontend/total/tax.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/total/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) */ ?> diff --git a/app/code/core/Mage/Cms/Block/Block.php b/app/code/core/Mage/Cms/Block/Block.php index 7abc07bfd8b..5b495d26643 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 f446f51e98d..7b768cdf36b 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 @@ class Mage_Cms_Block_Page extends Mage_Core_Block_Abstract $helper = Mage::helper('Mage_Cms_Helper_Data'); $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 af8793f7fb0..7758942576b 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 80693ef6f84..30e0107c53c 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 d7a73ec0f6a..81698acabca 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 ac81ca9d545..1cc961b9c13 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 58866639ec5..5cb46256381 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) */ @@ -120,10 +120,13 @@ class Mage_Cms_Helper_Page extends Mage_Core_Helper_Abstract ->applyTemplate($page->getRootTemplate()); } - foreach (array('Mage_Catalog_Model_Session', 'Mage_Checkout_Model_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('Mage_Catalog_Model_Session', 'Mage_Checkout_Model_Session', 'Mage_Customer_Model_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 31c1bd13abc..bd56420960e 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 e325879f233..9fec681fec9 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/Observer.php b/app/code/core/Mage/Cms/Model/Observer.php index f9dd49f4a45..c3c19c7fbaa 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 9cf9a0b9964..8dab6fcf054 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 c5c4dca637d..51e135031fe 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) */ 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 eba1ff9da7d..9c57f16b39d 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 cedbb288653..3d38d8db22e 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 ff4a9f436c3..5ae5edb3f38 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 3e15d79562a..35ed0caec3a 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 fd007a6dde0..5afef1756fd 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 9a8296cc873..3b2d5fa4fe4 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 748348b86ca..47f4034be23 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 55dd63109cd..52ac19a20d8 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 db1d6250d5c..764725eed58 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 bb1819aa8bb..2451979eeb3 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 b7fa099f8b8..1dcb908372d 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/etc/adminhtml.xml b/app/code/core/Mage/Cms/etc/adminhtml.xml index 9cf677a5c4f..8f2220b415d 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 f55b784e63b..431d8766863 100644 --- a/app/code/core/Mage/Cms/etc/config.xml +++ b/app/code/core/Mage/Cms/etc/config.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/system.xml b/app/code/core/Mage/Cms/etc/system.xml index 12147c3922d..031262c0304 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 49affaa11b5..4ad894955ac 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 6ae7703ed4e..bdcf84626be 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/view/frontend/content.phtml b/app/code/core/Mage/Cms/view/frontend/content.phtml index 522a62d4c93..ed722f90307 100644 --- a/app/code/core/Mage/Cms/view/frontend/content.phtml +++ b/app/code/core/Mage/Cms/view/frontend/content.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/code/core/Mage/Cms/view/frontend/content_heading.phtml b/app/code/core/Mage/Cms/view/frontend/content_heading.phtml index 080c36e6169..194ae9533d8 100644 --- a/app/code/core/Mage/Cms/view/frontend/content_heading.phtml +++ b/app/code/core/Mage/Cms/view/frontend/content_heading.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/code/core/Mage/Cms/view/frontend/default/home.phtml b/app/code/core/Mage/Cms/view/frontend/default/home.phtml index f9b37de6e29..d87c9c3452a 100644 --- a/app/code/core/Mage/Cms/view/frontend/default/home.phtml +++ b/app/code/core/Mage/Cms/view/frontend/default/home.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/code/core/Mage/Cms/view/frontend/default/no-route.phtml b/app/code/core/Mage/Cms/view/frontend/default/no-route.phtml index c79e2fdd009..7db45a376f6 100644 --- a/app/code/core/Mage/Cms/view/frontend/default/no-route.phtml +++ b/app/code/core/Mage/Cms/view/frontend/default/no-route.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/code/core/Mage/Cms/view/frontend/layout.xml b/app/code/core/Mage/Cms/view/frontend/layout.xml index 52e28b76474..8ccd42c0924 100644 --- a/app/code/core/Mage/Cms/view/frontend/layout.xml +++ b/app/code/core/Mage/Cms/view/frontend/layout.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/code/core/Mage/Cms/view/frontend/meta.phtml b/app/code/core/Mage/Cms/view/frontend/meta.phtml index 6f130a84f4a..ebfb8296212 100644 --- a/app/code/core/Mage/Cms/view/frontend/meta.phtml +++ b/app/code/core/Mage/Cms/view/frontend/meta.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/code/core/Mage/Cms/view/frontend/widget/link/link_block.phtml b/app/code/core/Mage/Cms/view/frontend/widget/link/link_block.phtml index 509a150c15f..db3fa85e86d 100644 --- a/app/code/core/Mage/Cms/view/frontend/widget/link/link_block.phtml +++ b/app/code/core/Mage/Cms/view/frontend/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/code/core/Mage/Cms/view/frontend/widget/link/link_inline.phtml b/app/code/core/Mage/Cms/view/frontend/widget/link/link_inline.phtml index 228ec997823..01f7bdca080 100644 --- a/app/code/core/Mage/Cms/view/frontend/widget/link/link_inline.phtml +++ b/app/code/core/Mage/Cms/view/frontend/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/code/core/Mage/Cms/view/frontend/widget/static_block/default.phtml b/app/code/core/Mage/Cms/view/frontend/widget/static_block/default.phtml index 331b1b49667..89c12362c6a 100644 --- a/app/code/core/Mage/Cms/view/frontend/widget/static_block/default.phtml +++ b/app/code/core/Mage/Cms/view/frontend/widget/static_block/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/code/core/Mage/Cms/view/frontend/widgets.css b/app/code/core/Mage/Cms/view/frontend/widgets.css index 3c13fd75797..c21bc5ea889 100644 --- a/app/code/core/Mage/Cms/view/frontend/widgets.css +++ b/app/code/core/Mage/Cms/view/frontend/widgets.css @@ -19,7 +19,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/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php index 5344aa5c9db..5bccbde5d71 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 0e796385ca3..a05c44e988e 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 640bfb5add3..486a869adaa 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) */ @@ -148,7 +148,7 @@ abstract class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract */ public function getTabLabel() { - return Mage::helper('Mage_Connect_Helper_Data')->__(''); + return ''; } /** @@ -158,7 +158,7 @@ abstract class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract */ public function getTabTitle() { - return Mage::helper('Mage_Connect_Helper_Data')->__(''); + return ''; } public function canShowTab() @@ -170,4 +170,4 @@ abstract class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract { return false; } -} +} \ No newline at end of file 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 a75ad1f66b0..c4c3e256858 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 8c337936692..43114314ba8 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 fb380e93bb4..36669a17ece 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 30f593ebb54..d9298e791db 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 3e25084ee11..aa8091a1159 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 f0e69a35249..1cbfeb823d6 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 c9928db6213..1a7f32b0b5a 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 de42bf2b83f..4455bb6f6ef 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 6b0b1836b15..7d49b657697 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 f39d8ab3157..f03545d2afb 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 8c18c21fdb1..43da0aeff14 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 235742cc71d..c1c69948274 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 2c6d094c3a7..dcdfc687322 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 13798ac6d23..ed9140052d9 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 50ae9e8154c..9c38e0bf7bd 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 73992519f51..c969d6f53c6 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 2336fd747cf..1fd7edc0676 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/Connect/view/adminhtml/extension/custom/authors.phtml b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/authors.phtml index 11b5fe2d1fc..cfa36da364a 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/authors.phtml +++ b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/authors.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/code/core/Mage/Connect/view/adminhtml/extension/custom/contents.phtml b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/contents.phtml index ac696f372f0..6cd5ff19eca 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/contents.phtml +++ b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/contents.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/code/core/Mage/Connect/view/adminhtml/extension/custom/depends.phtml b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/depends.phtml index e2a90dbd2c0..aeff6e7d7b9 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/depends.phtml +++ b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/depends.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/code/core/Mage/Connect/view/adminhtml/extension/custom/load.phtml b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/load.phtml index 075106f6df4..ba4d46aa84f 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/load.phtml +++ b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/load.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/code/core/Mage/Connect/view/adminhtml/extension/custom/package.phtml b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/package.phtml index eb1a12800cf..334657e4b01 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/package.phtml +++ b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/package.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/code/core/Mage/Connect/view/adminhtml/extension/custom/release.phtml b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/release.phtml index fbc08a27e97..8622603c0c9 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/release.phtml +++ b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/release.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/code/core/Mage/Connect/view/adminhtml/layout.xml b/app/code/core/Mage/Connect/view/adminhtml/layout.xml index bc462124b22..c15baeb25e7 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Connect/view/adminhtml/layout.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/code/core/Mage/Contacts/Helper/Data.php b/app/code/core/Mage/Contacts/Helper/Data.php index ae94345fb20..36f8a442b08 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 0cfd7d6885c..b4a5bb95317 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 d7234d7cbef..7e2b5978d93 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 e11c3ad0afe..5b6b5b41974 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 0f7188cfd7e..bc06a998a30 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 552a499933c..704dfe39389 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 2061c930428..787d4399000 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/view/frontend/form.phtml b/app/code/core/Mage/Contacts/view/frontend/form.phtml index 56ba8691d74..077b4d0283d 100644 --- a/app/code/core/Mage/Contacts/view/frontend/form.phtml +++ b/app/code/core/Mage/Contacts/view/frontend/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/code/core/Mage/Contacts/view/frontend/layout.xml b/app/code/core/Mage/Contacts/view/frontend/layout.xml index cefe1fa1be8..6d6d5073f8a 100644 --- a/app/code/core/Mage/Contacts/view/frontend/layout.xml +++ b/app/code/core/Mage/Contacts/view/frontend/layout.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/code/core/Mage/Core/Block/Abstract.php b/app/code/core/Mage/Core/Block/Abstract.php index 6938e1a62ae..a86fae89842 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) */ diff --git a/app/code/core/Mage/Core/Block/Flush.php b/app/code/core/Mage/Core/Block/Flush.php index 85a61346d84..3b936a2157b 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 bd912c61cb4..0b07f84e024 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 672dd0c1493..a782a05b0fc 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 1bd0c45ad5f..6da9e2828d7 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 5e57f5a3376..d848348fcaa 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 a6e4a112065..25889f1e7b0 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/Store/Switcher.php b/app/code/core/Mage/Core/Block/Store/Switcher.php index e87daf3afc0..d2390703771 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 3385ed97f3f..7c66af87330 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 edb432b2113..62a5f3ff45a 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 e79f94abac1..25ad728896f 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 01caa23d399..ee24aa8ff6a 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 2d54b827f02..3f96583db50 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 77e5ccdd25b..47f8c1c2888 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 6923b8aee2e..2c511542a0b 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 e2691218830..e019907f7a7 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/Controller/Front/Action.php b/app/code/core/Mage/Core/Controller/Front/Action.php index 918810b364b..6d3043ca2a4 100644 --- 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) */ @@ -48,7 +48,7 @@ class Mage_Core_Controller_Front_Action extends Mage_Core_Controller_Varien_Acti protected $_sessionNamespace = 'frontend'; /** - * Predispatch: shoud set layout area + * Predispatch: should set layout area * * @return Mage_Core_Controller_Front_Action */ diff --git a/app/code/core/Mage/Core/Controller/Front/Router.php b/app/code/core/Mage/Core/Controller/Front/Router.php index a47551b1a45..8625f59269b 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 b77dd7beb6a..346aacc495d 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 0add0659593..7b0c7a64412 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) */ diff --git a/app/code/core/Mage/Core/Controller/Varien/Action.php b/app/code/core/Mage/Core/Controller/Varien/Action.php index d1ba4040dfa..e772dbeb048 100644 --- 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) */ @@ -1083,9 +1083,9 @@ abstract class Mage_Core_Controller_Varien_Action ->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) { diff --git a/app/code/core/Mage/Core/Controller/Varien/Exception.php b/app/code/core/Mage/Core/Controller/Varien/Exception.php index 958e5e7d1b9..db2e35317ab 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 a9a19f97823..87f41660c7b 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) */ 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 0a87c469f06..3d305c09f93 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 b052fd835f7..46456ec9b50 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 25aa09b8ab2..e2eb1973434 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 722d897380c..1a1bfca4577 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) */ diff --git a/app/code/core/Mage/Core/Exception.php b/app/code/core/Mage/Core/Exception.php index 4d63eb30ed3..92d66ac5931 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 index dbb9205de51..1e8cc108455 100644 --- 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) */ @@ -218,6 +218,19 @@ abstract class Mage_Core_Helper_Abstract 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 * @@ -262,6 +275,22 @@ abstract class Mage_Core_Helper_Abstract 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 * @@ -300,7 +329,7 @@ abstract class Mage_Core_Helper_Abstract * base64_encode() for URLs encoding * * @param string $url - * @return string + * @return string */ public function urlEncode($url) { @@ -311,7 +340,7 @@ abstract class Mage_Core_Helper_Abstract * base64_dencode() for URLs dencoding * * @param string $url - * @return string + * @return string */ public function urlDecode($url) { @@ -323,7 +352,7 @@ abstract class Mage_Core_Helper_Abstract * 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 f7576547105..d6bd6941b08 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) */ @@ -48,6 +48,13 @@ class Mage_Core_Helper_Data extends Mage_Core_Helper_Abstract 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 */ @@ -527,12 +534,12 @@ class Mage_Core_Helper_Data extends Mage_Core_Helper_Abstract * @param array $array * @param string $rootName * @return SimpleXMLElement - * @throws Exception + * @throws Magento_Exception */ public function assocToXml(array $array, $rootName = '_') { if (empty($rootName) || is_numeric($rootName)) { - throw new Exception('Root element must not be empty or numeric'); + throw new Magento_Exception('Root element must not be empty or numeric'); } $xmlstr = <<<XML @@ -542,7 +549,7 @@ XML; $xml = new SimpleXMLElement($xmlstr); foreach ($array as $key => $value) { if (is_numeric($key)) { - throw new Exception('Array root keys must not be numeric.'); + throw new Magento_Exception('Array root keys must not be numeric.'); } } return self::_assocToXml($array, $rootName, $xml); @@ -555,7 +562,7 @@ XML; * @param string $rootName * @param SimpleXMLElement $xml * @return SimpleXMLElement - * @throws Exception + * @throws Magento_Exception */ private function _assocToXml(array $array, $rootName, SimpleXMLElement &$xml) { @@ -565,7 +572,7 @@ XML; if (!is_array($value)) { if (is_string($key)) { if ($key === $rootName) { - throw new Exception('Associative key must not be the same as its parent associative key.'); + throw new Magento_Exception('Associative key must not be the same as its parent associative key.'); } $hasStringKey = true; $xml->$key = $value; @@ -580,7 +587,7 @@ XML; } } if ($hasNumericKey && $hasStringKey) { - throw new Exception('Associative and numeric keys must not be mixed at one level.'); + throw new Magento_Exception('Associative and numeric keys must not be mixed at one level.'); } return $xml; } @@ -720,4 +727,39 @@ XML; $value = (string) Mage::getConfig()->getNode($path); return (bool) $value; } + + /** + * Retrieve merchant country code + * + * @param Mage_Core_Model_Store|string|int|null $store + * @return string + */ + public function getMerchantCountryCode($store = null) + { + 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($store = null) + { + return (string) Mage::getStoreConfig(self::XML_PATH_MERCHANT_VAT_NUMBER, $store); + } + + /** + * 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/File/Storage.php b/app/code/core/Mage/Core/Helper/File/Storage.php index 35e2e10744e..51d25e0fc38 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 a29ae7d8a9f..23819fe2bb3 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 00000000000..19afeeb5674 --- /dev/null +++ b/app/code/core/Mage/Core/Helper/Hint.php @@ -0,0 +1,80 @@ +<?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_Core + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Core hint helper + * + * @category Mage + * @package Mage_Core + * @author Magento Core Team <core@magentocommerce.com> + */ +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 fcbbeb242dd..7efcc5c6d5b 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 2a3ed3bfbc2..5e416ea93c1 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 = 'translater.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 * @@ -88,102 +105,16 @@ class Mage_Core_Helper_Js extends Mage_Core_Helper_Abstract */ 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(); + + foreach ($this->_getXmlConfig()->getXpath('*/message') as $message) { + $messageText = (string)$message; + $module = $message->getParent()->getAttribute("module"); + $this->_translateData[$messageText] = Mage::helper(empty($module) ? 'Mage_Core' : $module)->__($messageText); + } + + foreach ($this->_translateData as $key => $value) { if ($key == $value) { unset($this->_translateData[$key]); } @@ -192,4 +123,30 @@ class Mage_Core_Helper_Js extends Mage_Core_Helper_Abstract 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('<?xml version="1.0"?><translater></translater>'); + 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 6e9d49b529c..12991d905ae 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 @@ class Mage_Core_Helper_String extends Mage_Core_Helper_Abstract 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 @@ class Mage_Core_Helper_String extends Mage_Core_Helper_Abstract */ 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 @@ class Mage_Core_Helper_String extends Mage_Core_Helper_Abstract 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 09cd98ce71d..c57d4fb1a4c 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 @@ class Mage_Core_Helper_Translate extends Mage_Core_Helper_Abstract 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 811b5c49cb2..2fd8608a134 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 aab104c1361..4974cca38b0 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 f6b367fd143..2b000d5f42e 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 223c656445c..eeea0d0b7a4 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'; @@ -438,7 +443,8 @@ class Mage_Core_Model_App 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 36bfb5fa71e..4f05b88474d 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 db7f32e6607..702af84dbe5 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 a3673b69e57..882420fa1bf 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 @@ class Mage_Core_Model_Cache } 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 new file mode 100644 index 00000000000..cd5ba6f86f9 --- /dev/null +++ b/app/code/core/Mage/Core/Model/Calculator.php @@ -0,0 +1,87 @@ +<?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_Core + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Calculations model + * + * @category Mage + * @package Mage_Core + * @author Magento Core Team <core@magentocommerce.com> + */ +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 f22f07cabbc..0d2a07d524b 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) */ @@ -865,9 +865,7 @@ class Mage_Core_Model_Config extends Mage_Core_Model_Config_Base foreach ($moduleProp['depends'] as $dependModule => $true) { if (!isset($definedModules[$dependModule])) { Mage::throwException( - Mage::helper('Mage_Core_Helper_Data')->__( - 'Module "%1$s" cannot depend on "%2$s".', $moduleProp['module'], $dependModule - ) + Mage::helper('Mage_Core_Helper_Data')->__('Module "%1$s" cannot depend on "%2$s".', $moduleProp['module'], $dependModule) ); } } diff --git a/app/code/core/Mage/Core/Model/Config/Base.php b/app/code/core/Mage/Core/Model/Config/Base.php index a7a9c1cd013..bde7a6803b2 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 333ca643eb2..c4809e1d1b1 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 cc94a046fd8..336bcbf5725 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/Fieldset.php b/app/code/core/Mage/Core/Model/Config/Fieldset.php index dfc76cbe685..a18a1e73314 100644 --- a/app/code/core/Mage/Core/Model/Config/Fieldset.php +++ b/app/code/core/Mage/Core/Model/Config/Fieldset.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 80a9eb8a603..e4526d7a8bc 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 de76295e98c..31ed4824d85 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 2ad4ae1c4ed..c23b22cd7c1 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 e949ef9267a..4f82c30fa14 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) */ @@ -198,6 +198,7 @@ class Mage_Core_Model_Cookie * @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/Date.php b/app/code/core/Mage/Core/Model/Date.php index 31924eede6d..9edb4618eca 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) */ diff --git a/app/code/core/Mage/Core/Model/Design.php b/app/code/core/Mage/Core/Model/Design.php index 6f48f811505..a2180364056 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) */ diff --git a/app/code/core/Mage/Core/Model/Design/Backend/Exceptions.php b/app/code/core/Mage/Core/Model/Design/Backend/Exceptions.php index 416dcc3293f..436d2e422b0 100644 --- a/app/code/core/Mage/Core/Model/Design/Backend/Exceptions.php +++ b/app/code/core/Mage/Core/Model/Design/Backend/Exceptions.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/Backend/Theme.php b/app/code/core/Mage/Core/Model/Design/Backend/Theme.php index dd98063bab1..5a62301c186 100644 --- a/app/code/core/Mage/Core/Model/Design/Backend/Theme.php +++ b/app/code/core/Mage/Core/Model/Design/Backend/Theme.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/Package.php b/app/code/core/Mage/Core/Model/Design/Package.php index c0b94d759bc..2db16af1342 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) */ @@ -342,16 +342,17 @@ class Mage_Core_Model_Design_Package * @param string $file * @param array &$params * @return string + * @throws Magento_Exception */ protected function _extractScope($file, array &$params) { if (preg_match('/\.\//', str_replace('\\', '/', $file))) { - throw new Exception("File name '{$file}' is forbidden for security reasons."); + throw new Magento_Exception("File name '{$file}' is forbidden for security reasons."); } if (false !== strpos($file, self::SCOPE_SEPARATOR)) { $file = explode(self::SCOPE_SEPARATOR, $file); if (empty($file[0])) { - throw new Exception('Scope separator "::" can\'n be used without scope identifier.'); + throw new Magento_Exception('Scope separator "::" cannot be used without scope identifier.'); } $params['_module'] = $file[0]; $file = $file[1]; @@ -419,9 +420,11 @@ class Mage_Core_Model_Design_Package } /** - * Design package (optional) themes list getter - * @param string $package - * @return string + * Retrieve the list of themes available in the system. + * Results are grouped by packages themes belong to, if the optional 'package' argument is omitted. + * + * @param string|null $package + * @return array */ public function getThemeList($package = null) { @@ -575,7 +578,7 @@ class Mage_Core_Model_Design_Package * @param string $file * @param bool|null $isSecure * @return string - * @throws Exception + * @throws Magento_Exception */ protected function _getPublicFileUrl($file, $isSecure = null) { @@ -593,7 +596,9 @@ class Mage_Core_Model_Design_Package $url = Mage::getBaseUrl($publicUrlType, $isSecure) . $url; return $url; } - throw new Exception("Cannot build URL for the file '$file' because it does not reside in a public directory."); + throw new Magento_Exception( + "Cannot build URL for the file '$file' because it does not reside in a public directory." + ); } /** @@ -654,6 +659,7 @@ class Mage_Core_Model_Design_Package * @param string $skinFile * @param array $params * @return string + * @throws Magento_Exception */ protected function _publishSkinFile($skinFile, $params) { @@ -661,7 +667,7 @@ class Mage_Core_Model_Design_Package $file = $this->getSkinFile($skinFile, $params); if (!file_exists($file)) { - throw new Exception("Unable to locate skin file: '{$file}'"); + throw new Magento_Exception("Unable to locate skin file '{$file}'."); } if (!$this->_needToPublishFile($file)) { @@ -851,7 +857,7 @@ class Mage_Core_Model_Design_Package * * @param string $filename * @param bool $isRelative flag that identify that filename is relative - * @throw Exception if file can't be canonized + * @throws Magento_Exception if file can't be canonized * @return string|false */ protected function _canonize($filename, $isRelative = false) @@ -872,7 +878,7 @@ class Mage_Core_Model_Design_Package foreach ($parts as $part) { if ('..' === $part) { if (null === array_pop($result)) { - throw new Exception('Invalid file: '.$filename); + throw new Magento_Exception("Invalid file '{$filename}'."); } } elseif ('.' !== $part) { $result[] = $part; @@ -886,7 +892,7 @@ class Mage_Core_Model_Design_Package * * @param array $files list of names relative to the same folder * @param string $contentType - * @throw Exception exception will be triggered if not existing file requested for merge + * @throws Magento_Exception if not existing file requested for merge * @return string */ protected function _mergeFiles($files, $contentType) @@ -920,7 +926,7 @@ class Mage_Core_Model_Design_Package $result = array(); foreach ($filesToMerge as $file) { if (!file_exists($file)) { - throw new Exception("Merging failed: unable to locate file '{$file}'"); + throw new Magento_Exception("Unable to locate file '{$file}' for merging."); } $content = file_get_contents($file); if ($contentType == self::CONTENT_TYPE_CSS) { @@ -941,7 +947,7 @@ class Mage_Core_Model_Design_Package /** * Replace relative URLs in the CSS content with ones shifted by the directories offset * - * @throws Exception + * @throws Magento_Exception * @param string $cssContent * @param string $relativeOffset * @return string @@ -951,7 +957,9 @@ class Mage_Core_Model_Design_Package $relativeUrls = $this->_extractCssRelativeUrls($cssContent); foreach ($relativeUrls as $urlNotation => $fileUrl) { if (strpos($fileUrl, self::SCOPE_SEPARATOR)) { - throw new Exception('URL offset cannot be applied to CSS content that contains scope separator.'); + throw new Magento_Exception( + 'URL offset cannot be applied to CSS content that contains scope separator.' + ); } $fileUrlNew = $this->_canonize($relativeOffset . '/' . $fileUrl, true); $urlNotationNew = str_replace($fileUrl, $fileUrlNew, $urlNotation); @@ -971,7 +979,7 @@ class Mage_Core_Model_Design_Package * pub/skin/frontend/default/default/skin/default/style.css -> img/empty.gif * pub/skin/_merged/hash.css -> ../frontend/default/default/skin/default/img/empty.gif * - * @throws Exception + * @throws Magento_Exception * @param string $originalFile path to original file * @param string $relocationDir path to directory where content will be relocated * @return string @@ -980,7 +988,7 @@ class Mage_Core_Model_Design_Package { $publicDir = Mage::getBaseDir(); if (strpos($originalFile, $publicDir) !== 0 || strpos($relocationDir, $publicDir) !== 0) { - throw new Exception('Offset can be calculated for public resources only.'); + throw new Magento_Exception('Offset can be calculated for public resources only.'); } $offset = ''; while ($relocationDir != $publicDir && strpos($originalFile, $relocationDir) !== 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 f7012900fea..070fe75b5b0 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 75a8fe29b9d..00b71fd40c4 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 6f05ee4e47a..3daa151a217 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 c47c3e5442e..5ba293b0e82 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) */ 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 fe0dc93646b..dd1e77414dc 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 b2b0cca31f7..82fad31852f 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 02b6ea5eaa7..08ff648a607 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 958709610f6..f5a1bc6adfa 100755 --- 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 e5ac7a85780..5618da54859 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 3ec5b25823e..05af0133832 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 218de09ba52..d2c337fa687 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 f4cc067af29..b0d130b5681 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 3175dad922d..38c21979b65 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 044435a91fd..af91ec03675 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 8dbbca1cd5c..e9418815f64 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 63ee0d5712a..1c2d858acea 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 f044d61798d..2baba972db4 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 9095169d711..d691ba611a4 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) */ @@ -67,11 +67,8 @@ class Mage_Core_Model_File_Validator_NotProtectedExtension extends Zend_Validate protected function _initMessageTemplates() { if (!$this->_messageTemplates) { - /** @var $helper Mage_Core_Helper_Data */ - $helper = Mage::helper('Mage_Core_Helper_Data'); $this->_messageTemplates = array( - self::PROTECTED_EXTENSION => - $helper->__('File with an extension "%value%" is protected and cannot be uploaded'), + self::PROTECTED_EXTENSION => Mage::helper('Mage_Core_Helper_Data')->__('File with an extension "%value%" is protected and cannot be uploaded'), ); } return $this; diff --git a/app/code/core/Mage/Core/Model/Flag.php b/app/code/core/Mage/Core/Model/Flag.php index b33b88b43e0..d20c3093eaa 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 d170299d87f..808a4db7939 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/Layout.php b/app/code/core/Mage/Core/Model/Layout.php index 1286ae09b8a..43f1b33c205 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) */ @@ -406,7 +406,7 @@ class Mage_Core_Model_Layout extends Varien_Simplexml_Config * 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 4e2ab8e3486..923a9f53958 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 cb8de940e80..d9c727ab7bf 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 6333f49a06d..8edf38f82d2 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) */ @@ -203,13 +203,14 @@ class Mage_Core_Model_Layout_Update * * @param array|string $handles * @return Mage_Core_Model_Layout_Update + * @throws Magento_Exception */ public function load($handles=array()) { if (is_string($handles)) { $handles = array($handles); } elseif (!is_array($handles)) { - throw Mage::exception('Mage_Core', Mage::helper('Mage_Core_Helper_Data')->__('Invalid layout update handle')); + throw new Magento_Exception('Invalid layout update handle'); } foreach ($handles as $handle) { @@ -259,7 +260,9 @@ class Mage_Core_Model_Layout_Update $storeId = Mage::app()->getStore()->getId(); $elementClass = $this->getElementClass(); $design = Mage::getSingleton('Mage_Core_Model_Design_Package'); - $cacheKey = 'LAYOUT_'.$design->getArea().'_STORE'.$storeId.'_'.$design->getPackageName().'_'.$design->getTheme(); + $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); @@ -356,20 +359,27 @@ class Mage_Core_Model_Layout_Update public function fetchDbLayoutUpdates($handle) { - $_profilerKey = 'layout_db_update:' . $handle; + $_profilerKey = 'layout_db_update: '.$handle; Magento_Profiler::start($_profilerKey); - $updateStr = Mage::getResourceModel('Mage_Core_Model_Resource_Layout')->fetchUpdatesByHandle($handle); - if ($updateStr) { - $updateStr = '<update_xml>' . $updateStr . '</update_xml>'; - $updateStr = str_replace($this->_subst['from'], $this->_subst['to'], $updateStr); - $updateXml = simplexml_load_string($updateStr, $this->getElementClass()); - $this->fetchRecursiveUpdates($updateXml); - $this->addUpdate($updateXml->innerXml()); + $updateStr = $this->_getUpdateString($handle); + if (!$updateStr) { + return false; } Magento_Profiler::stop($_profilerKey); return (bool)$updateStr; } + /** + * Get update string + * + * @param string $handle + * @return mixed + */ + protected function _getUpdateString($handle) + { + return Mage::getResourceModel('Mage_Core_Model_Resource_Layout')->fetchUpdatesByHandle($handle); + } + public function fetchRecursiveUpdates($updateXml) { foreach ($updateXml->children() as $child) { @@ -390,6 +400,7 @@ class Mage_Core_Model_Layout_Update * @param string $theme * @param integer|null $storeId * @return Mage_Core_Model_Layout_Element + * @throws Magento_Exception */ public function getFileLayoutUpdatesXml($area, $package, $theme, $storeId = null) { @@ -419,7 +430,9 @@ class Mage_Core_Model_Layout_Update $module = $updateNode->getAttribute('module'); if (!$module) { $updateNodePath = $area . '/layout/updates/' . $updateNode->getName(); - throw new Exception("Layout update instruction '{$updateNodePath}' must specify the module."); + throw new Magento_Exception( + "Layout update instruction '{$updateNodePath}' must specify the module." + ); } if ($module && Mage::getStoreConfigFlag('advanced/modules_disable_output/' . $module, $storeId)) { continue; @@ -430,7 +443,7 @@ class Mage_Core_Model_Layout_Update $layoutParams + array('_module' => $module) ); if (!is_readable($filename)) { - throw new Exception("Layout update file '{$filename}' doesn't exist or isn't readable."); + throw new Magento_Exception("Layout update file '{$filename}' doesn't exist or isn't readable."); } $updateFiles[] = $filename; } diff --git a/app/code/core/Mage/Core/Model/Locale.php b/app/code/core/Mage/Core/Model/Locale.php index b44d99f131f..39738d875d9 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) */ @@ -412,6 +412,18 @@ class Mage_Core_Model_Locale 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 * diff --git a/app/code/core/Mage/Core/Model/Locale/Config.php b/app/code/core/Mage/Core/Model/Locale/Config.php index 195303562f2..56ee499b81e 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 cb562d04b7c..599b53aeb95 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 67bc773d0f5..6597b1d9660 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 ff4d3d5f0db..ad581ae4787 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) */ diff --git a/app/code/core/Mage/Core/Model/Message/Collection.php b/app/code/core/Mage/Core/Model/Message/Collection.php index 93dcd7975c9..898900f7dbb 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 f339a5bdd68..ea618749130 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 e0c4333b2e7..527c5305715 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 bf51fdf5b17..16b1039cbdc 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 ad44e90528d..ef1ac3c1f04 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/Observer.php b/app/code/core/Mage/Core/Model/Observer.php index e55d25fa732..9ccfe39cad4 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) */ diff --git a/app/code/core/Mage/Core/Model/Resource.php b/app/code/core/Mage/Core/Model/Resource.php index bd5920f71b3..0f0254cfa09 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 21aacc295ff..a1420239b77 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 2daf17c5741..13a55db9352 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 1f1c1d2af07..bd74683cd2f 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 48f5f81fed8..90633c7ae4f 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 a8f48daa2e4..af987416477 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 fa7792cc088..c03da80b0c7 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) */ 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 5c4def357b1..8f60118e3a5 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 ca93cc537c2..d6f85d69ebb 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 aa5ef134153..58f5e4ecb3d 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/Email/Template.php b/app/code/core/Mage/Core/Model/Resource/Email/Template.php index 8a7261ca8df..22a32c07c9e 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 d71665cf772..626868e3224 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 2d582e2b959..fb99b53096e 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 68380e149e0..12923593fec 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 6d0079a666e..12477905d2b 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 a2e83e4870a..8c670c6a1c7 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 435e9e6ac1d..e5f9caf179b 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 de66f3317d1..4cdb9ae572a 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 db019208dd2..f4563930712 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 3114e3b636f..8a81ea90a7d 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 3c97725b6d9..d1738d51f95 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 f056858832c..1c23cca00bc 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/Layout.php b/app/code/core/Mage/Core/Model/Resource/Layout.php index 9eb58cb407e..d48bef3210e 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 61d515b1f39..6357835bbf9 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 6f4cdbc5113..139638a02de 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 0022d6fe37f..ad1cac97480 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 594c84470bd..72632af12a2 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 5764bd8edd7..0621ae1be1d 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 ac453de5a7a..f046ab681ed 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 248e508451b..d498774b5cf 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 28934608186..9d26576d41c 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) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Transaction.php b/app/code/core/Mage/Core/Model/Resource/Transaction.php index 5fed71dc03e..e6ae97ecfa2 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 0771a66ef15..c992017854f 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 1736b8a6fb1..3dd252f900a 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 fbf1a9142b9..870f73865b7 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 67f3430c87d..6ebb2af660f 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 7f8f28625ce..e9f4f27e00d 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 ea0444c3fe8..50e165d90fc 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 3b905f2ec51..32e99cb1a07 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 ffec56e6497..1678109121c 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) */ @@ -147,6 +147,9 @@ class Mage_Core_Model_Resource_Url_Rewrite extends Mage_Core_Model_Resource_Db_A $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/Url/Rewrite/Collection.php b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php index 830ce0beb27..81798575f37 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 07e7b19b596..cdb3a5f9700 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) */ @@ -136,10 +136,9 @@ class Mage_Core_Model_Resource_Variable extends Mage_Core_Model_Resource_Db_Abst */ 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 @@ class Mage_Core_Model_Resource_Variable extends Mage_Core_Model_Resource_Db_Abst 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, @@ -158,4 +157,4 @@ class Mage_Core_Model_Resource_Variable extends Mage_Core_Model_Resource_Db_Abst return $this; } -} +} \ No newline at end of file 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 b40a7cbc2f0..78a1d2a4d9d 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 b55d7459f48..154c284b61e 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 2d14095c239..aa46a53cd15 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 a2dd334fef8..cd9e1ee452d 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 8cd328e059c..d6581184b03 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 @@ class Mage_Core_Model_Session_Abstract extends Mage_Core_Model_Session_Abstract_ } /** - * Not Mage exeption handling + * Not Mage exception handling * * @param Exception $exception * @param string $alternativeText 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 f11242d7097..f32b59a6ad4 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) */ @@ -56,6 +56,10 @@ class Mage_Core_Model_Session_Abstract_Varien extends Varien_Object 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; 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 dbe28f9dbeb..a2a4d78c2e8 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 f21bee10d66..07bfa6537e9 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/ShellAbstract.php b/app/code/core/Mage/Core/Model/ShellAbstract.php index f8fa805363b..bd5101f0a24 100644 --- a/app/code/core/Mage/Core/Model/ShellAbstract.php +++ b/app/code/core/Mage/Core/Model/ShellAbstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shell - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.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 bf6b7510213..f28ccf54b1a 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) */ @@ -47,59 +47,58 @@ class Mage_Core_Model_Source_Email_Variables */ public function __construct() { - $helper = Mage::helper('Mage_Core_Helper_Data'); $this->_configVariables = array( array( 'value' => Mage_Core_Model_Url::XML_PATH_UNSECURE_URL, - 'label' => $helper->__('Base Unsecure URL') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Base Unsecure URL') ), array( 'value' => Mage_Core_Model_Url::XML_PATH_SECURE_URL, - 'label' => $helper->__('Base Secure URL') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Base Secure URL') ), array( 'value' => 'trans_email/ident_general/name', - 'label' => $helper->__('General Contact Name') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('General Contact Name') ), array( 'value' => 'trans_email/ident_general/email', - 'label' => $helper->__('General Contact Email') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('General Contact Email') ), array( 'value' => 'trans_email/ident_sales/name', - 'label' => $helper->__('Sales Representative Contact Name') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Sales Representative Contact Name') ), array( 'value' => 'trans_email/ident_sales/email', - 'label' => $helper->__('Sales Representative Contact Email') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Sales Representative Contact Email') ), array( 'value' => 'trans_email/ident_custom1/name', - 'label' => $helper->__('Custom1 Contact Name') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Custom1 Contact Name') ), array( 'value' => 'trans_email/ident_custom1/email', - 'label' => $helper->__('Custom1 Contact Email') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Custom1 Contact Email') ), array( 'value' => 'trans_email/ident_custom2/name', - 'label' => $helper->__('Custom2 Contact Name') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Custom2 Contact Name') ), array( 'value' => 'trans_email/ident_custom2/email', - 'label' => $helper->__('Custom2 Contact Email') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Custom2 Contact Email') ), array( 'value' => 'general/store_information/name', - 'label' => $helper->__('Store Name') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Store Name') ), array( 'value' => 'general/store_information/phone', - 'label' => $helper->__('Store Contact Telephone') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Store Contact Telephone') ), array( 'value' => 'general/store_information/address', - 'label' => $helper->__('Store Contact Address') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Store Contact Address') ) ); } diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index 75eef3bf313..ed119fb711f 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) */ @@ -95,10 +95,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 @@ -677,7 +682,8 @@ class Mage_Core_Model_Store extends Mage_Core_Model_Abstract } if (Mage::isInstalled()) { - $secureBaseUrl = $this->getConfig(Mage_Core_Model_Url::XML_PATH_SECURE_URL); + $secureBaseUrl = Mage::getStoreConfig(Mage_Core_Model_Url::XML_PATH_SECURE_URL); + if (!$secureBaseUrl) { return false; } @@ -766,9 +772,9 @@ class Mage_Core_Model_Store extends Mage_Core_Model_Abstract 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 3271c070ad8..9420ee59c06 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 c6d1c5dce21..f202a1a00a2 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_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/Core/Model/Store/Exception.php b/app/code/core/Mage/Core/Model/Store/Exception.php index 215e31f2539..78f2395b08b 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 6bad369c33a..58325f75480 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 @@ class Mage_Core_Model_Store_Group extends Mage_Core_Model_Abstract 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 896300cb70d..63c8f8efa7b 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) */ @@ -126,7 +126,7 @@ abstract class Mage_Core_Model_Template extends Mage_Core_Model_Abstract public function setDesignConfig(array $config) { if (!isset($config['area']) || !isset($config['store'])) { - throw new Exception(Mage::helper('Mage_Core_Helper_Data')->__('Design config must have area and store.')); + throw new Magento_Exception('Design config must have area and store.'); } $this->getDesignConfig()->setData($config); return $this; diff --git a/app/code/core/Mage/Core/Model/Translate.php b/app/code/core/Mage/Core/Model/Translate.php index 1675e3355fb..3b48700f4eb 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 9de35666c68..b5a785e52d7 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 5c0940569f6..60b9a50b6bb 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 @@ class Mage_Core_Model_Translate_Inline $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 @@ class Mage_Core_Model_Translate_Inline } 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) { @@ -269,7 +277,7 @@ class Mage_Core_Model_Translate_Inline <?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; } @@ -286,25 +294,63 @@ class Mage_Core_Model_Translate_Inline } /** - * 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 * @@ -312,139 +358,192 @@ class Mage_Core_Model_Translate_Inline 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() { @@ -456,22 +555,19 @@ class Mage_Core_Model_Translate_Inline $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; } } @@ -498,4 +594,3 @@ class Mage_Core_Model_Translate_Inline 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 9dcdfdea722..31087b657fd 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 792c38c327b..ea8f81f6310 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) */ diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Url/Rewrite.php index e162909a892..54f2c08e0c1 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 9e5ec842c44..90a96116b84 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 fe3423764c9..3bbb732ab95 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 a5152d46d5d..a9143cefe12 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 4800d212a6f..18678a829a3 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 8136add001a..2ec414fedbe 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 13f21110374..ae0a7de8abe 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 03b9c7c1279..072430dae9f 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 599c37a8e83..113756251af 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) */ --> @@ -297,6 +297,9 @@ </security> </admin> <general> + <country> + <eu_countries>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</eu_countries> + </country> <locale> <firstday>0</firstday> <weekend>0,6</weekend> diff --git a/app/code/core/Mage/Core/etc/system.xml b/app/code/core/Mage/Core/etc/system.xml index 23708253bbf..3cfe32059a6 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) */ --> @@ -571,6 +571,15 @@ <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </default> + <eu_countries translate="label"> + <label>European Union Countries</label> + <frontend_type>multiselect</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Country</source_model> + <sort_order>30</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </eu_countries> </fields> </country> <locale translate="label"> @@ -645,6 +654,25 @@ <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </phone> + <merchant_country translate="label"> + <label>Country</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Country</source_model> + <sort_order>25</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <can_be_empty>1</can_be_empty> + </merchant_country> + <merchant_vat_number translate="label"> + <label>VAT Number</label> + <frontend_type>text</frontend_type> + <sort_order>27</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <can_be_empty>1</can_be_empty> + </merchant_vat_number> <address translate="label"> <label>Store Contact Address</label> <frontend_type>textarea</frontend_type> diff --git a/app/code/core/Mage/Core/etc/translater.xml b/app/code/core/Mage/Core/etc/translater.xml new file mode 100644 index 00000000000..237bd08c4c2 --- /dev/null +++ b/app/code/core/Mage/Core/etc/translater.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) + */ +--> +<translater> + <!-- validation.js --> + <validate-no-html-tags translate="message" module="Mage_Core"> + <message>HTML tags are not allowed</message> + </validate-no-html-tags> + <validate-select translate="message" module="Mage_Core"> + <message>Please select an option.</message> + </validate-select> + <required-entry translate="message" module="Mage_Core"> + <message>This is a required field.</message> + </required-entry> + <validate-number translate="message" module="Mage_Core"> + <message>Please enter a valid number in this field.</message> + </validate-number> + <validate-number-range translate="message" module="Mage_Core"> + <message>The value is not within the specified range.</message> + </validate-number-range> + <validate-digits translate="message" module="Mage_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="Mage_Core"> + <message>The value is not within the specified range.</message> + </validate-digits-range> + <validate-alpha translate="message" module="Mage_Core"> + <message>Please use letters only (a-z or A-Z) in this field.</message> + </validate-alpha> + <validate-code translate="message" module="Mage_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="Mage_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="Mage_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="Mage_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="Mage_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="Mage_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="Mage_Core"> + <message>Please enter a valid date.</message> + </validate-date> + <validate-email translate="message" module="Mage_Core"> + <message>Please enter a valid email address. For example johndoe@domain.com.</message> + </validate-email> + <validate-email-sender translate="message" module="Mage_Core"> + <message>Please use only visible characters and spaces.</message> + </validate-email-sender> + <validate-password translate="message" module="Mage_Core"> + <message>Please enter 6 or more characters. Leading or trailing spaces will be ignored.</message> + </validate-password> + <validate-admin-password translate="message" module="Mage_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="Mage_Core"> + <message>Please make sure your passwords match.</message> + </validate-cpassword> + <validate-url translate="message" module="Mage_Core"> + <message>Please enter a valid URL. Protocol is required (http://, https:// or ftp://)</message> + </validate-url> + <validate-clean-url translate="message" module="Mage_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="Mage_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="Mage_Core"> + <message>Please enter a valid XML-identifier. For example something_1, block5, id-4.</message> + </validate-xml-identifier> + <validate-ssn translate="message" module="Mage_Core"> + <message>Please enter a valid social security number. For example 123-45-6789.</message> + </validate-ssn> + <validate-zip translate="message" module="Mage_Core"> + <message>Please enter a valid zip code. For example 90602 or 90602-1234.</message> + </validate-zip> + <validate-zip-international translate="message" module="Mage_Core"> + <message>Please enter a valid zip code.</message> + </validate-zip-international> + <validate-date-au translate="message" module="Mage_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="Mage_Core"> + <message>Please enter a valid $ amount. For example $100.00.</message> + </validate-currency-dollar> + <validate-one-required translate="message" module="Mage_Core"> + <message>Please select one of the above options.</message> + </validate-one-required> + <validate-one-required-by-name translate="message" module="Mage_Core"> + <message>Please select one of the options.</message> + </validate-one-required-by-name> + <validate-not-negative-number translate="message" module="Mage_Core"> + <message>Please enter a valid number in this field.</message> + </validate-not-negative-number> + <validate-state translate="message" module="Mage_Core"> + <message>Please select State/Province.</message> + </validate-state> + <validate-new-password translate="message" module="Mage_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="Mage_Core"> + <message>Please enter a number greater than 0 in this field.</message> + </validate-greater-than-zero> + <validate-zero-or-greater translate="message" module="Mage_Core"> + <message>Please enter a number 0 or greater in this field.</message> + </validate-zero-or-greater> + <validate-cc-number translate="message" module="Mage_Core"> + <message>Please enter a valid credit card number.</message> + </validate-cc-number> + <validate-cc-type translate="message" module="Mage_Core"> + <message>Credit card number does not match credit card type.</message> + </validate-cc-type> + <validate-cc-type-select translate="message" module="Mage_Core"> + <message>Card type does not match credit card number.</message> + </validate-cc-type-select> + <validate-cc-exp translate="message" module="Mage_Core"> + <message>Incorrect credit card expiration date.</message> + </validate-cc-exp> + <validate-cc-cvn translate="message" module="Mage_Core"> + <message>Please enter a valid credit card verification number.</message> + </validate-cc-cvn> + <validate-data translate="message" module="Mage_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="Mage_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="Mage_Core"> + <message>Text length does not satisfy specified text range.</message> + </validate-length> + <validate-percents translate="message" module="Mage_Core"> + <message>Please enter a number lower than 100.</message> + </validate-percents> + <required-file translate="message" module="Mage_Core"> + <message>Please select a file</message> + </required-file> + <validate-cc-ukss translate="message" module="Mage_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="Mage_Core"> + <message>Please wait, loading...</message> + </loading> + <!-- end rules.js --> + + <!-- js.js --> + <validate-date-required translate="message" module="Mage_Core"> + <message>This date is a required value.</message> + </validate-date-required> + <validate-date-day translate="message" module="Mage_Core"> + <message>Please enter a valid day (1-%d).</message> + </validate-date-day> + <validate-date-month translate="message" module="Mage_Core"> + <message>Please enter a valid month (1-12).</message> + </validate-date-month> + <validate-date-year translate="message" module="Mage_Core"> + <message>Please enter a valid year (1900-%d).</message> + </validate-date-year> + <validate-date-full-date translate="message" module="Mage_Core"> + <message>Please enter a valid full date</message> + </validate-date-full-date> + <validate-date-date-between translate="message" module="Mage_Core"> + <message>Please enter a valid date between %s and %s</message> + </validate-date-date-between> + <validate-date-greater translate="message" module="Mage_Core"> + <message>Please enter a valid date equal to or greater than %s</message> + </validate-date-greater> + <validate-date-less translate="message" module="Mage_Core"> + <message>Please enter a valid date less than or equal to %s</message> + </validate-date-less> + <!-- end js.js --> +</translater> diff --git a/app/code/core/Mage/Core/functions.php b/app/code/core/Mage/Core/functions.php index b33d1c2b8ec..5b9d33b27e2 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 c0468d2db8a..d4d64150f22 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/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 e2df43f0bf8..cfcb1d92839 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/Core/view/frontend/formkey.phtml b/app/code/core/Mage/Core/view/frontend/formkey.phtml index cf6fc11693f..446ccce0bdb 100644 --- a/app/code/core/Mage/Core/view/frontend/formkey.phtml +++ b/app/code/core/Mage/Core/view/frontend/formkey.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/code/core/Mage/Core/view/frontend/layout.xml b/app/code/core/Mage/Core/view/frontend/layout.xml index 9933f095c68..f34c4a6e507 100644 --- a/app/code/core/Mage/Core/view/frontend/layout.xml +++ b/app/code/core/Mage/Core/view/frontend/layout.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/code/core/Mage/Core/view/frontend/link.phtml b/app/code/core/Mage/Core/view/frontend/link.phtml index 0df23c3f6f7..4ca552b74e0 100644 --- a/app/code/core/Mage/Core/view/frontend/link.phtml +++ b/app/code/core/Mage/Core/view/frontend/link.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/code/core/Mage/Core/view/frontend/messages.phtml b/app/code/core/Mage/Core/view/frontend/messages.phtml index c89ebe2197d..06b2384f068 100644 --- a/app/code/core/Mage/Core/view/frontend/messages.phtml +++ b/app/code/core/Mage/Core/view/frontend/messages.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/code/core/Mage/Cron/Exception.php b/app/code/core/Mage/Cron/Exception.php index 4e4ed733713..15d27f92f9f 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 d5649c2de6d..e4a690370af 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/Observer.php b/app/code/core/Mage/Cron/Model/Observer.php index ee7fec05c24..785214ca0a0 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 59c9e47476d..95cbaa73573 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 edb81e86505..7ecaea0841c 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 66adc629f04..def18b50649 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 8c5302f7f5d..640e816d295 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 2d55f25be04..217cb8ddaab 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 2548a567c12..8f4bfab21ad 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/Customer/Block/Account/Dashboard.php b/app/code/core/Mage/Customer/Block/Account/Dashboard.php index 3d5863a32d6..8ddfa2624ad 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 90fd691b568..a2dd76bc2dd 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 f518a2ddb5e..8095a53cd4a 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 1b51d61361f..e4049124b16 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 4388b998070..96e88273d61 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 a8e3a71ef05..0dd4ddb4fd5 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 ef91ad66580..29da83fdab0 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 d1e18c6d0d9..f5544b6eefe 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 14b514dc890..2a5e403a31e 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 fa36efb1b0e..81624358ecd 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 a5413b9be1d..171ff8c0704 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 index 56a664a0191..66df2191424 100644 --- 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) */ 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 9ad4514613c..209b8247fd4 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 826c103970a..8306a7e6c31 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 f09e6ad0233..1bc26c3c854 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 9edcacee0d8..cfa301714a3 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 f6a0c3388b4..4f27b70621c 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 c2538434e35..1a5a994fe13 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 94f4fab2504..72ae707d345 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 be41977fd1a..b96d092e78a 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 fd5597a9d34..a593de6b61b 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 0112b47cf7c..74fb010cee2 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 @@ class Mage_Customer_Block_Widget_Name extends Mage_Customer_Block_Widget_Abstrac 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 2a0dde4b739..cd956b6a7cd 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 60763500c25..71c17eef4f3 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 bc98e583f1b..40be96a4c62 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) */ @@ -31,6 +31,14 @@ */ 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'; + const XML_PATH_VIV_TAX_CALCULATION_ADDRESS_TYPE = 'customer/create_account/tax_calculation_address_type'; + /** * Array of Customer Address Attributes * @@ -200,4 +208,47 @@ class Mage_Customer_Helper_Address extends Mage_Core_Helper_Abstract 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); + } + + /** + * 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 0f547117b2f..06a5e391e53 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) */ @@ -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 @@ class Mage_Customer_Helper_Data extends Mage_Core_Helper_Abstract { 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, $store); + + $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('Mage_Core_Helper_Data')->__('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('Mage_Core_Helper_Data'); + + 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 + * @param Mage_Core_Model_Store|string|int|null $store + * @return null|string + */ + public function getCustomerVatClass($customerCountryCode, $vatValidationResult, $store = null) + { + $vatClass = null; + + $isVatNumberValid = $vatValidationResult->getIsValid(); + + if (is_string($customerCountryCode) + && !empty($customerCountryCode) + && $customerCountryCode === Mage::helper('Mage_Core_Helper_Data')->getMerchantCountryCode($store) + && $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 a835f1e0dd5..3ae8acc40c5 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) */ @@ -150,7 +150,7 @@ class Mage_Customer_Model_Address extends Mage_Customer_Model_Address_Abstract } return $entityTypeId; } - + /** * Return Region ID * @@ -160,7 +160,7 @@ class Mage_Customer_Model_Address extends Mage_Customer_Model_Address_Abstract { 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 e5e9b2aa892..4f821bf64de 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 <core@magentocommerce.com> + * @category Mage + * @package Mage_Customer + * @author Magento Core Team <core@magentocommerce.com> */ 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,7 +251,10 @@ class Mage_Customer_Model_Address_Abstract extends Mage_Core_Model_Abstract $this->setData('region_id', $region); $this->unsRegion(); } else { - $regionModel = Mage::getModel('Mage_Directory_Model_Region')->loadByCode($this->getRegionCode(), $this->getCountryId()); + $regionModel = Mage::getModel('Mage_Directory_Model_Region')->loadByCode( + $this->getRegionCode(), + $this->getCountryId() + ); $this->setData('region_id', $regionModel->getId()); } } @@ -256,7 +279,9 @@ class Mage_Customer_Model_Address_Abstract extends Mage_Core_Model_Abstract public function getCountryModel() { if(!isset(self::$_countryModels[$this->getCountryId()])) { - self::$_countryModels[$this->getCountryId()] = Mage::getModel('Mage_Directory_Model_Country')->load($this->getCountryId()); + self::$_countryModels[$this->getCountryId()] = Mage::getModel('Mage_Directory_Model_Country')->load( + $this->getCountryId() + ); } return self::$_countryModels[$this->getCountryId()]; @@ -315,40 +340,41 @@ class Mage_Customer_Model_Address_Abstract extends Mage_Core_Model_Abstract public function validate() { $errors = array(); - $helper = Mage::helper('Mage_Customer_Helper_Data'); $this->implodeStreetAddress(); if (!Zend_Validate::is($this->getFirstname(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the first name.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the first name.'); } if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the last name.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the last name.'); } if (!Zend_Validate::is($this->getStreet(1), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the street.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the street.'); } if (!Zend_Validate::is($this->getCity(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the city.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the city.'); } if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the telephone number.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the telephone number.'); } $_havingOptionalZip = Mage::helper('Mage_Directory_Helper_Data')->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('Mage_Customer_Helper_Data')->__('Please enter the zip/postal code.'); } if (!Zend_Validate::is($this->getCountryId(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the country.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_Data')->__('Please enter the state/province.'); } if (empty($errors) || $this->getShouldIgnoreValidation()) { diff --git a/app/code/core/Mage/Customer/Model/Address/Api.php b/app/code/core/Mage/Customer/Model/Address/Api.php index 9da91d3f5e0..52c4187ae3c 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 4c8edcfdb7f..63c71adc951 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 abaface5744..afac7ad1872 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 b6a52df1464..cf92c36b933 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 df2321d914c..2645b51444f 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 new file mode 100644 index 00000000000..59365d76a1d --- /dev/null +++ b/app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php @@ -0,0 +1,52 @@ +<?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_Customer + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Boolean customer attribute backend model + * + * @category Mage + * @package Mage_Customer + * @author Magento Core Team <core@magentocommerce.com> + */ +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/Attribute/Data.php b/app/code/core/Mage/Customer/Model/Attribute/Data.php index feffe7322c3..5101f1f9956 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 7280af9d267..7493f14ab1b 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 a7b092f3fe9..650ade21d9d 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 d7835299ae9..3452abad318 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 2eef4f7ea3f..efbded70ed2 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 69330a9ec4d..67fac25a2c9 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 b56aa206832..efa7ab8116e 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 91c1cb96373..d45ed771df3 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 c6b87fdbccd..55788d58307 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 f1aa4f34e99..6cd72e8feee 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 fa38e70e679..49403867a92 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 92371ed47f8..ecdd3b9bb5d 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 3e5aa120ebb..9a2aebdbda8 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 e32401cfe23..70c08ebf4ef 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 acca8a222a0..5f961aa7ca3 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 4fdb0053fe1..d38a747b38a 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 3c401788bf1..77c1806627f 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) */ @@ -777,43 +777,42 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract public function validate() { $errors = array(); - $customerHelper = Mage::helper('Mage_Customer_Helper_Data'); if (!Zend_Validate::is( trim($this->getFirstname()) , 'NotEmpty')) { - $errors[] = $customerHelper->__('The first name cannot be empty.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_Data')->__('The last name cannot be empty.'); } if (!Zend_Validate::is($this->getEmail(), 'EmailAddress')) { - $errors[] = $customerHelper->__('Invalid email address "%s".', $this->getEmail()); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_Data')->__('The minimum password length is %s', 6); } $confirmation = $this->getConfirmation(); if ($password != $confirmation) { - $errors[] = $customerHelper->__('Please make sure your passwords match.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please make sure your passwords match.'); } $entityType = Mage::getSingleton('Mage_Eav_Model_Config')->getEntityType('customer'); $attribute = Mage::getModel('Mage_Customer_Model_Attribute')->loadByCode($entityType, 'dob'); if ($attribute->getIsRequired() && '' == trim($this->getDob())) { - $errors[] = $customerHelper->__('The Date of Birth is required.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('The Date of Birth is required.'); } $attribute = Mage::getModel('Mage_Customer_Model_Attribute')->loadByCode($entityType, 'taxvat'); if ($attribute->getIsRequired() && '' == trim($this->getTaxvat())) { - $errors[] = $customerHelper->__('The TAX/VAT number is required.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('The TAX/VAT number is required.'); } $attribute = Mage::getModel('Mage_Customer_Model_Attribute')->loadByCode($entityType, 'gender'); if ($attribute->getIsRequired() && '' == trim($this->getGender())) { - $errors[] = $customerHelper->__('Gender is required.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Gender is required.'); } if (empty($errors)) { @@ -831,7 +830,6 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract public function importFromTextArray(array $row) { $this->resetErrors(); - $hlp = Mage::helper('Mage_Customer_Helper_Data'); $line = $row['i']; $row = $row['row']; @@ -840,7 +838,7 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract $website = Mage::getModel('Mage_Core_Model_Website')->load($row['website_code'], 'code'); if (!$website->getId()) { - $this->addError($hlp->__('Invalid website, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('Mage_Customer_Helper_Data')->__('Invalid website, skipping the record, line: %s', $line)); } else { $row['website_id'] = $website->getWebsiteId(); @@ -849,18 +847,18 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract // Validate Email if (empty($row['email'])) { - $this->addError($hlp->__('Missing email, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_Data')->__('The customer ID and email did not match, skipping the record, line: %s', $line)); } else { $this->unsetData(); $this->load($row['entity_id']); @@ -872,7 +870,7 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract } if (empty($row['website_code'])) { - $this->addError($hlp->__('Missing website, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('Mage_Customer_Helper_Data')->__('Missing website, skipping the record, line: %s', $line)); } if (empty($row['group'])) { @@ -880,10 +878,10 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract } if (empty($row['firstname'])) { - $this->addError($hlp->__('Missing first name, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_Data')->__('Missing last name, skipping the record, line: %s', $line)); } if (!empty($row['password_new'])) { @@ -904,7 +902,7 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract } if (!$this->validateAddress($row, 'billing')) { - $this->printError($hlp->__('Invalid billing address for (%s)', $row['email']), $line); + $this->printError(Mage::helper('Mage_Customer_Helper_Data')->__('Invalid billing address for (%s)', $row['email']), $line); } else { // Handling billing address $billingAddress = $this->getPrimaryBillingAddress(); @@ -945,7 +943,7 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract } if (!$this->validateAddress($row, 'shipping')) { - $this->printError($hlp->__('Invalid shipping address for (%s)', $row['email']), $line); + $this->printError(Mage::helper('Mage_Customer_Helper_Data')->__('Invalid shipping address for (%s)', $row['email']), $line); } else { // Handling shipping address $shippingAddress = $this->getPrimaryShippingAddress(); @@ -1288,7 +1286,7 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract $tokenExpirationPeriod = Mage::helper('Mage_Customer_Helper_Data')->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/Customer/Api.php b/app/code/core/Mage/Customer/Model/Customer/Api.php index 915ce3e41cd..5ebae45d27c 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 f74dee3869a..c03a2cb2b2e 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 d509f11d312..d5b69040f5c 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 3a5da05e948..9606231bc9f 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 3a0197102d2..68281940a3c 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 057ca7567b1..2e99517f5cd 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 0f190f6f05c..36764d3f1fb 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 c2792ef7e44..24e44b17111 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 01928868b42..3ecf7d3ee3e 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 7f9f9476c22..4f40fcaf88a 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/Form.php b/app/code/core/Mage/Customer/Model/Form.php index 357793e7c5f..4af3efae984 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 d5f8c3ff1ef..4640991b009 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 3c45d0d1458..cce518fcc4b 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 7aec13a9729..d1b5c561566 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 5f427499d07..5e4badac60f 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) */ @@ -31,11 +31,191 @@ */ 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()) + || $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(); + } + + /** + * 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; + } + + $configAddressType = Mage::helper('Mage_Customer_Helper_Address')->getTaxCalculationAddressType(); + if ($configAddressType == Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING) { + return $this->_isDefaultShipping($address); + } + return $this->_isDefaultBilling($address); + } + + /** + * Before load layout event handler + * + * @param Varien_Event_Observer $observer + */ public function beforeLoadLayout($observer) { $loggedIn = Mage::getSingleton('Mage_Customer_Model_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()); + } else { + $configAddressType = Mage::helper('Mage_Customer_Helper_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'); + } + } + } + + /** + * 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('Mage_Customer_Helper_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('Mage_Customer_Helper_Data'); + + if ($customerAddress->getVatId() == '' + || !Mage::helper('Mage_Core_Helper_Data')->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('Mage_Customer_Helper_Data')->getVatValidationUserMessage($customerAddress, + $customer->getDisableAutoGroupChange(), $result); + + if (!$validationMessage->getIsError()) { + Mage::getSingleton('Mage_Customer_Model_Session')->addSuccess($validationMessage->getMessage()); + } else { + Mage::getSingleton('Mage_Customer_Model_Session')->addError($validationMessage->getMessage()); + } + } + } + } catch (Exception $e) { + Mage::register(self::VIV_PROCESSED_FLAG, false, true); + } + } + + /** + * 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('Mage_Customer_Helper_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/Address.php b/app/code/core/Mage/Customer/Model/Resource/Address.php index f4a6aae8315..94792af110e 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 7fde0a065d8..a225c2506b0 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 7ba4dab0e76..3549843e9df 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 006de125874..49123f04728 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 cc8aceab75a..55408eb0b16 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 32ecf308498..924a6c8c51a 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 c765879b240..e01c512cd6c 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 baa892731bd..d99ba116917 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 1f369520388..9aadd89b599 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 1156ee5b640..5970df45638 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) */ @@ -325,7 +325,7 @@ class Mage_Customer_Model_Resource_Customer extends Mage_Eav_Model_Entity_Abstra 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 4b921c5a663..1b2d7dded28 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) */ @@ -80,26 +80,29 @@ class Mage_Customer_Model_Resource_Customer_Collection extends Mage_Eav_Model_En 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/Form/Attribute.php b/app/code/core/Mage/Customer/Model/Resource/Form/Attribute.php index b3486fd8d5c..4d4ebd0f068 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 7e02a2ebb9d..a0f50e43473 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 87ebf7d6fc9..12f42eff75d 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) */ @@ -85,8 +85,7 @@ class Mage_Customer_Model_Resource_Group extends Mage_Core_Model_Resource_Db_Abs ->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('Mage_Customer_Helper_Data')->getDefaultCustomerGroupId($customer->getStoreId()); $customer->setGroupId($defaultGroupId); $customer->save(); } 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 f0854ff9085..052c0a865ca 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 8879624c10d..8f3b95b4cb6 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/Session.php b/app/code/core/Mage/Customer/Model/Session.php index f04e7bbc485..4e588e43c5d 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 @@ class Mage_Customer_Model_Session extends Mage_Core_Model_Session_Abstract } /** - * Retrieve costomer model object + * Retrieve customer model object * * @return Mage_Customer_Model_Customer */ @@ -168,13 +168,14 @@ class Mage_Customer_Model_Session extends Mage_Core_Model_Session_Abstract if ($this->getData('customer_group_id')) { return $this->getData('customer_group_id'); } - return $this->isLoggedIn() && $this->getCustomer() - ? $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; } /** - * 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 a9741fa982e..33c386b0764 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) */ @@ -392,6 +392,19 @@ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action $this->_getSession()->addSuccess( $this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName()) ); + if ($this->_isVatValidationEnabled()) { + // Show corresponding VAT message to customer + $configAddressType = Mage::helper('Mage_Customer_Helper_Address')->getTaxCalculationAddressType(); + $userPrompt = ''; + switch ($configAddressType) { + case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING: + $userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> 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 <a href="%s">here</a> to enter you billing address for proper VAT calculation', Mage::getUrl('customer/address/edit')); + } + $this->_getSession()->addSuccess($userPrompt); + } $customer->sendNewAccountEmail( $isJustConfirmed ? 'confirmed' : 'registered', @@ -819,4 +832,15 @@ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action $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('Mage_Customer_Helper_Address')->isVatValidationEnabled($store); + } } diff --git a/app/code/core/Mage/Customer/controllers/AddressController.php b/app/code/core/Mage/Customer/controllers/AddressController.php index 7db340398f3..54c4a6d6d08 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 5f3880bd9bd..e1980501f39 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/data/customer_setup/data-upgrade-1.6.1.0-1.6.2.0.php b/app/code/core/Mage/Customer/data/customer_setup/data-upgrade-1.6.1.0-1.6.2.0.php new file mode 100644 index 00000000000..910684b3cee --- /dev/null +++ b/app/code/core/Mage/Customer/data/customer_setup/data-upgrade-1.6.1.0-1.6.2.0.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_Customer + * @copyright 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 */ +$installer = $this; + +$disableAGCAttribute = Mage::getSingleton('Mage_Eav_Model_Config') + ->getAttribute('customer', 'disable_auto_group_change'); +$disableAGCAttribute->setData('used_in_forms', array( + 'adminhtml_customer' +)); +$disableAGCAttribute->save(); + +$vatAttribute = Mage::getSingleton('Mage_Eav_Model_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/etc/adminhtml.xml b/app/code/core/Mage/Customer/etc/adminhtml.xml index 025d2e12fb5..f028fb122d0 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 e61d8d0f36b..564836de9b3 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 7c62fbf5854..b1ac678539a 100644 --- a/app/code/core/Mage/Customer/etc/config.xml +++ b/app/code/core/Mage/Customer/etc/config.xml @@ -21,14 +21,14 @@ * * @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) */ --> <config> <modules> <Mage_Customer> - <version>1.6.1.0</version> + <version>1.6.2.0.1</version> </Mage_Customer> </modules> <global> @@ -91,6 +91,24 @@ </customer_password_remind_email_template> </email> </template> + <events> + <customer_address_save_before> + <observers> + <customer_address_before_save_viv_observer> + <class>Mage_Customer_Model_Observer</class> + <method>beforeAddressSave</method> + </customer_address_before_save_viv_observer> + </observers> + </customer_address_save_before> + <customer_address_save_after> + <observers> + <customer_addres_after_save_viv_observer> + <class>Mage_Customer_Model_Observer</class> + <method>afterAddressSave</method> + </customer_addres_after_save_viv_observer> + </observers> + </customer_address_save_after> + </events> </global> <adminhtml> <translate> @@ -116,6 +134,14 @@ </customer_is_logged_in_observer> </observers> </controller_action_layout_load_before> + <sales_model_service_quote_submit_after> + <observers> + <restore_customer_group_id> + <class>Mage_Customer_Model_Observer</class> + <method>quoteSubmitAfter</method> + </restore_customer_group_id> + </observers> + </sales_model_service_quote_submit_after> </events> <routers> <customer> @@ -151,6 +177,7 @@ <create_account> <confirm>0</confirm> <default_group>1</default_group> + <tax_calculation_address_type>billing</tax_calculation_address_type> <email_domain>example.com</email_domain> <email_identity>general</email_identity> <email_template>customer_create_account_email_template</email_template> @@ -190,7 +217,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}}</text> +{{depend fax}}F: {{var fax}}{{/depend}} +{{depend vat_id}}VAT: {{var vat_id}}{{/depend}}</text> <oneline>{{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}}</oneline> <html>{{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}} @@ -201,7 +229,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}}</html> +{{depend fax}}<br/>F: {{var fax}}{{/depend}} +{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}</html> <pdf>{{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}} @@ -213,8 +242,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}}|</pdf> - <js_template>#{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}</js_template> +{{depend fax}}<br/>F: {{var fax}}{{/depend}}| +{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}|</pdf> + <js_template>#{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}</js_template> </address_templates> </customer> </default> diff --git a/app/code/core/Mage/Customer/etc/fieldset.xml b/app/code/core/Mage/Customer/etc/fieldset.xml index 3d644070c60..b847f590d28 100644 --- a/app/code/core/Mage/Customer/etc/fieldset.xml +++ b/app/code/core/Mage/Customer/etc/fieldset.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) */ --> @@ -77,6 +77,79 @@ <update>1</update> </gender> </customer_account> + <customer_address> + <vat_id> + <to_quote_address>*</to_quote_address> + </vat_id> + <vat_is_valid> + <to_quote_address>*</to_quote_address> + </vat_is_valid> + <vat_request_id> + <to_quote_address>*</to_quote_address> + </vat_request_id> + <vat_request_date> + <to_quote_address>*</to_quote_address> + </vat_request_date> + <vat_request_success> + <to_quote_address>*</to_quote_address> + </vat_request_success> + </customer_address> + <sales_convert_order_address> + <vat_id> + <to_quote_address>*</to_quote_address> + </vat_id> + <vat_is_valid> + <to_quote_address>*</to_quote_address> + </vat_is_valid> + <vat_request_id> + <to_quote_address>*</to_quote_address> + </vat_request_id> + <vat_request_date> + <to_quote_address>*</to_quote_address> + </vat_request_date> + <vat_request_success> + <to_quote_address>*</to_quote_address> + </vat_request_success> + </sales_convert_order_address> + <sales_convert_quote_address> + <vat_id> + <to_order_address>*</to_order_address> + <to_customer_address>*</to_customer_address> + </vat_id> + <vat_is_valid> + <to_order_address>*</to_order_address> + <to_customer_address>*</to_customer_address> + </vat_is_valid> + <vat_request_id> + <to_order_address>*</to_order_address> + <to_customer_address>*</to_customer_address> + </vat_request_id> + <vat_request_date> + <to_order_address>*</to_order_address> + <to_customer_address>*</to_customer_address> + </vat_request_date> + <vat_request_success> + <to_order_address>*</to_order_address> + <to_customer_address>*</to_customer_address> + </vat_request_success> + </sales_convert_quote_address> + <sales_copy_order_billing_address> + <vat_id> + <to_order>*</to_order> + </vat_id> + <vat_is_valid> + <to_order>*</to_order> + </vat_is_valid> + <vat_request_id> + <to_order>*</to_order> + </vat_request_id> + <vat_request_date> + <to_order>*</to_order> + </vat_request_date> + <vat_request_success> + <to_order>*</to_order> + </vat_request_success> + </sales_copy_order_billing_address> </fieldsets> </global> <admin> diff --git a/app/code/core/Mage/Customer/etc/system.xml b/app/code/core/Mage/Customer/etc/system.xml index 198b4538bbd..bf28717454a 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) */ --> @@ -88,19 +88,97 @@ <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> <fields> + <auto_group_assign translate="label"> + <label>Enable Automatic Assignment to Customer Group</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_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>1</show_in_store> + </auto_group_assign> + <tax_calculation_address_type translate="label"> + <label>Tax Calculation Based on</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Customer_Address_Type</source_model> + <sort_order>10</sort_order> + <depends><auto_group_assign>1</auto_group_assign></depends> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </tax_calculation_address_type> <default_group translate="label"> <label>Default Group</label> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Customer_Group</source_model> - <sort_order>1</sort_order> + <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> </default_group> + <viv_domestic_group translate="label"> + <label>Group for Valid VAT ID - Domestic</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Customer_Group</source_model> + <sort_order>30</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><auto_group_assign>1</auto_group_assign></depends> + </viv_domestic_group> + <viv_intra_union_group translate="label"> + <label>Group for Valid VAT ID - Intra-Union</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Customer_Group</source_model> + <sort_order>40</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><auto_group_assign>1</auto_group_assign></depends> + </viv_intra_union_group> + <viv_invalid_group translate="label"> + <label>Group for Invalid VAT ID</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Customer_Group</source_model> + <sort_order>50</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><auto_group_assign>1</auto_group_assign></depends> + </viv_invalid_group> + <viv_error_group translate="label"> + <label>Validation Error Group</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Customer_Group</source_model> + <sort_order>55</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><auto_group_assign>1</auto_group_assign></depends> + </viv_error_group> + <viv_on_each_transaction translate="label"> + <label>Validate on Each Transaction</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>56</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><auto_group_assign>1</auto_group_assign></depends> + </viv_on_each_transaction> + <viv_disable_auto_group_assign_default translate="label"> + <label>Default Value for Disable Automatic Group Changes Based on VAT ID</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>57</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </viv_disable_auto_group_assign_default> <email_domain translate="label"> <label>Default Email Domain</label> <frontend_type>text</frontend_type> - <sort_order>2</sort_order> + <sort_order>60</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> @@ -109,7 +187,7 @@ <label>Default Welcome Email</label> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Email_Template</source_model> - <sort_order>3</sort_order> + <sort_order>70</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> @@ -118,7 +196,7 @@ <label>Email Sender</label> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Email_Identity</source_model> - <sort_order>4</sort_order> + <sort_order>80</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> @@ -127,7 +205,7 @@ <label>Require Emails Confirmation</label> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> - <sort_order>5</sort_order> + <sort_order>90</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> @@ -136,7 +214,7 @@ <label>Confirmation Link Email</label> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Email_Template</source_model> - <sort_order>6</sort_order> + <sort_order>100</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> @@ -146,7 +224,7 @@ <comment>This email will be sent instead of default welcome email, after account confirmation.</comment> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Email_Template</source_model> - <sort_order>7</sort_order> + <sort_order>110</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> @@ -155,7 +233,7 @@ <label>Generate Human-Friendly Customer ID</label> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> - <sort_order>8</sort_order> + <sort_order>120</sort_order> <show_in_default>1</show_in_default> <show_in_website>0</show_in_website> <show_in_store>0</show_in_store> @@ -377,5 +455,32 @@ </address_templates> </groups> </customer> + <general> + <groups> + <country> + <fields> + <eu_countries> + <backend_model>Mage_Adminhtml_Model_System_Config_Backend_Customer_GroupAutoAssign</backend_model> + </eu_countries> + </fields> + </country> + <store_information> + <fields> + <merchant_country> + <backend_model>Mage_Adminhtml_Model_System_Config_Backend_Customer_GroupAutoAssign</backend_model> + </merchant_country> + <validate_vat_number translate="button_label"> + <label></label> + <button_label>Validate VAT Number</button_label> + <frontend_model>Mage_Adminhtml_Block_Customer_System_Config_Validatevat</frontend_model> + <sort_order>28</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </validate_vat_number> + </fields> + </store_information> + </groups> + </general> </sections> </config> 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 dc9286dd267..e7093c67ebe 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-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 df8407c5cb8..061191ebf5e 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.0.0-1.6.1.0.php b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.0.0-1.6.1.0.php index df8407c5cb8..061191ebf5e 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.0.0-1.6.1.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/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 new file mode 100644 index 00000000000..c2bd1385abe --- /dev/null +++ b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php @@ -0,0 +1,78 @@ +<?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_Customer + * @copyright 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 */ +$installer = $this; + +$disableAGCAttributeCode = 'disable_auto_group_change'; + +$installer->addAttribute('customer', $disableAGCAttributeCode, array( + 'type' => 'static', + 'label' => 'Disable automatic group change', + 'input' => 'boolean', + 'backend' => 'Mage_Customer_Model_Attribute_Backend_Data_Boolean', + 'position' => 28, + 'required' => false +)); + +$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); +} 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 00000000000..e767ca8d2aa --- /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 @@ +<?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_Customer + * @copyright 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 */ +$installer = $this; + +$installer->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/Customer/view/frontend/account/dashboard.phtml b/app/code/core/Mage/Customer/view/frontend/account/dashboard.phtml index 964b96cdb0f..f958ad15652 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/dashboard.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/dashboard.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/code/core/Mage/Customer/view/frontend/account/dashboard/address.phtml b/app/code/core/Mage/Customer/view/frontend/account/dashboard/address.phtml index 7d9371e7aa7..1944edcdb61 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/dashboard/address.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/dashboard/address.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/code/core/Mage/Customer/view/frontend/account/dashboard/hello.phtml b/app/code/core/Mage/Customer/view/frontend/account/dashboard/hello.phtml index b3241870e8c..fc82d91f127 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/dashboard/hello.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/dashboard/hello.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/code/core/Mage/Customer/view/frontend/account/dashboard/info.phtml b/app/code/core/Mage/Customer/view/frontend/account/dashboard/info.phtml index bdf565cf7d9..ea1be57aea7 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/dashboard/info.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/dashboard/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/code/core/Mage/Customer/view/frontend/account/dashboard/newsletter.phtml b/app/code/core/Mage/Customer/view/frontend/account/dashboard/newsletter.phtml index 09ceb3540ee..093b2fae3ca 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/dashboard/newsletter.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/dashboard/newsletter.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/code/core/Mage/Customer/view/frontend/account/link/back.phtml b/app/code/core/Mage/Customer/view/frontend/account/link/back.phtml index c2991b0d8c7..e383466d62f 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/link/back.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/link/back.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/code/core/Mage/Customer/view/frontend/account/navigation.phtml b/app/code/core/Mage/Customer/view/frontend/account/navigation.phtml index 30783df0577..801afb29333 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/navigation.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/navigation.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/code/core/Mage/Customer/view/frontend/address.phtml b/app/code/core/Mage/Customer/view/frontend/address.phtml index 64d4544e116..6ea3e9b2851 100644 --- a/app/code/core/Mage/Customer/view/frontend/address.phtml +++ b/app/code/core/Mage/Customer/view/frontend/address.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/code/core/Mage/Customer/view/frontend/address/book.phtml b/app/code/core/Mage/Customer/view/frontend/address/book.phtml index db3aaf4e347..e7eb477d800 100644 --- a/app/code/core/Mage/Customer/view/frontend/address/book.phtml +++ b/app/code/core/Mage/Customer/view/frontend/address/book.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/code/core/Mage/Customer/view/frontend/address/edit.phtml b/app/code/core/Mage/Customer/view/frontend/address/edit.phtml index b767330dbd5..9bb383d7048 100644 --- a/app/code/core/Mage/Customer/view/frontend/address/edit.phtml +++ b/app/code/core/Mage/Customer/view/frontend/address/edit.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) */ ?> @@ -85,6 +85,12 @@ </div> </li> <?php endfor ?> + <li class="wide"> + <label for="vat_id"><?php echo $this->__('VAT Number') ?></label> + <div class="input-box"> + <input type="text" name="vat_id" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" id="vat_id" class="input-text" /> + </div> + </li> <li class="fields"> <div class="field"> <label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label> diff --git a/app/code/core/Mage/Customer/view/frontend/balance.phtml b/app/code/core/Mage/Customer/view/frontend/balance.phtml index b26db3dd353..0e7bada0fe7 100644 --- a/app/code/core/Mage/Customer/view/frontend/balance.phtml +++ b/app/code/core/Mage/Customer/view/frontend/balance.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/code/core/Mage/Customer/view/frontend/form/address.phtml b/app/code/core/Mage/Customer/view/frontend/form/address.phtml index 1b082ebd4b0..9207b46cf6d 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/address.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/address.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/code/core/Mage/Customer/view/frontend/form/changepassword.phtml b/app/code/core/Mage/Customer/view/frontend/form/changepassword.phtml index 6e12abfa220..301cdd60826 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/changepassword.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/changepassword.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/code/core/Mage/Customer/view/frontend/form/confirmation.phtml b/app/code/core/Mage/Customer/view/frontend/form/confirmation.phtml index 912b7049678..e66aa956d80 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/confirmation.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/confirmation.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/code/core/Mage/Customer/view/frontend/form/edit.phtml b/app/code/core/Mage/Customer/view/frontend/form/edit.phtml index 05e77cf0ed3..5649e9eda57 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/edit.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/edit.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/code/core/Mage/Customer/view/frontend/form/forgotpassword.phtml b/app/code/core/Mage/Customer/view/frontend/form/forgotpassword.phtml index a23378f77ca..3e5257fcc43 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/forgotpassword.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/forgotpassword.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,6 +39,7 @@ <input type="text" name="email" alt="email" id="email_address" class="input-text required-entry validate-email" value="<?php echo $this->escapeHtml($this->getEmailValue()) ?>" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> </div> <div class="buttons-set"> diff --git a/app/code/core/Mage/Customer/view/frontend/form/login.phtml b/app/code/core/Mage/Customer/view/frontend/form/login.phtml index 98fe4cbd205..551b6443890 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/login.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/login.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) */ ?> @@ -61,6 +61,7 @@ <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> <p class="required"><?php echo $this->__('* Required Fields') ?></p> </div> diff --git a/app/code/core/Mage/Customer/view/frontend/form/mini.login.phtml b/app/code/core/Mage/Customer/view/frontend/form/mini.login.phtml index 39bae038993..5669854ba6d 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/mini.login.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/mini.login.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/code/core/Mage/Customer/view/frontend/form/newsletter.phtml b/app/code/core/Mage/Customer/view/frontend/form/newsletter.phtml index 35f2f8f1646..57c419cbf06 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/newsletter.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/newsletter.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/code/core/Mage/Customer/view/frontend/form/register.phtml b/app/code/core/Mage/Customer/view/frontend/form/register.phtml index 962a41f31a7..9d5caae5319 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/register.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/register.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) */ ?> @@ -164,6 +164,7 @@ </div> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> </div> <div class="buttons-set"> diff --git a/app/code/core/Mage/Customer/view/frontend/form/resetforgottenpassword.phtml b/app/code/core/Mage/Customer/view/frontend/form/resetforgottenpassword.phtml index df4b72e7ab5..a33ea0d4009 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/resetforgottenpassword.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/resetforgottenpassword.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/code/core/Mage/Customer/view/frontend/layout.xml b/app/code/core/Mage/Customer/view/frontend/layout.xml index 04941ba9ae9..c0f90219674 100644 --- a/app/code/core/Mage/Customer/view/frontend/layout.xml +++ b/app/code/core/Mage/Customer/view/frontend/layout.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) */ @@ -91,7 +91,7 @@ Layout for customer login page <action method="setTemplate"><template>1column.phtml</template></action> </reference> <reference name="content"> - <block type="Mage_Customer_Block_Form_Login" name="customer_form_login" template="form/login.phtml"/> + <block type="Mage_Customer_Block_Form_Login" name="customer_form_login" template="form/login.phtml" /> </reference> </customer_account_login> @@ -148,7 +148,7 @@ New customer registration <action method="setHeaderTitle" translate="title" module="Mage_Customer"><title>Password forgotten</title></action> </reference> <reference name="content"> - <block type="Mage_Customer_Block_Account_Forgotpassword" name="forgotPassword" template="form/forgotpassword.phtml"/> + <block type="Mage_Customer_Block_Account_Forgotpassword" name="forgotPassword" template="form/forgotpassword.phtml" /> </reference> </customer_account_forgotpassword> @@ -289,4 +289,4 @@ Customer account address edit page </reference> </customer_address_form> -</layout> +</layout> \ No newline at end of file diff --git a/app/code/core/Mage/Customer/view/frontend/logout.phtml b/app/code/core/Mage/Customer/view/frontend/logout.phtml index dfd5495acde..581863ff851 100644 --- a/app/code/core/Mage/Customer/view/frontend/logout.phtml +++ b/app/code/core/Mage/Customer/view/frontend/logout.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/code/core/Mage/Customer/view/frontend/widget/dob.phtml b/app/code/core/Mage/Customer/view/frontend/widget/dob.phtml index 1838884b5c3..05c2f8aeb91 100644 --- a/app/code/core/Mage/Customer/view/frontend/widget/dob.phtml +++ b/app/code/core/Mage/Customer/view/frontend/widget/dob.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/code/core/Mage/Customer/view/frontend/widget/gender.phtml b/app/code/core/Mage/Customer/view/frontend/widget/gender.phtml index a39f2e89a15..e4195d0deaf 100644 --- a/app/code/core/Mage/Customer/view/frontend/widget/gender.phtml +++ b/app/code/core/Mage/Customer/view/frontend/widget/gender.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/code/core/Mage/Customer/view/frontend/widget/name.phtml b/app/code/core/Mage/Customer/view/frontend/widget/name.phtml index d0819505d68..3f3ae6272f2 100644 --- a/app/code/core/Mage/Customer/view/frontend/widget/name.phtml +++ b/app/code/core/Mage/Customer/view/frontend/widget/name.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) */ @@ -43,7 +43,7 @@ For checkout/onepage/shipping.phtml: ->toHtml() ?> */ /** - * @var Mage_Customer_Block_Widget_Name $this + * @var $this Mage_Customer_Block_Widget_Name */ ?> <div class="<?php echo $this->getContainerClassName()?>"> @@ -70,10 +70,11 @@ For checkout/onepage/shipping.phtml: </div> </div> <?php if ($this->showMiddlename()): ?> +<?php $isMiddlenameRequired = $this->isMiddlenameRequired(); ?> <div class="field name-middlename"> - <label for="<?php echo $this->getFieldId('middlename')?>"><?php echo $this->getStoreLabel('middlename') ?></label> + <label for="<?php echo $this->getFieldId('middlename')?>"<?php echo $isMiddlenameRequired ? ' class="required"' : '' ?>><?php echo $isMiddlenameRequired ? '<em>*</em>' : '' ?><?php echo $this->getStoreLabel('middlename') ?></label> <div class="input-box"> - <input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text" <?php echo $this->getFieldParams() ?> /> + <input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text<?php echo $isMiddlenameRequired ? ' required-entry' : '' ?>" <?php echo $this->getFieldParams() ?> /> </div> </div> <?php endif; ?> diff --git a/app/code/core/Mage/Customer/view/frontend/widget/taxvat.phtml b/app/code/core/Mage/Customer/view/frontend/widget/taxvat.phtml index ec326b95441..fd7c5226c49 100644 --- a/app/code/core/Mage/Customer/view/frontend/widget/taxvat.phtml +++ b/app/code/core/Mage/Customer/view/frontend/widget/taxvat.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/code/core/Mage/Dataflow/Helper/Data.php b/app/code/core/Mage/Dataflow/Helper/Data.php index 6b812afa7bb..017d1cb9dc9 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 06e5adebea8..21f24c671d6 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 ffbc7213986..27e928dc0ba 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 a6d920ff3a9..5b47cec7f44 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 f781531d7f7..dcc2eab7e83 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 fa8230e16e7..9f4e301f987 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 550761878c6..b698c83c158 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 716261f6253..036b33b749f 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 794a9c303b7..4a226296c74 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 7be7af33248..c0c4b39eff6 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 09ef1bd5c47..22cf1f3bab0 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 24e8730f804..8d9e0d0fcd2 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 395b34bcf8e..2fea77ca193 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 a9475f2efc9..1a82e42b991 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 d1882f3731b..ca19b665c17 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 b2390c1cecd..cf2c71ebb1b 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 b214f41f2e6..5f03a703e89 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 cc1932786d9..a868afb4ad2 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 aba25aa9786..957af7b15c1 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 1e69f8ce66d..316cdf4d06f 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 2b7c454d3d0..39bf5b26314 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 e1c8f41bde0..74b783f0dc0 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 1b3ff6432ca..f54f98438a6 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 c395b5ed027..10d45a8589c 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 b2307a6b7f7..0d4b0b9a989 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/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Interface.php index f8e68a7e0e7..2fd0e1b21d2 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 a85df3906aa..93c1e29ca60 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 62ef5e89cca..7e82e9923e7 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 74429e29231..d768a329573 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 7a77614db8e..d8fcf577bbf 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 add10389706..620d516d409 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 506718692f8..03614ec13f9 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 76abced338a..bec6768591e 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 a2797312c8d..476335c51a2 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 03339b35660..3cb78c22962 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 ad99effbc1a..ee11a250ef9 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 a59c4dbb981..cb9a605ea09 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 6eccbc2cfa5..5f1960b4f5a 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 19075d59d26..5ff5596ec59 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 8ae9b7aba7c..d4f38c9ea45 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 0d34687a944..fca6194d91d 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 30fb32f1af1..5b054ee4265 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 d4a794d5a3a..e598eeb1dac 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/Profile.php b/app/code/core/Mage/Dataflow/Model/Profile.php index 3308cdac23d..cd6881fca66 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) */ @@ -80,7 +80,7 @@ class Mage_Dataflow_Model_Profile extends Mage_Core_Model_Abstract $actionsXML = $this->getData('actions_xml'); if (strlen($actionsXML) < 0 && @simplexml_load_string('<data>' . $actionsXML . '</data>', null, LIBXML_NOERROR) === false) { - Mage::throwException(Mage::helper("Mage_Dataflow_Helper_Data")->__("Actions XML is not valid.")); + Mage::throwException(Mage::helper('Mage_Dataflow_Helper_Data')->__("Actions XML is not valid.")); } if (is_array($this->getGuiData())) { @@ -120,7 +120,7 @@ class Mage_Dataflow_Model_Profile extends Mage_Core_Model_Abstract } if ($this->_getResource()->isProfileExists($this->getName(), $this->getId())) { - Mage::throwException(Mage::helper("Mage_Dataflow_Helper_Data")->__("Profile with the same name already exists.")); + Mage::throwException(Mage::helper('Mage_Dataflow_Helper_Data')->__("Profile with the same name already exists.")); } } @@ -421,4 +421,4 @@ echo "<xmp>" . $xml . "</xmp>"; die;*/ return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Dataflow/Model/Profile/History.php b/app/code/core/Mage/Dataflow/Model/Profile/History.php index d5fdc4d5756..23ae325983e 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 bb249545392..572f2a30d86 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 c65b9be3614..e9a9055a02b 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 b80c6730314..04a6f73a796 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 7c0176a28ce..24da65f0b0f 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 549292d213c..1148bf71043 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 abf21f2f62d..6ccdf497a08 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 c591471938a..8c036c7f45e 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 0ad3bdb5c75..43f2d55db31 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 158b87e0325..35672f632b2 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 fba1769928c..670fa7ec969 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 9ab0d8249c2..5cee5feb1bb 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 a47e3cc563e..2de657574f2 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 d7bb3869fe0..c474189c872 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/Parser/Csv.php b/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php index f8a2d23d8f8..8de19fe5d49 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 8432bcd1c7b..ec2dc7a84f1 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 caf51f856de..3b2c732cfc8 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 b94315b5ccc..a6e3c9d22f8 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/Directory/Block/Adminhtml/Frontend/Currency/Base.php b/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Currency/Base.php index ce2acb57a4e..20400402834 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 2cb7e82b017..adbf5b5e77f 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 55e97c143f2..77abc85f527 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 e87c57181a3..b7af654372c 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 a3c0c6041a4..abf8a46b173 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 1e1d91ce71a..bde0ab462c8 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) */ diff --git a/app/code/core/Mage/Directory/Helper/Url.php b/app/code/core/Mage/Directory/Helper/Url.php index f96074d16f2..b1f2f1fcc8e 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 ae84d5a1bf4..612d267df72 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 9d70167ace5..c08b0850dfa 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 1b24dfd16b2..4723d03b3e6 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 8740906f8d0..abcf6bcd165 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 ee8bfc0ab85..a27a45712cf 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 9a69a520f6f..ba92435ab87 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 0e5f9ef0a0e..8a7f3176d11 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 52f9eb580f5..de14f2c515d 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/Observer.php b/app/code/core/Mage/Directory/Model/Observer.php index 08eb4d1e7d5..eec432a18e4 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 8d9ac90daa0..96da1d434ff 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 70bcc5b5bbb..747e49e82c6 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 a6dae41a970..2a87944578e 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 b703ddb6e09..5c3f79638ed 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 55f7f157393..961b12aef91 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 5c4efb52e59..347fd054d19 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 5a137eb3aa6..a85a0e5dd10 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 2454a814eab..277bd744e8e 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/Region.php b/app/code/core/Mage/Directory/Model/Resource/Region.php index 96213226659..6a25c65ff1e 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 1165bb95f00..a4c06dcdff5 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 @@ class Mage_Directory_Model_Resource_Region_Collection extends Mage_Core_Model_Re $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 47c05da2179..9b877ed4065 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 a7e86071e7d..da97929c75d 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/etc/api.xml b/app/code/core/Mage/Directory/etc/api.xml index 6bfc7df02a4..98c6b2ef1da 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 f92ec5adca2..475d636ce81 100644 --- a/app/code/core/Mage/Directory/etc/config.xml +++ b/app/code/core/Mage/Directory/etc/config.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/system.xml b/app/code/core/Mage/Directory/etc/system.xml index c0c623e9855..6052b9c2fbc 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) */ --> 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 723e2876ddb..a2aa091154a 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/view/adminhtml/js/optional_zip_countries.phtml b/app/code/core/Mage/Directory/view/adminhtml/js/optional_zip_countries.phtml index 1c27a39fea0..3200c05589d 100644 --- a/app/code/core/Mage/Directory/view/adminhtml/js/optional_zip_countries.phtml +++ b/app/code/core/Mage/Directory/view/adminhtml/js/optional_zip_countries.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/code/core/Mage/Directory/view/frontend/currency.phtml b/app/code/core/Mage/Directory/view/frontend/currency.phtml index 7b519a4da1b..993d06bbc77 100644 --- a/app/code/core/Mage/Directory/view/frontend/currency.phtml +++ b/app/code/core/Mage/Directory/view/frontend/currency.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/code/core/Mage/Directory/view/frontend/currency/switch.phtml b/app/code/core/Mage/Directory/view/frontend/currency/switch.phtml index 2246907782d..895f2289c57 100644 --- a/app/code/core/Mage/Directory/view/frontend/currency/switch.phtml +++ b/app/code/core/Mage/Directory/view/frontend/currency/switch.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/code/core/Mage/Directory/view/frontend/js/optional_zip_countries.phtml b/app/code/core/Mage/Directory/view/frontend/js/optional_zip_countries.phtml index 1bb41c60848..91d4102ea1b 100644 --- a/app/code/core/Mage/Directory/view/frontend/js/optional_zip_countries.phtml +++ b/app/code/core/Mage/Directory/view/frontend/js/optional_zip_countries.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/code/core/Mage/Directory/view/frontend/layout.xml b/app/code/core/Mage/Directory/view/frontend/layout.xml index 5639f7cb710..77bee91967b 100644 --- a/app/code/core/Mage/Directory/view/frontend/layout.xml +++ b/app/code/core/Mage/Directory/view/frontend/layout.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/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 c3e17e6ba67..d840434a014 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 9966fffc9c4..bda3e303366 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 897ad054087..d8e2a9c9edc 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 86307cf217c..4a0b9059fb0 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 847e0353763..840cf77d0e1 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 ce234944c02..0d55b3c8d91 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 061d2127cbd..4fac33c2dbd 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 3573fb01c99..c108b558237 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 992b3860266..3d7190c8ea4 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 bccf613b19c..2f91ac17913 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 a24ba9a2423..ca03b5d1267 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 6d83953110d..ae93a7167b0 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 eab9c8c9f1d..9af9f63dd79 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 841915519eb..10736244bd6 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 6bd7039bd7d..0ef56ac2cbf 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 39070908d72..4221c8fc22c 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 7a688083ca4..2879bb7d693 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 92750763a4c..3931fa784d2 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/Link.php b/app/code/core/Mage/Downloadable/Model/Link.php index 70c86fa3836..30b5e07e7bf 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 77d25d67872..ede56b74891 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 5751f8dac67..7f6481c622c 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 7b9eb1dcbb2..7e98c4ac40c 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 3684a6d5bdd..ad1f7b3ca72 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 f10eef0dbd3..32c31370a3d 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 f272c7f1c77..2429bc67e19 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/Observer.php b/app/code/core/Mage/Downloadable/Model/Observer.php index e88b8932542..c09e6f7f32e 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) */ @@ -215,6 +215,12 @@ class Mage_Downloadable_Model_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/Product/Price.php b/app/code/core/Mage/Downloadable/Model/Product/Price.php index aed3ae4f0c8..867293f0c7b 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 fad619f5b61..2fef12ad5cf 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) */ @@ -402,11 +402,6 @@ class Mage_Downloadable_Model_Product_Type extends Mage_Catalog_Model_Product_Ty } } - /* - * After "Downloadable Information" tab was made non-ajax we should - * set this flag "true" to force saving of 'required_options' attribute - */ - $product->setCanSaveCustomOptions(true); $product->setTypeHasOptions($linksExist); $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 7ef15e31bca..cba973c81c4 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) */ @@ -146,6 +146,7 @@ class Mage_Downloadable_Model_Resource_Indexer_Price extends Mage_Catalog_Model_ $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( @@ -154,9 +155,10 @@ class Mage_Downloadable_Model_Resource_Indexer_Price extends Mage_Catalog_Model_ .' 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())); diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link.php b/app/code/core/Mage/Downloadable/Model/Resource/Link.php index 265c72333cf..22f9efb0eed 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 357e909cd7b..63cc0edfc54 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 1d20600e498..cebea252ef4 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 a4c3e9d43ff..add4d53e765 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 921659f2ccd..b1bb4175dfa 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 3310eaf457c..e24e73000ef 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 6267bd6a370..92a8a95a774 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 d69daeea676..1b1c30beae2 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 a95c43d0812..3bcff0b5333 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 9142e7084e2..3bf500ec89d 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 <core@magentocommerce.com> */ -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 @@ -66,13 +67,29 @@ class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Creditmemo extends Mage_Down $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 @@ -106,8 +123,10 @@ class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Creditmemo extends Mage_Down $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 473a8ade0a7..c3f5edbe59b 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 <core@magentocommerce.com> */ -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 @@ -65,13 +66,41 @@ class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice extends Mage_Downloa '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( @@ -81,14 +110,6 @@ class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice extends Mage_Downloa '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) { @@ -101,7 +122,11 @@ class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice extends Mage_Downloa ); 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 adbaa04a5b8..4ac53dbb6d0 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 9b95f95e92b..d7eae6969d3 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 e403f6cd519..d357b6a57ca 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 189eb2611af..b8a7e29d3ff 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) */ @@ -55,6 +55,12 @@ class Mage_Downloadable_Adminhtml_Downloadable_FileController extends Mage_Admin $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('Mage_Core_Helper_File_Storage_Database')->saveFile($fullPath); 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 3f6e9a315b3..5f510c6500d 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 1d184273b4c..ed1b7471f3b 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 37d1a2f3696..f74772f0f73 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) */ @@ -164,10 +164,7 @@ class Mage_Downloadable_DownloadController extends Mage_Core_Controller_Front_Ac if (!$customerId) { $product = Mage::getModel('Mage_Catalog_Model_Product')->load($linkPurchasedItem->getProductId()); if ($product->getId()) { - $notice = Mage::helper('Mage_Downloadable_Helper_Data')->__( - 'Please log in to download your product or purchase <a href="%s">%s</a>.', - $product->getProductUrl(), $product->getName() - ); + $notice = Mage::helper('Mage_Downloadable_Helper_Data')->__('Please log in to download your product or purchase <a href="%s">%s</a>.', $product->getProductUrl(), $product->getName()); } else { $notice = Mage::helper('Mage_Downloadable_Helper_Data')->__('Please log in to download your product.'); } @@ -231,4 +228,4 @@ class Mage_Downloadable_DownloadController extends Mage_Core_Controller_Front_Ac return $this->_redirect('*/customer/products'); } -} +} \ No newline at end of file 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 07bac6f538c..eb64f202b27 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 237f9721526..1a316cc5436 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) */ --> @@ -45,4 +45,18 @@ </admin> </resources> </acl> + <menu> + <report> + <children> + <products> + <children> + <downloads translate="title" module="Mage_Reports"> + <title>Downloads</title> + <action>adminhtml/report_product/downloads</action> + </downloads> + </children> + </products> + </children> + </report> + </menu> </config> diff --git a/app/code/core/Mage/Downloadable/etc/api.xml b/app/code/core/Mage/Downloadable/etc/api.xml index 66a27bdf7a1..a073fc0de20 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 05ea48c50e2..b5724a1e927 100644 --- a/app/code/core/Mage/Downloadable/etc/config.xml +++ b/app/code/core/Mage/Downloadable/etc/config.xml @@ -21,14 +21,14 @@ * * @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) */ --> <config> <modules> <Mage_Downloadable> - <version>1.6.0.0.1</version> + <version>1.6.0.0.2</version> </Mage_Downloadable> </modules> <global> diff --git a/app/code/core/Mage/Downloadable/etc/fieldset.xml b/app/code/core/Mage/Downloadable/etc/fieldset.xml index 4f247c3f1b1..7d4d12d6b9d 100644 --- a/app/code/core/Mage/Downloadable/etc/fieldset.xml +++ b/app/code/core/Mage/Downloadable/etc/fieldset.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/system.xml b/app/code/core/Mage/Downloadable/etc/system.xml index 31d9350a852..0709e5d5fbc 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 4d02bf6cc20..3628119b82b 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-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 00000000000..300dca17387 --- /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,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_Downloadable + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +$installFile = dirname(__FILE__) . DS . 'upgrade-1.6.0.0.1-1.6.0.0.2.php'; +if (file_exists($installFile)) { + include $installFile; +} + +/** @var $installer Mage_Catalog_Model_Resource_Setup */ +$installer = $this; +/** @var $connection Varien_Db_Adapter_Pdo_Mysql */ +$connection = $installer->getConnection(); +$connection->changeTableEngine( + $installer->getTable('catalog_product_index_price_downlod_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.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 c3d97a24ef4..05aa852dfe1 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 new file mode 100644 index 00000000000..375fcf54844 --- /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 @@ +<?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_Downloadable + * @copyright 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_Catalog_Model_Resource_Setup */ +$installer = $this; + +$applyTo = explode(',', $installer->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/Downloadable/view/adminhtml/layout.xml b/app/code/core/Mage/Downloadable/view/adminhtml/layout.xml index f8a9bba567c..bb39cfaec08 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/layout.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/code/core/Mage/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml index b43b5fd90d5..8577ee3aa56 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/product/composite/fieldset/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/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable.phtml index 0fa88510e66..e2f150b3d8f 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/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/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/links.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/links.phtml index 779d0d4a98d..b6b2d32ab3a 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/links.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/links.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) */ ?> @@ -185,7 +185,7 @@ var linkTemplate = '<tr>'+ '</td>'+ '<td class="a-center"><input type="text" name="downloadable[link][{{id}}][sort_order]" value="{{sort_order}}" class="input-text sort" /></td>'+ '<td>'+ - '<button id="downloadable_link_{{id}}_delete_button" type="button" class="scalable delete icon-btn delete-link-item"><span><?php echo Mage::helper('Mage_Downloadable_Helper_Data')->__('Delete'); ?></span></button>'+ + '<button id="downloadable_link_{{id}}_delete_button" type="button" class="scalable delete icon-btn delete-link-item"><span><span><span><?php echo Mage::helper('Mage_Downloadable_Helper_Data')->__('Delete'); ?></span></span></span></button>'+ '</td>'+ '</tr>'; diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/samples.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/samples.phtml index fbcd4423068..c98af1124ca 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/samples.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/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 = '<tr>'+ '</td>'+ '<td class="a-center"><input type="text" name="downloadable[sample][{{id}}][sort_order]" value="{{sort_order}}" class="input-text sort" /></td>'+ '<td>'+ - '<button type="button" class="scalable delete icon-btn delete-sample-item"><span>Delete</span></button>'+ + '<button type="button" class="scalable delete icon-btn delete-sample-item"><span><span><span>Delete</span></span></span></button>'+ '</td>'+ '</tr>'; var sampleItems = { diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/creditmemo/name.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/creditmemo/name.phtml index 1a6dd5876d8..a16752d3117 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/creditmemo/name.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/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/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/invoice/name.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/invoice/name.phtml index 842162bb61d..5560fc0105b 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/invoice/name.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/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/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/name.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/name.phtml index 5cbcc45b3ec..a8a491aa736 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/name.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/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/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/create/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/create/items/renderer/downloadable.phtml index 05155c84db4..71e12eec562 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/create/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/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/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/view/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/view/items/renderer/downloadable.phtml index 869e7330851..12b8887674f 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/view/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/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/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/create/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/create/items/renderer/downloadable.phtml index 76cb666b715..2636b6ae8f2 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/create/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/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/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/view/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/view/items/renderer/downloadable.phtml index 8961bfc6e6c..ed8ffb1dcbc 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/view/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/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/code/core/Mage/Downloadable/view/adminhtml/sales/order/view/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/view/items/renderer/downloadable.phtml index e33a76e9727..250292ef716 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/view/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/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/code/core/Mage/Downloadable/view/frontend/catalog/product/links.phtml b/app/code/core/Mage/Downloadable/view/frontend/catalog/product/links.phtml index 3abc3e9b67f..1990633d59b 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/catalog/product/links.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/catalog/product/links.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/code/core/Mage/Downloadable/view/frontend/catalog/product/samples.phtml b/app/code/core/Mage/Downloadable/view/frontend/catalog/product/samples.phtml index 62c4385b795..8a7393f0dfa 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/catalog/product/samples.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/catalog/product/samples.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/code/core/Mage/Downloadable/view/frontend/catalog/product/type.phtml b/app/code/core/Mage/Downloadable/view/frontend/catalog/product/type.phtml index 569eeedf9b0..b381c98cc6d 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/catalog/product/type.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/catalog/product/type.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/code/core/Mage/Downloadable/view/frontend/checkout/cart/item/default.phtml b/app/code/core/Mage/Downloadable/view/frontend/checkout/cart/item/default.phtml index b2d8d952000..054f55de883 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/checkout/cart/item/default.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/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) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/checkout/multishipping/item/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/checkout/multishipping/item/downloadable.phtml index d25914d34ee..73ffac95965 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/checkout/multishipping/item/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/checkout/multishipping/item/downloadable.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/code/core/Mage/Downloadable/view/frontend/checkout/onepage/review/item.phtml b/app/code/core/Mage/Downloadable/view/frontend/checkout/onepage/review/item.phtml index 725759a9045..5f85113c65e 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/checkout/onepage/review/item.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/checkout/onepage/review/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/code/core/Mage/Downloadable/view/frontend/checkout/success.phtml b/app/code/core/Mage/Downloadable/view/frontend/checkout/success.phtml index c4b3ddefb33..9fc74f1183a 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/checkout/success.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/checkout/success.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/code/core/Mage/Downloadable/view/frontend/customer/products/list.phtml b/app/code/core/Mage/Downloadable/view/frontend/customer/products/list.phtml index fa54a338945..50321115c24 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/customer/products/list.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/customer/products/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/code/core/Mage/Downloadable/view/frontend/email/order/items/creditmemo/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/email/order/items/creditmemo/downloadable.phtml index b1590cfb53a..729904f0a65 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/email/order/items/creditmemo/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/email/order/items/creditmemo/downloadable.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/code/core/Mage/Downloadable/view/frontend/email/order/items/invoice/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/email/order/items/invoice/downloadable.phtml index 6b637e0ec21..fb31c2be86c 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/email/order/items/invoice/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/email/order/items/invoice/downloadable.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/code/core/Mage/Downloadable/view/frontend/email/order/items/order/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/email/order/items/order/downloadable.phtml index 8f62710a055..43208909395 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/email/order/items/order/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/email/order/items/order/downloadable.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/code/core/Mage/Downloadable/view/frontend/layout.xml b/app/code/core/Mage/Downloadable/view/frontend/layout.xml index ea9e6265643..b2027683563 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/layout.xml +++ b/app/code/core/Mage/Downloadable/view/frontend/layout.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/code/core/Mage/Downloadable/view/frontend/sales/order/creditmemo/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/sales/order/creditmemo/items/renderer/downloadable.phtml index 9e3097c3a82..69ba0414875 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/sales/order/creditmemo/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/sales/order/creditmemo/items/renderer/downloadable.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/code/core/Mage/Downloadable/view/frontend/sales/order/invoice/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/sales/order/invoice/items/renderer/downloadable.phtml index ffea05d9a9a..906456c28a1 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/sales/order/invoice/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/sales/order/invoice/items/renderer/downloadable.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/code/core/Mage/Downloadable/view/frontend/sales/order/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/sales/order/items/renderer/downloadable.phtml index c03156964c0..c2887e0b259 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/sales/order/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/sales/order/items/renderer/downloadable.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/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Js.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Js.php index 9d0fecaf413..e4950b2b243 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 60322d71216..35ced5eddc6 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) */ @@ -84,8 +84,7 @@ abstract class Mage_Eav_Block_Adminhtml_Attribute_Edit_Main_Abstract extends Mag 'name' => 'attribute_code', 'label' => Mage::helper('Mage_Eav_Helper_Data')->__('Attribute Code'), 'title' => Mage::helper('Mage_Eav_Helper_Data')->__('Attribute Code'), - 'note' => Mage::helper('Mage_Eav_Helper_Data')->__('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('Mage_Eav_Helper_Data')->__('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, )); @@ -221,4 +220,4 @@ abstract class Mage_Eav_Block_Adminhtml_Attribute_Edit_Main_Abstract extends Mag return $html.$jsScripts; } -} +} \ No newline at end of file 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 d1bf6ad9ad7..2ea3858095f 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 02c8e5f03a6..0aabf96202e 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 7792d9e7cd3..7784d2acb94 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 5087b4c8763..108daeecc13 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 2aac705c16b..3d290dc7c57 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 5d8c75f4d05..87c77fe90fa 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 6f15a705bcc..c5824b5ad27 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 608649220b6..858a47fbfaf 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 5a551163193..6fca8fc639e 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 c1d34404dc7..03d4d75263e 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 873f1827657..58d39a0d3c5 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) */ @@ -83,21 +83,11 @@ class Mage_Eav_Model_Attribute_Data_Date extends Mage_Eav_Model_Attribute_Data_A || (!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('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_Data')->__('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/Attribute/Data/File.php b/app/code/core/Mage/Eav/Model/Attribute/Data/File.php index b5390162004..c088bf89f40 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 7bf90918015..50735437d03 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 0a59b32b53a..7c641ca7aee 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 f9ff2362745..b54f532c3da 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 9d615f45889..25976497523 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 b914b6baf9a..675ca38bfa9 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 a8130fdc02a..c48ed593202 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 18e17505fa2..bcc02692d38 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 a040c7378c5..48b5463ebf0 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 f8903c0cb0a..46c46f27471 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 a3c5bf00436..21950413ee5 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 903837e938c..64cca5ddadc 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 2fcec28d972..8adf262b1f6 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 215f4714efb..a246587a682 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) */ @@ -1074,7 +1074,7 @@ abstract class Mage_Eav_Model_Entity_Abstract extends Mage_Core_Model_Resource_A 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; @@ -1213,11 +1213,11 @@ abstract class Mage_Eav_Model_Entity_Abstract extends Mage_Core_Model_Resource_A 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.php b/app/code/core/Mage/Eav/Model/Entity/Attribute.php index 2825fdba99c..498b603b9e8 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 25b23744ab3..495626093bd 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 2971511cc1b..fdeb8038d6d 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) */ @@ -32,7 +32,8 @@ * @package Mage_Eav * @author Magento Core Team <core@magentocommerce.com> */ -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 @@ abstract class Mage_Eav_Model_Entity_Attribute_Backend_Abstract implements Mage_ } /** - * 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 @@ abstract class Mage_Eav_Model_Entity_Attribute_Backend_Abstract implements Mage_ } /** - * 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/Array.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Array.php index bdc2056445b..ea532dea51f 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 f30ed4d7552..d7c8a49dbe5 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 c883557e7a0..5678e432e35 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 fe792813c4e..7078d08af7b 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 32f2863c181..6d8f90667a1 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) */ @@ -45,4 +45,19 @@ interface Mage_Eav_Model_Entity_Attribute_Backend_Interface 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/Attribute/Backend/Serialized.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Serialized.php index 2d8474cfb34..e2e689f5a26 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 7cc60a8750b..f6edd877a94 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 e960ce23dc9..29a141338ba 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 3233ff83220..0c3b06395ff 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 1c7dc0dde96..17298c96255 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 b8368a58502..5998e01e958 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 0e63a1c92bd..7b9e8c88dab 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 5d07cf217b2..38a62fa9405 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 28a65079340..f9bba5102cb 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 3cd6edf0d63..09430d4d7d4 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 e855040aa4c..27d0feed939 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 7d56c0fbcc1..25cb8d40d0d 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 1222b2e4e1d..fae6b3a1ad0 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 33cce81deab..51ca14f3adf 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 @@ abstract class Mage_Eav_Model_Entity_Attribute_Source_Abstract /** * 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 752420bddbd..94f3d18d670 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 5e1ded8324a..aea52b27234 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 26a648fdde2..fb17a3c7902 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 78d891099c0..749d45fedd1 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 5f433cef4b8..d7fc393b65e 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 465a6b99c34..007095af3bb 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 d8d0a88e28a..3a720d006f3 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) */ 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 9a55e8b371d..b4328a9b176 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 3da551c0fc3..63d63f77b36 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 0b93c64b65f..e190c60d453 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 679c4d46db7..d4cfd0ba292 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 f469e3992dc..92323ee2d7b 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 849d1358111..4c237911c68 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) */ @@ -1296,8 +1296,8 @@ class Mage_Eav_Model_Entity_Setup extends Mage_Core_Model_Resource_Setup 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,11 +1333,15 @@ class Mage_Eav_Model_Entity_Setup extends Mage_Core_Model_Resource_Setup ->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')) + 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) diff --git a/app/code/core/Mage/Eav/Model/Entity/Store.php b/app/code/core/Mage/Eav/Model/Entity/Store.php index b059d462293..99a60ecdf10 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 20bed90fbcc..239763b7fb0 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 f6255311c7f..a9200550d41 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 c5b94775639..226accd722c 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 a4255c617e8..83dff440879 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 62befe767e9..b4104b5a7ba 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/Resource/Attribute.php b/app/code/core/Mage/Eav/Model/Resource/Attribute.php index 8f66606ab00..e291b79f28f 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 a1a902800de..36097797f32 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 @@ abstract class Mage_Eav_Model_Resource_Attribute_Collection } /** - * 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 e59f7eba5dd..f1f67acd7e6 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 19f924534a0..b9934fa1e5d 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 a115d4dc978..3131702ad95 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 dbdcd4be107..ad643e2e079 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 3010d2ca1b0..d17de2a0c87 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 18648c559e0..1d15ae8b0f8 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 978e088cbe9..22f5f3f6814 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) */ 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 b4d7e86c076..eb43771212e 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 c21cfc9c152..b33344dc478 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 9b5d8ee31a3..0c5a3bfad10 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 c44fcb02827..c0881631fd9 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 15ae5d9a1f7..3d7d4fce189 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 1b579304a68..2f15ba09e82 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 5b9d75b42dd..23ea584571d 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 09256c41889..25fd43fa58f 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 d810e00b44c..fdf4222cb02 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 c78429cc62d..739f66e894c 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 b7d310ea7cd..c5733e49b60 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 e6b7288aca4..64606aed889 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 f1b0a923736..50da39b0ed3 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 a652c6839af..e328656a898 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 c4a928fe16d..03a08a7643d 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 f493488eaa6..132aa12359a 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/view/adminhtml/attribute/edit/js.phtml b/app/code/core/Mage/Eav/view/adminhtml/attribute/edit/js.phtml index 2acd065758f..06b9fcb86a2 100644 --- a/app/code/core/Mage/Eav/view/adminhtml/attribute/edit/js.phtml +++ b/app/code/core/Mage/Eav/view/adminhtml/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/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 fbec821c350..e63e3f77115 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 4493cf2c94d..9d62b1e5911 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 aa68d28548c..1b33f576b64 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 1283d4bc49d..dcc5bb8c7bd 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 a3ddbe355b9..5c821418001 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 1ae7f4cde2d..86e57804acd 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 8c5b7c05eb7..1c073ddf215 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/Inline.php b/app/code/core/Mage/GiftMessage/Block/Message/Inline.php index 390876f4a49..152aaeb3719 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 db5be0b396a..302035c415b 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 8135313b37b..486a09d2829 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 60f7cd93015..347b89c8e89 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 d8c6998eb2b..e6c2b2f2f4a 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 62c9d32216e..f90d06a1a25 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/Message.php b/app/code/core/Mage/GiftMessage/Model/Message.php index 36bed7d9b22..b18812a8620 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/Observer.php b/app/code/core/Mage/GiftMessage/Model/Observer.php index 6874b52e2e3..1f82727a9c8 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 b40d03c129c..13a0137ee98 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 9c9264ee9ac..e76924483d5 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 f5f4560d642..b75bed35cc2 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/etc/api.xml b/app/code/core/Mage/GiftMessage/etc/api.xml index 638ff941c9f..0363221dce2 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 1c72c6915e0..ae3e9fada05 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 25e7fba7662..f3fd8de93c0 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 feb3008dc24..721477018c1 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/view/adminhtml/form.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/form.phtml index 740b651c449..b5a2de4221f 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/form.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/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/code/core/Mage/GiftMessage/view/adminhtml/giftoptionsform.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/giftoptionsform.phtml index 3b899780534..57d211cdc6d 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/giftoptionsform.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/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/code/core/Mage/GiftMessage/view/adminhtml/helper.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/helper.phtml index 55abca1d776..62e53886cb2 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/helper.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/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/code/core/Mage/GiftMessage/view/adminhtml/layout.xml b/app/code/core/Mage/GiftMessage/view/adminhtml/layout.xml index b8b559a0c74..d487fd3e5f9 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/layout.xml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/layout.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/code/core/Mage/GiftMessage/view/adminhtml/popup.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/popup.phtml index 0bce6a97087..7c9e0386770 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/popup.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/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 @@ <?php echo $this->getChildHtml();?> </div> <div class="buttons-set a-right"> - <button type="button" class="scalable" id="gift_options_cancel_button"><span><?php echo Mage::helper('Mage_GiftMessage_Helper_Data')->__('Cancel'); ?></span></button> - <button type="button" class="scalable" id="gift_options_ok_button"><span><?php echo Mage::helper('Mage_GiftMessage_Helper_Data')->__('OK'); ?></span></button> + <button type="button" class="scalable" id="gift_options_cancel_button"><span><span><span><?php echo Mage::helper('Mage_GiftMessage_Helper_Data')->__('Cancel'); ?></span></span></span></button> + <button type="button" class="scalable" id="gift_options_ok_button"><span><span><span><?php echo Mage::helper('Mage_GiftMessage_Helper_Data')->__('OK'); ?></span></span></span></button> </div> </div> </div> diff --git a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/giftoptions.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/giftoptions.phtml index f1f160b5579..34e6a1aa117 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/giftoptions.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/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/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/items.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/items.phtml index a09e365317e..b68eda9fdd6 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/items.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/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/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/giftoptions.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/giftoptions.phtml index 8d74bfe6c91..0531d9385c8 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/giftoptions.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/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/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/items.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/items.phtml index 34b1e6fdd03..5212bea1379 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/items.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/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/code/core/Mage/GiftMessage/view/frontend/inline.phtml b/app/code/core/Mage/GiftMessage/view/frontend/inline.phtml index 1c5362f8712..e4b362e21ac 100644 --- a/app/code/core/Mage/GiftMessage/view/frontend/inline.phtml +++ b/app/code/core/Mage/GiftMessage/view/frontend/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/code/core/Mage/GoogleAnalytics/Block/Ga.php b/app/code/core/Mage/GoogleAnalytics/Block/Ga.php index 2b5e41b1597..b3222cd3cf0 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 bc988e3b115..0c7c044b082 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 bfa7623235f..a227e3856d5 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 dcde4d20aa9..ccd25751f23 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 7ddfe805fe8..7a172ae45c9 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 16b486eb814..1c225eed508 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/GoogleAnalytics/view/frontend/ga.phtml b/app/code/core/Mage/GoogleAnalytics/view/frontend/ga.phtml index c1bd50fcb80..e9f935c425d 100644 --- a/app/code/core/Mage/GoogleAnalytics/view/frontend/ga.phtml +++ b/app/code/core/Mage/GoogleAnalytics/view/frontend/ga.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/code/core/Mage/GoogleAnalytics/view/frontend/layout.xml b/app/code/core/Mage/GoogleAnalytics/view/frontend/layout.xml index 1208bbc8a8c..afd85b58dbe 100644 --- a/app/code/core/Mage/GoogleAnalytics/view/frontend/layout.xml +++ b/app/code/core/Mage/GoogleAnalytics/view/frontend/layout.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/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php index 44c8143f276..576e03ff8ae 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 a873bef4825..b2bdf61092f 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 3cfde4b2fdd..18a8b241d64 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 a42816fb4d6..94edf92edb0 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 71f735f5915..f9b65758f53 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 4eac7748c14..208c1dcc8df 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 674a4c29338..d422bd2ed40 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 612096adca4..6de48f17e7b 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 2404ff7e9bc..d1a984c0647 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 1cd55dd7f66..b10ff30e0f6 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 c8f9a92fb4c..5cf439b2260 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 4d5126ce994..403ade7355c 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 @@ class Mage_GoogleCheckout_Model_Api_Xml_Callback extends Mage_GoogleCheckout_Mod 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'))) { 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 9171e3e274d..45a8254ca57 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) */ @@ -889,10 +889,7 @@ EOT; { $customerGroup = $this->getQuote()->getCustomerGroupId(); if (!$customerGroup) { - $customerGroup = Mage::getStoreConfig( - Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, - $this->getQuote()->getStoreId() - ); + $customerGroup = Mage::helper('Mage_Customer_Helper_Data')->getDefaultCustomerGroupId($this->getQuote()->getStoreId()); } return Mage::getModel('Mage_Customer_Model_Group')->load($customerGroup)->getTaxClassId(); } 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 00e5c458531..bc2a651d03b 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/Notification.php b/app/code/core/Mage/GoogleCheckout/Model/Notification.php index 24f5d10cadd..dd59405f76c 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 5c7b9c04ec7..ce7b29765a4 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 @@ class Mage_GoogleCheckout_Model_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('Mage_GoogleCheckout_Model_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 ce71eb4f785..26a9746c717 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) */ @@ -59,7 +59,7 @@ class Mage_GoogleCheckout_Model_Payment extends Mage_Payment_Model_Method_Abstra /** * Return Order Place Redirect URL * - * @return string Order Redirect URL + * @return string Order Redirect URL */ public function getOrderPlaceRedirectUrl() { @@ -114,21 +114,15 @@ class Mage_GoogleCheckout_Model_Payment extends Mage_Payment_Model_Method_Abstra /** * 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('Mage_GoogleCheckout_Helper_Data'); - -// 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('Mage_GoogleCheckout_Helper_Data')->__('No Reason'); + $comment = $this->getComment() ? $this->getComment() : Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('No Comment'); $api = Mage::getModel('Mage_GoogleCheckout_Model_Api')->setStoreId($payment->getOrder()->getStoreId()); $api->refund($payment->getOrder()->getExtOrderId(), $amount, $reason, $comment); @@ -146,15 +140,15 @@ class Mage_GoogleCheckout_Model_Payment extends Mage_Payment_Model_Method_Abstra /** * 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('Mage_GoogleCheckout_Helper_Data'); - $reason = $this->getReason() ? $this->getReason() : $hlp->__('Unknown Reason'); - $comment = $this->getComment() ? $this->getComment() : $hlp->__('No Comment'); + $reason = $this->getReason() ? $this->getReason() : Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Unknown Reason'); + $comment = $this->getComment() ? $this->getComment() : Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('No Comment'); $api = Mage::getModel('Mage_GoogleCheckout_Model_Api')->setStoreId($payment->getOrder()->getStoreId()); $api->cancel($payment->getOrder()->getExtOrderId(), $reason, $comment); @@ -164,10 +158,11 @@ class Mage_GoogleCheckout_Model_Payment extends Mage_Payment_Model_Method_Abstra } /** - * 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 @@ class Mage_GoogleCheckout_Model_Payment extends Mage_Payment_Model_Method_Abstra $storeId = $this->getStore(); } $path = 'google/checkout/' . $field; + return Mage::getStoreConfig($path, $storeId); } 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 0f24f4e50dd..1366b9036b6 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 64938f725d9..165994d9d78 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 69dd547e909..b5e95ac00ee 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 ec0fddd8bff..9f48d4288a4 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/Shipping.php b/app/code/core/Mage/GoogleCheckout/Model/Shipping.php index c29aeb6f7b1..e6c8516671f 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 477d336bce6..daa4901d439 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 43edb5c08f2..61ec727477d 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 fc4531e8cd4..014e9340580 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) */ @@ -29,31 +29,30 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Carrier { public function toOptionArray() { - $hlp = Mage::helper('Mage_GoogleCheckout_Helper_Data'); 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('Mage_GoogleCheckout_Helper_Data')->__('FedEx'), 'value' => array( + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Ground'), 'value' => 'FedEx/Ground'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Home Delivery'), 'value' => 'FedEx/Home Delivery'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Express Saver'), 'value' => 'FedEx/Express Saver'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('First Overnight'), 'value' => 'FedEx/First Overnight'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Priority Overnight'), 'value' => 'FedEx/Priority Overnight'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Standard Overnight'), 'value' => 'FedEx/Standard Overnight'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('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('Mage_GoogleCheckout_Helper_Data')->__('UPS'), 'value' => array( + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Next Day Air'), 'value' => 'UPS/Next Day Air'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Next Day Air Early AM'), 'value' => 'UPS/Next Day Air Early AM'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Next Day Air Saver'), 'value' => 'UPS/Next Day Air Saver'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('2nd Day Air'), 'value' => 'UPS/2nd Day Air'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('2nd Day Air AM'), 'value' => 'UPS/2nd Day Air AM'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('3 Day Select'), 'value' => 'UPS/3 Day Select'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('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('Mage_GoogleCheckout_Helper_Data')->__('USPS'), 'value' => array( + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Express Mail'), 'value' => 'USPS/Express Mail'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Priority Mail'), 'value' => 'USPS/Priority Mail'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Parcel Post'), 'value' => 'USPS/Parcel Post'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('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 a411f8e1f34..b4271ba3201 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) */ @@ -29,10 +29,9 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Category { public function toOptionArray() { - $hlp = Mage::helper('Mage_GoogleCheckout_Helper_Data'); return array( - array('value' => 'COMMERCIAL', 'label' => $hlp->__('Commercial')), - array('value' => 'RESIDENTIAL', 'label' => $hlp->__('Residential')), + array('value' => 'COMMERCIAL', 'label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Commercial')), + array('value' => 'RESIDENTIAL', 'label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('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 9f8e45d1042..2eddc3825fa 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) */ @@ -29,9 +29,8 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Units { public function toOptionArray() { - $hlp = Mage::helper('Mage_GoogleCheckout_Helper_Data'); return array( - array('value' => 'IN', 'label' => $hlp->__('Inches')), + array('value' => 'IN', 'label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('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 dfb5a0935a1..f47649e16ae 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) */ @@ -29,11 +29,10 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Virtual_Method { public function toOptionArray() { - $hlp = Mage::helper('Mage_GoogleCheckout_Helper_Data'); 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('Mage_GoogleCheckout_Helper_Data')->__('Email delivery')), + // array('value'=>'key_url', 'label'=> Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Key/URL delivery')), + // array('value'=>'description_based', 'label'=> Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('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 90c5ca0c6ed..c5c55bbe8d1 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) */ @@ -29,10 +29,9 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Virtual_Schedule { public function toOptionArray() { - $hlp = Mage::helper('Mage_GoogleCheckout_Helper_Data'); return array( - array('value' => 'OPTIMISTIC', 'label' => $hlp->__('Optimistic')), - array('value' => 'PESSIMISTIC', 'label' => $hlp->__('Pessimistic')), + array('value' => 'OPTIMISTIC', 'label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Optimistic')), + array('value' => 'PESSIMISTIC', 'label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Pessimistic')), ); } } diff --git a/app/code/core/Mage/GoogleCheckout/controllers/ApiController.php b/app/code/core/Mage/GoogleCheckout/controllers/ApiController.php index c90ce6b0b37..655b37d4fed 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 340b437b6a8..82faa14ff01 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) */ diff --git a/app/code/core/Mage/GoogleCheckout/etc/adminhtml.xml b/app/code/core/Mage/GoogleCheckout/etc/adminhtml.xml index 02ef7509ed0..a519c218b40 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 93835a5a5e2..4760de94abd 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 62f3fdfb417..8ca1c73c0d4 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 d850163da40..cb55afc74df 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/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/upgrade-1.6.0.0-1.6.0.1.php index 4799c84e4b2..658cc33c69a 100644 --- a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/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/GoogleCheckout/view/frontend/form.phtml b/app/code/core/Mage/GoogleCheckout/view/frontend/form.phtml index 870a7f07f30..be561d9e1dd 100644 --- a/app/code/core/Mage/GoogleCheckout/view/frontend/form.phtml +++ b/app/code/core/Mage/GoogleCheckout/view/frontend/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/code/core/Mage/GoogleCheckout/view/frontend/layout.xml b/app/code/core/Mage/GoogleCheckout/view/frontend/layout.xml index 70bd4c94d20..d1a5e6dd6f6 100644 --- a/app/code/core/Mage/GoogleCheckout/view/frontend/layout.xml +++ b/app/code/core/Mage/GoogleCheckout/view/frontend/layout.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/code/core/Mage/GoogleCheckout/view/frontend/link.phtml b/app/code/core/Mage/GoogleCheckout/view/frontend/link.phtml index 06d6a48d13c..46d60a0469d 100644 --- a/app/code/core/Mage/GoogleCheckout/view/frontend/link.phtml +++ b/app/code/core/Mage/GoogleCheckout/view/frontend/link.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/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php index b5ea526d959..4c96f6552f9 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Form/Renderer/Import.php b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Form/Renderer/Import.php index 3072e7f5af5..9b5c4372f96 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Form/Renderer/Import.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Form/Renderer/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php index 5b26c8948bc..72a4bc53721 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Enable.php b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Enable.php index 1f579512f73..1bd44a05b79 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Enable.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Enable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Renderer/Conversion.php b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Renderer/Conversion.php index 13e9124602e..f5f8669637a 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Renderer/Conversion.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Renderer/Conversion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Tab/Googleoptimizer.php b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Tab/Googleoptimizer.php index dc594b46b10..7baef19296c 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Tab/Googleoptimizer.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Tab/Googleoptimizer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Code.php b/app/code/core/Mage/GoogleOptimizer/Block/Code.php index 7f42340cf21..9c2c4b667f8 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Code.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Code.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Code/Category.php b/app/code/core/Mage/GoogleOptimizer/Block/Code/Category.php index d9a6c54ab55..aa5b89bfe18 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Code/Category.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Code/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Code/Conversion.php b/app/code/core/Mage/GoogleOptimizer/Block/Code/Conversion.php index 9e080ede0f1..40d99663196 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Code/Conversion.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Code/Conversion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Code/Page.php b/app/code/core/Mage/GoogleOptimizer/Block/Code/Page.php index f61fddf58f2..0be2641581b 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Code/Page.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Code/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Code/Product.php b/app/code/core/Mage/GoogleOptimizer/Block/Code/Product.php index 5ba6892fa3d..419713de7a1 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Code/Product.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Code/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Js.php b/app/code/core/Mage/GoogleOptimizer/Block/Js.php index c05909cccaf..00266209c4d 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Js.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Helper/Data.php b/app/code/core/Mage/GoogleOptimizer/Helper/Data.php index fd9139f2b46..d438498ea2c 100644 --- a/app/code/core/Mage/GoogleOptimizer/Helper/Data.php +++ b/app/code/core/Mage/GoogleOptimizer/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Adminhtml/System/Config/Source/Googleoptimizer/Conversionpages.php b/app/code/core/Mage/GoogleOptimizer/Model/Adminhtml/System/Config/Source/Googleoptimizer/Conversionpages.php index f15df514fc8..01661c81b1c 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Adminhtml/System/Config/Source/Googleoptimizer/Conversionpages.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Adminhtml/System/Config/Source/Googleoptimizer/Conversionpages.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Code.php b/app/code/core/Mage/GoogleOptimizer/Model/Code.php index d58c230aba5..87b4dd7fdd3 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Code.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Code.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Code/Category.php b/app/code/core/Mage/GoogleOptimizer/Model/Code/Category.php index 3240a51d6bc..a192794b409 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Code/Category.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Code/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Code/Page.php b/app/code/core/Mage/GoogleOptimizer/Model/Code/Page.php index a9a1da973f0..48170645ef9 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Code/Page.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Code/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Code/Product.php b/app/code/core/Mage/GoogleOptimizer/Model/Code/Product.php index 05b5b67278f..1048a0793a3 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Code/Product.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Code/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Observer.php b/app/code/core/Mage/GoogleOptimizer/Model/Observer.php index e51cbb00360..e9685678d0c 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Observer.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code.php b/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code.php index 2f33e0c4775..9dc49e3b29e 100755 --- a/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code/Collection.php b/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code/Collection.php index c58b9fcb56a..954a2e72dfa 100755 --- a/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code/Collection.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/controllers/Adminhtml/Googleoptimizer/IndexController.php b/app/code/core/Mage/GoogleOptimizer/controllers/Adminhtml/Googleoptimizer/IndexController.php index a9b49b8e21d..830a1b6b12c 100755 --- a/app/code/core/Mage/GoogleOptimizer/controllers/Adminhtml/Googleoptimizer/IndexController.php +++ b/app/code/core/Mage/GoogleOptimizer/controllers/Adminhtml/Googleoptimizer/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/etc/config.xml b/app/code/core/Mage/GoogleOptimizer/etc/config.xml index 2c8bb3349cc..49af1652ac6 100644 --- a/app/code/core/Mage/GoogleOptimizer/etc/config.xml +++ b/app/code/core/Mage/GoogleOptimizer/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/GoogleOptimizer/etc/system.xml b/app/code/core/Mage/GoogleOptimizer/etc/system.xml index 1f41724157f..e7eca6794c3 100644 --- a/app/code/core/Mage/GoogleOptimizer/etc/system.xml +++ b/app/code/core/Mage/GoogleOptimizer/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/GoogleOptimizer/sql/googleoptimizer_setup/install-1.6.0.0.php b/app/code/core/Mage/GoogleOptimizer/sql/googleoptimizer_setup/install-1.6.0.0.php index a0c9e7901a6..989a72706d6 100644 --- a/app/code/core/Mage/GoogleOptimizer/sql/googleoptimizer_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/GoogleOptimizer/sql/googleoptimizer_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/catalog/form/renderer/import.phtml b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/catalog/form/renderer/import.phtml index 10c59b6a67b..e7120c90f70 100644 --- a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/catalog/form/renderer/import.phtml +++ b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/catalog/form/renderer/import.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/code/core/Mage/GoogleOptimizer/view/adminhtml/cms/edit/renderer/conversion.phtml b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/cms/edit/renderer/conversion.phtml index 9202bc5efc9..b4e7ab340ae 100644 --- a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/cms/edit/renderer/conversion.phtml +++ b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/cms/edit/renderer/conversion.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/code/core/Mage/GoogleOptimizer/view/adminhtml/js.phtml b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/js.phtml index 82f52d1b1e3..5ea10532eeb 100644 --- a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/js.phtml +++ b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/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/code/core/Mage/GoogleOptimizer/view/adminhtml/layout.xml b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/layout.xml index cc86084cb0c..9cb3c1acbd3 100644 --- a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/layout.xml +++ b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/layout.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/code/core/Mage/GoogleOptimizer/view/frontend/layout.xml b/app/code/core/Mage/GoogleOptimizer/view/frontend/layout.xml index 793cabed497..2bc1db6b583 100644 --- a/app/code/core/Mage/GoogleOptimizer/view/frontend/layout.xml +++ b/app/code/core/Mage/GoogleOptimizer/view/frontend/layout.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/code/core/Mage/GoogleShopping/Block/Adminhtml/Captcha.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Captcha.php index cf731c46e42..522d4e8b4c1 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Captcha.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Captcha.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items.php index 6a333f85d07..25cfca23b8f 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Item.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Item.php index 1f59e2e40f1..df99a251c7a 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Item.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Product.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Product.php index 13cf5273899..237a115bab6 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Product.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Renderer/Id.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Renderer/Id.php index 28bff1c9aa5..ea1ba785c7d 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Renderer/Id.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Renderer/Id.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Store/Switcher.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Store/Switcher.php index 0ee7e7f85d2..8fd28c76f0e 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Store/Switcher.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Store/Switcher.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types.php index 750e68049db..a0f51ffa872 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit.php index 420f3aea059..44d8b933b8f 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php index a3c442bb9ed..b14c7e71336 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php index fe3e405ecd3..271de87a6c5 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Select.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Select.php index 45216c4938f..f3fbde5af28 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Select.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Grid.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Grid.php index ab4dad96400..49f597589df 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Grid.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Renderer/Country.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Renderer/Country.php index d624213343d..4ff1c27940c 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Renderer/Country.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Renderer/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Helper/Category.php b/app/code/core/Mage/GoogleShopping/Helper/Category.php index f5fb2ae65b8..5d1694c1b3f 100644 --- a/app/code/core/Mage/GoogleShopping/Helper/Category.php +++ b/app/code/core/Mage/GoogleShopping/Helper/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,4 +73,4 @@ class Mage_GoogleShopping_Helper_Category . '</a>' ); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/GoogleShopping/Helper/Data.php b/app/code/core/Mage/GoogleShopping/Helper/Data.php index 86a64b426ac..03fe4f5cdb1 100644 --- a/app/code/core/Mage/GoogleShopping/Helper/Data.php +++ b/app/code/core/Mage/GoogleShopping/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Helper/Price.php b/app/code/core/Mage/GoogleShopping/Helper/Price.php index a94e10057dd..e136f262058 100644 --- a/app/code/core/Mage/GoogleShopping/Helper/Price.php +++ b/app/code/core/Mage/GoogleShopping/Helper/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -116,4 +116,4 @@ class Mage_GoogleShopping_Helper_Price return $product->getPrice(); } } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/GoogleShopping/Helper/Product.php b/app/code/core/Mage/GoogleShopping/Helper/Product.php index 3290efbf7f9..26536c0cb7c 100644 --- a/app/code/core/Mage/GoogleShopping/Helper/Product.php +++ b/app/code/core/Mage/GoogleShopping/Helper/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute.php b/app/code/core/Mage/GoogleShopping/Model/Attribute.php index 184f0de1f91..131c55398ea 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Availability.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Availability.php index fe97f5b4135..7d807c24cbf 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Availability.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Availability.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Condition.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Condition.php index fe8fd8b6605..b535b918a94 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Condition.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Condition.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php index 9e572f00da4..1343bd6f266 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/ContentLanguage.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/ContentLanguage.php index a10c2f165f8..2eab1d31c79 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/ContentLanguage.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/ContentLanguage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php index 08e8c8a7b47..5b1071b776c 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -132,10 +132,9 @@ class Mage_GoogleShopping_Model_Attribute_Default extends Mage_GoogleShopping_Mo protected function _setAttribute($entry, $name, $type = self::ATTRIBUTE_TYPE_TEXT, $value = '', $unit = null) { if (is_object($value) || ((string)$value != $value)) { - Mage::throwException(Mage::helper('Mage_GoogleShopping_Helper_Data')->__( - 'The attribute "%s" has incorrect type for Google Shopping. The product with this attribute hasn\'t been updated in Google Content.', - $name - )); + Mage::throwException( + Mage::helper('Mage_GoogleShopping_Helper_Data')->__('The attribute "%s" has incorrect type for Google Shopping. The product with this attribute hasn\'t been updated in Google Content.', $name) + ); } $attribute = $entry->getContentAttributeByName($name); if ($attribute instanceof Varien_Gdata_Gshopping_Extension_Attribute) { diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Destinations.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Destinations.php index af27c6fbccd..51cf1ba5e99 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Destinations.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Destinations.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/GoogleProductCategory.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/GoogleProductCategory.php index a2fa49a6d79..cf3f3604984 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/GoogleProductCategory.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/GoogleProductCategory.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Id.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Id.php index 16c06964d4d..d597b84fc9d 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Id.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Id.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/ImageLink.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/ImageLink.php index 455c022a823..0174bfc53d4 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/ImageLink.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/ImageLink.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Link.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Link.php index 2dfe3374e0c..fe22ba4db07 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Link.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Price.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Price.php index 678bd4cd20b..af7f1da09f1 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Price.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 +43,9 @@ class Mage_GoogleShopping_Model_Attribute_Price extends Mage_GoogleShopping_Mode public function convertAttribute($product, $entry) { $product->setWebsiteId(Mage::app()->getStore($product->getStoreId())->getWebsiteId()); - $product->setCustomerGroupId(Mage::getStoreConfig('customer/create_account/default_group', $product->getStoreId())); + $product->setCustomerGroupId( + Mage::getStoreConfig(Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, $product->getStoreId()) + ); $store = Mage::app()->getStore($product->getStoreId()); $targetCountry = Mage::getSingleton('Mage_GoogleShopping_Model_Config')->getTargetCountry($product->getStoreId()); @@ -93,7 +95,9 @@ class Mage_GoogleShopping_Model_Attribute_Price extends Mage_GoogleShopping_Mode $effectiveDate = $this->getGroupAttributeSalePriceEffectiveDate(); if (!is_null($effectiveDate)) { - $effectiveDate->setGroupAttributeSalePriceEffectiveDateFrom($this->getGroupAttributeSalePriceEffectiveDateFrom()) + $effectiveDate->setGroupAttributeSalePriceEffectiveDateFrom( + $this->getGroupAttributeSalePriceEffectiveDateFrom() + ) ->setGroupAttributeSalePriceEffectiveDateTo($this->getGroupAttributeSalePriceEffectiveDateTo()) ->convertAttribute($product, $entry); } diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/ProductType.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/ProductType.php index 538c3a9f922..fb66b9d01e4 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/ProductType.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/ProductType.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Quantity.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Quantity.php index 42c7824741e..11ab66d6ac3 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Quantity.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Quantity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php index d84f4a478aa..5f4230091b5 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/ShippingWeight.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/ShippingWeight.php index 4b68f3e2bd3..e63705b718c 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/ShippingWeight.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/ShippingWeight.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/TargetCountry.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/TargetCountry.php index ede7f73589b..7e824dc25e4 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/TargetCountry.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/TargetCountry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Tax.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Tax.php index d5dda478aba..2f5fc5bb10c 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Tax.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Title.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Title.php index cec63db8d57..ea062499d75 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Title.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Title.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Config.php b/app/code/core/Mage/GoogleShopping/Model/Config.php index 7a3867c445d..7fbcd8961e0 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Config.php +++ b/app/code/core/Mage/GoogleShopping/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Item.php b/app/code/core/Mage/GoogleShopping/Model/Item.php index f31d169ae0a..fbde2e46e68 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Item.php +++ b/app/code/core/Mage/GoogleShopping/Model/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/MassOperations.php b/app/code/core/Mage/GoogleShopping/Model/MassOperations.php index 8be6cd11541..a1c74dc8e1c 100644 --- a/app/code/core/Mage/GoogleShopping/Model/MassOperations.php +++ b/app/code/core/Mage/GoogleShopping/Model/MassOperations.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,10 +84,7 @@ class Mage_GoogleShopping_Model_MassOperations } catch (Zend_Db_Statement_Exception $e) { if ($e->getCode() == self::ERROR_CODE_SQL_UNIQUE_INDEX) { $this->_getSession()->addError( - Mage::helper('Mage_GoogleShopping_Helper_Data')->__("The Google Content item for product '%s' (in '%s' store) has already exist.", - $product->getName(), - Mage::app()->getStore($product->getStoreId())->getName() - ) + Mage::helper('Mage_GoogleShopping_Helper_Data')->__("The Google Content item for product '%s' (in '%s' store) has already exist.", $product->getName(), Mage::app()->getStore($product->getStoreId())->getName()) ); } else { $this->_getSession()->addError($e->getMessage()); diff --git a/app/code/core/Mage/GoogleShopping/Model/Observer.php b/app/code/core/Mage/GoogleShopping/Model/Observer.php index 5a7b0e405c6..4d758bea7bb 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Observer.php +++ b/app/code/core/Mage/GoogleShopping/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute.php b/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute.php index 5a4efc1ebc4..f9a9524e368 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute.php +++ b/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute/Collection.php b/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute/Collection.php index a29e8f4d75c..12fc96c8e2f 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute/Collection.php +++ b/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Resource/Item.php b/app/code/core/Mage/GoogleShopping/Model/Resource/Item.php index 49b566a95b7..cbb49a20d9e 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Resource/Item.php +++ b/app/code/core/Mage/GoogleShopping/Model/Resource/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Resource/Item/Collection.php b/app/code/core/Mage/GoogleShopping/Model/Resource/Item/Collection.php index 1893b9ed973..1196731ce72 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Resource/Item/Collection.php +++ b/app/code/core/Mage/GoogleShopping/Model/Resource/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Resource/Type.php b/app/code/core/Mage/GoogleShopping/Model/Resource/Type.php index c531e0cab3d..8b4ab1632e9 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Resource/Type.php +++ b/app/code/core/Mage/GoogleShopping/Model/Resource/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Resource/Type/Collection.php b/app/code/core/Mage/GoogleShopping/Model/Resource/Type/Collection.php index 4dd5e0da905..77719ce24f0 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Resource/Type/Collection.php +++ b/app/code/core/Mage/GoogleShopping/Model/Resource/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,18 @@ class Mage_GoogleShopping_Model_Resource_Type_Collection extends Mage_Core_Model return $this; } + /** + * Get SQL for get record count + * + * @return Varien_Db_Select + */ + public function getSelectCountSql() + { + $this->_renderFilters(); + $paginatorAdapter = new Zend_Paginator_Adapter_DbSelect($this->getSelect()); + return $paginatorAdapter->getCountSelect(); + } + /** * Add total count of Items for each type * diff --git a/app/code/core/Mage/GoogleShopping/Model/Service.php b/app/code/core/Mage/GoogleShopping/Model/Service.php index 6892a3b2f8c..1442d9e9730 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Service.php +++ b/app/code/core/Mage/GoogleShopping/Model/Service.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Service/Item.php b/app/code/core/Mage/GoogleShopping/Model/Service/Item.php index 8711ac0b834..393755664ed 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Service/Item.php +++ b/app/code/core/Mage/GoogleShopping/Model/Service/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Source/Accounttype.php b/app/code/core/Mage/GoogleShopping/Model/Source/Accounttype.php index 7fc607bbf64..c25e8f96a84 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Source/Accounttype.php +++ b/app/code/core/Mage/GoogleShopping/Model/Source/Accounttype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Source/Authtype.php b/app/code/core/Mage/GoogleShopping/Model/Source/Authtype.php index 26c4299c0da..517b96f6d2e 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Source/Authtype.php +++ b/app/code/core/Mage/GoogleShopping/Model/Source/Authtype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Source/Country.php b/app/code/core/Mage/GoogleShopping/Model/Source/Country.php index a5058bbf656..7e6b85eb060 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Source/Country.php +++ b/app/code/core/Mage/GoogleShopping/Model/Source/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Source/Destinationstates.php b/app/code/core/Mage/GoogleShopping/Model/Source/Destinationstates.php index c06643cad5c..9002864f34b 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Source/Destinationstates.php +++ b/app/code/core/Mage/GoogleShopping/Model/Source/Destinationstates.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Source/Statuses.php b/app/code/core/Mage/GoogleShopping/Model/Source/Statuses.php index e645ba4fdf1..68abc7ff1b4 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Source/Statuses.php +++ b/app/code/core/Mage/GoogleShopping/Model/Source/Statuses.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Type.php b/app/code/core/Mage/GoogleShopping/Model/Type.php index 8fd819a3864..0ee2f7d6841 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Type.php +++ b/app/code/core/Mage/GoogleShopping/Model/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/ItemsController.php b/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/ItemsController.php index ef23e768c13..8f25a949651 100644 --- a/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/ItemsController.php +++ b/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/ItemsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 +76,7 @@ class Mage_GoogleShopping_Adminhtml_Googleshopping_ItemsController extends Mage_ if (!$this->_getConfig()->isValidDefaultCurrencyCode($this->_getStore()->getId())) { $_countryInfo = $this->_getConfig()->getTargetCountryInfo($this->_getStore()->getId()); $this->_getSession()->addNotice( - $this->__("The store's currency should be set to %s for %s in system configuration. Otherwise item prices won't be correct in Google Content.", $_countryInfo['currency_name'], $_countryInfo['name']) + Mage::helper('Mage_GoogleShopping_Helper_Data')->__("The store's currency should be set to %s for %s in system configuration. Otherwise item prices won't be correct in Google Content.", $_countryInfo['currency_name'], $_countryInfo['name']) ); } diff --git a/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/SelectionController.php b/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/SelectionController.php index dc4481b4ffb..746b654d252 100644 --- a/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/SelectionController.php +++ b/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/SelectionController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/TypesController.php b/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/TypesController.php index ff4110600ff..91ed72a7681 100644 --- a/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/TypesController.php +++ b/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/TypesController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/data/googleshopping_setup/data-install-1.6.0.0.php b/app/code/core/Mage/GoogleShopping/data/googleshopping_setup/data-install-1.6.0.0.php index 8eb4479cb40..663b498c7f1 100644 --- a/app/code/core/Mage/GoogleShopping/data/googleshopping_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/GoogleShopping/data/googleshopping_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/etc/adminhtml.xml b/app/code/core/Mage/GoogleShopping/etc/adminhtml.xml index 1e45eedeec2..1232cea22b2 100644 --- a/app/code/core/Mage/GoogleShopping/etc/adminhtml.xml +++ b/app/code/core/Mage/GoogleShopping/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/GoogleShopping/etc/config.xml b/app/code/core/Mage/GoogleShopping/etc/config.xml index 366567af591..c596e2de190 100644 --- a/app/code/core/Mage/GoogleShopping/etc/config.xml +++ b/app/code/core/Mage/GoogleShopping/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/GoogleShopping/etc/system.xml b/app/code/core/Mage/GoogleShopping/etc/system.xml index 370ef26ba6c..e88018be96d 100644 --- a/app/code/core/Mage/GoogleShopping/etc/system.xml +++ b/app/code/core/Mage/GoogleShopping/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/GoogleShopping/sql/googleshopping_setup/install-1.6.0.0.php b/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/install-1.6.0.0.php index b1bac37278f..904aaee0d25 100644 --- a/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/upgrade-1.6.0.0-1.6.0.0.1.php index 5115d89e9e1..b964c45e860 100644 --- a/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/upgrade-1.6.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/upgrade-1.6.0.0-1.6.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/view/adminhtml/captcha.phtml b/app/code/core/Mage/GoogleShopping/view/adminhtml/captcha.phtml index 9b0239ef3c9..382396575b6 100644 --- a/app/code/core/Mage/GoogleShopping/view/adminhtml/captcha.phtml +++ b/app/code/core/Mage/GoogleShopping/view/adminhtml/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/code/core/Mage/GoogleShopping/view/adminhtml/items.phtml b/app/code/core/Mage/GoogleShopping/view/adminhtml/items.phtml index 7999ef33b75..74ea839fe82 100644 --- a/app/code/core/Mage/GoogleShopping/view/adminhtml/items.phtml +++ b/app/code/core/Mage/GoogleShopping/view/adminhtml/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/code/core/Mage/GoogleShopping/view/adminhtml/types/edit.phtml b/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit.phtml index bce32d11093..a0a6af89686 100644 --- a/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit.phtml +++ b/app/code/core/Mage/GoogleShopping/view/adminhtml/types/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/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/attributes.phtml b/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/attributes.phtml index 49cfa7a9248..f5bcddd268c 100644 --- a/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/attributes.phtml +++ b/app/code/core/Mage/GoogleShopping/view/adminhtml/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/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/select.phtml b/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/select.phtml index abf2239a721..4fbb60956ab 100644 --- a/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/select.phtml +++ b/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/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/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit.php index 1b17b85d18c..2bc2459e642 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 319510517b1..dca9b6a9c4d 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 40e39fb7fc2..d7d259953e4 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) */ @@ -72,9 +72,8 @@ class Mage_ImportExport_Block_Adminhtml_Export_Filter extends Mage_Adminhtml_Blo $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; @@ -101,7 +100,7 @@ class Mage_ImportExport_Block_Adminhtml_Export_Filter extends Mage_Adminhtml_Blo protected function _getInputHtmlWithValue(Mage_Eav_Model_Entity_Attribute $attribute, $value) { $html = '<input type="text" name="' . $this->getFilterElementName($attribute->getAttributeCode()) - . '" class="input-text" style="width:274px;"'; + . '" class="input-text input-text-export-filter"'; if ($value) { $html .= ' value="' . $this->_helper->escapeHtml($value) . '"'; } @@ -134,9 +133,8 @@ class Mage_ImportExport_Block_Adminhtml_Export_Filter extends Mage_Adminhtml_Blo $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) @@ -164,11 +162,11 @@ class Mage_ImportExport_Block_Adminhtml_Export_Filter extends Mage_Adminhtml_Blo } return '<strong>' . $this->_helper->__('From') . ':</strong> ' - . '<input type="text" name="' . $name . '[]" class="input-text"' - . ' value="' . $fromValue . '" style="width:100px;"/> ' + . '<input type="text" name="' . $name . '[]" class="input-text input-text-range"' + . ' value="' . $fromValue . '"/> ' . '<strong>' . $this->_helper->__('To') . ':</strong> <input type="text" name="' . $name - . '[]" class="input-text" style="width:100px;" value="' . $toValue . '" />'; + . '[]" class="input-text input-text-range" value="' . $toValue . '" />'; } /** @@ -201,8 +199,7 @@ class Mage_ImportExport_Block_Adminhtml_Export_Filter extends Mage_Adminhtml_Blo $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 eedd3854611..830eb2b01dd 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 1b819a44a6e..c0ecefb189d 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 d47edc2afe9..5c6459670d2 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 @@ class Mage_ImportExport_Block_Adminhtml_Import_Frame_Result extends Mage_Adminht { return ' <button onclick="editForm.startImport(\'' . $this->getImportStartUrl() . '\', \'' . Mage_ImportExport_Model_Import::FIELD_NAME_SOURCE_FILE . '\');" class="scalable save"' - . ' type="button"><span>' . $this->__('Import') . '</span></button>'; + . ' type="button"><span><span><span>' . $this->__('Import') . '</span></span></span></button>'; } /** diff --git a/app/code/core/Mage/ImportExport/Helper/Data.php b/app/code/core/Mage/ImportExport/Helper/Data.php index 4b13bf6e7de..e75a9455d40 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 2a8e4f6fc8c..46800b5ad13 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 5bd0d989c88..44566030709 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 7fcd655fdc0..eaa88162f32 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 1edb0c41394..53e9e04b47e 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 f3735fcd6ef..56b05418639 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 dab1c69af9e..8b697754de6 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 5f6b6e0be98..fb357336870 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 a6a0bd76787..a44b4b8d789 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 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo return $rowTierPrices; } + /** + * Prepare products group prices + * + * @param array $productIds + * @return array + */ + protected function _prepareGroupPrices(array $productIds) + { + if (empty($productIds)) { + return array(); + } + $resource = Mage::getSingleton('Mage_Core_Model_Resource'); + $select = $this->_connection->select() + ->from($resource->getTableName('catalog_product_entity_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 * @@ -443,6 +476,7 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo $rowCategories = array(); $rowWebsites = array(); $rowTierPrices = array(); + $rowGroupPrices = array(); $rowMultiselects = array(); $mediaGalery = array(); @@ -466,8 +500,9 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo 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()); @@ -684,6 +719,7 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo '_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', @@ -728,6 +764,9 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo 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])); } @@ -775,6 +814,9 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo 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])); } @@ -804,6 +846,9 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo 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 c460bc169c7..ff7deea410c 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 e78478c9cb2..2244a1c1326 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 1619047ba68..105d51b110a 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 61063f6a7f0..9c05b66c5d9 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 70ed53a8098..bb57c009e75 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 a121385cd39..b24cb36e93c 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 67c0c014600..c17ef9f99ce 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 77eda2290f4..3186ae0d977 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 9dadc2b9ddf..ae932acb070 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) */ @@ -560,8 +560,8 @@ abstract class Mage_ImportExport_Model_Import_Entity_Abstract 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('Mage_Core_Helper_String')->cleanString($rowData[$attrCode]); 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 f0addf246e5..664958b2aa9 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 81af5d7907a..b7bf80c1e07 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) */ 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 ce1f0a08aa8..0487c6bf100 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', @@ -539,7 +543,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo } /** - * Check tier orice data validity. + * Check tier price data validity. * * @param array $rowData * @param int $rowNum @@ -575,6 +579,40 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo 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 * @@ -1081,6 +1119,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo $websites = array(); $categories = array(); $tierPrices = array(); + $groupPrices = array(); $mediaGallery = array(); $uploadedGalleryFiles = array(); $previousType = null; @@ -1135,12 +1174,22 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo 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) { @@ -1230,6 +1279,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo ->_saveProductWebsites($websites) ->_saveProductCategories($categories) ->_saveProductTierPrices($tierPrices) + ->_saveProductGroupPrices($groupPrices) ->_saveMediaGallery($mediaGallery) ->_saveProductAttributes($attributes); } @@ -1276,6 +1326,46 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo 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('Mage_ImportExport_Model_Import_Proxy_Product_Resource') + ->getTable('catalog_product_entity_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 */ @@ -1489,14 +1579,22 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo 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('Mage_CatalogInventory_Model_Stock_Item', $row); + $stockItem = Mage::getModel('Mage_CatalogInventory_Model_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()) { @@ -1642,6 +1740,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo $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 cd2c873b38d..3f6f1b8b830 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 df291eda30d..8e726bf5dcc 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 a806bd14e86..2c9b572bee8 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 952d0a297ed..f976f9e7811 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) */ 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 643c380c8cb..8b61bb4b988 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 c1f7bf1a983..3801e0adbf2 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 043b74bdb2b..8e68c8a93a6 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/Resource/Helper/Mysql4.php b/app/code/core/Mage/ImportExport/Model/Resource/Helper/Mysql4.php index d05cbfadc4d..78a4679955b 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_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.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 a93c267a455..721d8dda9f3 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) */ diff --git a/app/code/core/Mage/ImportExport/Model/Resource/Setup.php b/app/code/core/Mage/ImportExport/Model/Resource/Setup.php index 15962428feb..b848513f25e 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 a15166668d6..d6c0c642e73 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 d50ee0917e6..20ac1a5ecc4 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 65bfee45234..4459c24a577 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 78af736ea7a..1396aaf09b4 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 c05be7fe84c..3be90ca2465 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 19a9fb27153..527c87705ea 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) */ diff --git a/app/code/core/Mage/ImportExport/etc/adminhtml.xml b/app/code/core/Mage/ImportExport/etc/adminhtml.xml index 535563e3715..bd47e5fe268 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 5b4b4fe8f30..ac72c6491ca 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 ca9576dd3b7..e2b4edd1f8d 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-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 2249fc8165c..1b0b0820c11 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/ImportExport/view/adminhtml/busy.phtml b/app/code/core/Mage/ImportExport/view/adminhtml/busy.phtml index 456a88f946b..f15abae09f8 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/busy.phtml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/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/code/core/Mage/ImportExport/view/adminhtml/export/form/after.phtml b/app/code/core/Mage/ImportExport/view/adminhtml/export/form/after.phtml index 45be7497410..f04348a965e 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/export/form/after.phtml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/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 @@ <div id="export_filter_grid_container" class="fieldset"><!-- --></div> </form> <div class="a-right"> - <button class="scalable" type="button" onclick="getFile();"><span><?php echo $this->__('Continue') ?></span></button> + <button class="scalable" type="button" onclick="getFile();"><span><span><span><?php echo $this->__('Continue') ?></span></span></span></button> </div> </div> <script type="text/javascript"> diff --git a/app/code/core/Mage/ImportExport/view/adminhtml/export/form/before.phtml b/app/code/core/Mage/ImportExport/view/adminhtml/export/form/before.phtml index 9aa705bcf71..f98ad8011f0 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/export/form/before.phtml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/export/form/before.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,11 +37,13 @@ var url = "<?php echo $this->getUrl('*/*/getFilter') ?>"; url += ((url.slice(-1) != '/') ? '/' : '') + 'entity/' + $F('entity'); - new Ajax.Updater ('export_filter_grid_container', url, { + new Ajax.Request(url, { method: 'post', //parameters: $(this.formId).serialize(), evalScripts: true, - onComplete: function(){ + onComplete: function(transport) { + var responseText = transport.responseText.replace(/>\s+</g, '><'); + $('export_filter_grid_container').update(responseText); $('export_filter_container').show(); } }); diff --git a/app/code/core/Mage/ImportExport/view/adminhtml/import/form/after.phtml b/app/code/core/Mage/ImportExport/view/adminhtml/import/form/after.phtml index 64816a00eba..e8b8329fb25 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/import/form/after.phtml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/import/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) */ ?> diff --git a/app/code/core/Mage/ImportExport/view/adminhtml/import/form/before.phtml b/app/code/core/Mage/ImportExport/view/adminhtml/import/form/before.phtml index 7c4ee95464e..c29b9aa9e82 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/import/form/before.phtml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/import/form/before.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/code/core/Mage/ImportExport/view/adminhtml/import/frame/result.phtml b/app/code/core/Mage/ImportExport/view/adminhtml/import/frame/result.phtml index b57c31253f1..1f42546c80c 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/import/frame/result.phtml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/import/frame/result.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/code/core/Mage/ImportExport/view/adminhtml/layout.xml b/app/code/core/Mage/ImportExport/view/adminhtml/layout.xml index 08ca3580837..ce1e3f50ba6 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/layout.xml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/layout.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/Index/Block/Adminhtml/Notifications.php b/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php index 6dad93a0fb7..821351086f2 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 d0308f347da..384240a090d 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 1d8901fa645..b5f84495339 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 eb19e299516..0dde07ca2fa 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 1f4806efa96..dec5597b53c 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 d6d18ca7242..5da7eea7568 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 59e3900ed88..999be42e127 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 6250266a195..c712c91a7c7 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 f9f8cb37989..45b90c801eb 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 35a0095ac47..5030fd645eb 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) */ @@ -117,14 +117,10 @@ class Mage_Index_Model_Event extends Mage_Core_Model_Abstract 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; @@ -152,6 +148,37 @@ class Mage_Index_Model_Event extends Mage_Core_Model_Abstract 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 @@ -165,40 +192,61 @@ class Mage_Index_Model_Event extends Mage_Core_Model_Abstract $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('Mage_Index_Model_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) @@ -218,26 +266,13 @@ class Mage_Index_Model_Event extends Mage_Core_Model_Abstract /** * 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; } @@ -295,9 +330,7 @@ class Mage_Index_Model_Event extends Mage_Core_Model_Abstract */ 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 52e49f3e075..cf9b71bc238 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) */ @@ -203,26 +203,37 @@ class Mage_Index_Model_Indexer */ 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 ($process->getDepends()) { foreach ($process->getDepends() as $processCode) { $dependProcess = $this->getProcessByCode($processCode); if ($dependProcess && !in_array($processCode, $processed)) { - call_user_func_array(array($dependProcess, $method), $args); - $processed[] = $processCode; + 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; + } + } } } } - call_user_func_array(array($process, $method), $args); - - $processed[] = $code; + if (!$hasLocks) { + call_user_func_array(array($process, $method), $args); + $processed[] = $code; + } } } @@ -242,4 +253,4 @@ class Mage_Index_Model_Indexer } return $eventName; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Index/Model/Indexer/Abstract.php b/app/code/core/Mage/Index/Model/Indexer/Abstract.php index edd5adf4d88..04b5b0a0fa3 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/Observer.php b/app/code/core/Mage/Index/Model/Observer.php index 2d1d49095f1..f452948337f 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 4c115df6648..d806783d700 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) */ @@ -128,6 +128,9 @@ class Mage_Index_Model_Process extends Mage_Core_Model_Abstract $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; @@ -179,7 +182,9 @@ class Mage_Index_Model_Process extends Mage_Core_Model_Abstract /** @var $eventResource Mage_Index_Model_Resource_Event */ $eventResource = Mage::getResourceSingleton('Mage_Index_Model_Resource_Event'); - if ($eventsCollection->count() > 0 && $processStatus == self::STATUS_PENDING) { + if ($eventsCollection->count() > 0 && $processStatus == self::STATUS_PENDING + || $this->getForcePartialReindex() + ) { $this->_getResource()->beginTransaction(); try { $this->_processEventsCollection($eventsCollection, false); @@ -221,6 +226,11 @@ class Mage_Index_Model_Process extends Mage_Core_Model_Abstract return $this; } + /** @var $eventResource Mage_Index_Model_Resource_Event */ + $eventResource = Mage::getResourceSingleton('Mage_Index_Model_Resource_Event'); + $unprocessedEvents = $eventResource->getUnprocessedEvents($this); + $this->setForcePartialReindex(count($unprocessedEvents) > 0 && $this->getStatus() == self::STATUS_PENDING); + if ($this->getDepends()) { $indexer = Mage::getSingleton('Mage_Index_Model_Indexer'); foreach ($this->getDepends() as $code) { @@ -482,6 +492,10 @@ class Mage_Index_Model_Process extends Mage_Core_Model_Abstract */ public function changeStatus($status) { + Mage::dispatchEvent('index_process_change_status', array( + 'process' => $this, + 'status' => $status + )); $this->_getResource()->updateStatus($this, $status); return $this; } @@ -588,4 +602,4 @@ class Mage_Index_Model_Process extends Mage_Core_Model_Abstract $eventsCollection->addProcessFilter($this, self::EVENT_STATUS_NEW); return $eventsCollection; } -} \ No newline at end of file +} diff --git a/app/code/core/Mage/Index/Model/Resource/Abstract.php b/app/code/core/Mage/Index/Model/Resource/Abstract.php index 2f8f5124ae2..a000c6eee43 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 8a4f02399d0..e81901e42a8 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) */ @@ -67,6 +67,7 @@ class Mage_Index_Model_Resource_Event extends Mage_Core_Model_Resource_Db_Abstra $object->mergePreviousData($data); } } + $object->cleanNewData(); return parent::_beforeSave($object); } @@ -85,7 +86,7 @@ class Mage_Index_Model_Resource_Event extends Mage_Core_Model_Resource_Db_Abstra $this->_getWriteAdapter()->delete($processTable); } else { foreach ($processIds as $processId => $processStatus) { - if (is_null($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(), 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 ac4e0ded602..59da762e5bd 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/Process.php b/app/code/core/Mage/Index/Model/Resource/Process.php index 0644644638f..d7143333a1a 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) */ @@ -162,4 +162,14 @@ class Mage_Index_Model_Resource_Process extends Mage_Core_Model_Resource_Db_Abst $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 1f7147ef677..5feff1617c7 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 7f9d3febb24..8c5ab70e870 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/Model/Shell.php b/app/code/core/Mage/Index/Model/Shell.php index f6e294f1d4c..8045bf996e7 100644 --- a/app/code/core/Mage/Index/Model/Shell.php +++ b/app/code/core/Mage/Index/Model/Shell.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 5322b2fd47b..44dc2dc2702 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 29af5eae1a9..9f93bebfb69 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 61c674cb83f..c442c6ff3d5 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 6c85ae79cdb..c8a542879ea 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/view/adminhtml/layout.xml b/app/code/core/Mage/Index/view/adminhtml/layout.xml index 46cfbecca29..09db0740ed7 100644 --- a/app/code/core/Mage/Index/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Index/view/adminhtml/layout.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/code/core/Mage/Index/view/adminhtml/notifications.phtml b/app/code/core/Mage/Index/view/adminhtml/notifications.phtml index 66a559f16f7..a2f790bb0c7 100644 --- a/app/code/core/Mage/Index/view/adminhtml/notifications.phtml +++ b/app/code/core/Mage/Index/view/adminhtml/notifications.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/code/core/Mage/Install/Block/Abstract.php b/app/code/core/Mage/Install/Block/Abstract.php index f65cc791076..f99ddb47d8f 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 a8c7f2b8053..c005839ab8b 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 869ccbf006c..3c5e4058765 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 682c5a6f7c6..e547f1afad6 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 e00f701999c..25ac906f507 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 d9c351a9ab1..d46f5cb4a39 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 c0afd264dea..0690dc55c20 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 b8223dc8c0a..c09d1c33719 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 53d07105abc..783bcbc46e2 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 88cecd8ca5e..6ca9ef7ce91 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 f7482604f23..fd2f6ac3465 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 26927c7ade3..641c5f776b1 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 cfe36d60943..b70f8a37306 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 5ea19a7c997..4ac9d76c94e 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 307b7bd34bb..54bea9db621 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 99dca32a5f0..57d4cf0d59f 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 e968384989b..ec33d451af5 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 eec8b204b6e..15cca540727 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 0efb75fd656..e01190aca27 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 0a764a64bee..e56049b877a 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) */ @@ -67,8 +67,8 @@ class Mage_Install_Model_Installer_Db extends Mage_Install_Model_Installer_Abstr } } if (!empty($absenteeExtensions)) { - Mage::throwException(Mage::helper('Mage_Install_Helper_Data')->__('PHP Extensions "%s" must be loaded.', - implode(',', $absenteeExtensions)) + Mage::throwException( + Mage::helper('Mage_Install_Helper_Data')->__('PHP Extensions "%s" must be loaded.', implode(',', $absenteeExtensions)) ); } @@ -78,14 +78,16 @@ class Mage_Install_Model_Installer_Db extends Mage_Install_Model_Installer_Abstr // check DB server version if (version_compare($version, $requiredVersion) == -1) { - Mage::throwException(Mage::helper('Mage_Install_Helper_Data')->__('The database server version ' - . 'does not match system requirements (required: %s, actual: %s).', $requiredVersion, $version)); + Mage::throwException( + Mage::helper('Mage_Install_Helper_Data')->__('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('Mage_Install_Helper_Data')->__('Database server does not support ' - . 'the InnoDB storage engine.')); + Mage::throwException( + Mage::helper('Mage_Install_Helper_Data')->__('Database server does not support the InnoDB storage engine.') + ); } // TODO: check user roles @@ -121,8 +123,8 @@ class Mage_Install_Model_Installer_Db extends Mage_Install_Model_Installer_Abstr if ($data['db_prefix'] != '') { if (!preg_match('/^[a-z]+[a-z0-9_]*$/', $data['db_prefix'])) { Mage::throwException( - Mage::helper('Mage_Install_Helper_Data')->__('The table prefix should contain only letters (a-z), ' - . 'numbers (0-9) or underscores (_), the first character should be a letter.')); + Mage::helper('Mage_Install_Helper_Data')->__('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 @@ class Mage_Install_Model_Installer_Db extends Mage_Install_Model_Installer_Abstr if (!isset($this->_dbResource)) { $resource = Mage::getSingleton("Mage_Install_Model_Installer_Db_" . ucfirst($model)); if (!$resource) { - Mage::throwException(Mage::helper('Mage_Install_Helper_Data')->__(sprintf('Installer does not exist for %s database type', $model))); + Mage::throwException( + Mage::helper('Mage_Install_Helper_Data')->__('Installer does not exist for %s database type', $model) + ); } $this->_dbResource = $resource; } 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 1e360215ce1..9b8fdc09c73 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 4ef7e60068b..bc482b5d0ff 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 84e1322087c..e55707cd4f5 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 b2885de08d1..f811edfedcf 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 36afd78e675..3710c56efbc 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 67300d49516..e2cac5bec74 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 1911d3822c5..d96f67e9b63 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 e53bd845957..dcc70866c1c 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 08d8fb20eb5..e4c04a0da16 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 1fd8422ad58..60adb2d8a00 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 15969398938..5d052f25912 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 17dedf6e1e4..06f11e22b7e 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/Install/view/install/begin.phtml b/app/code/core/Mage/Install/view/install/begin.phtml index 306d43c11b2..211fe00ae1f 100644 --- a/app/code/core/Mage/Install/view/install/begin.phtml +++ b/app/code/core/Mage/Install/view/install/begin.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/code/core/Mage/Install/view/install/config.phtml b/app/code/core/Mage/Install/view/install/config.phtml index 6d0e7a2d3c6..374e93bc259 100644 --- a/app/code/core/Mage/Install/view/install/config.phtml +++ b/app/code/core/Mage/Install/view/install/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) */ @@ -99,9 +99,6 @@ <li> <input type="checkbox" name="config[use_secure_admin]" id="use_secure_admin" value="1" <?php if($this->getFormData()->getUseSecureAdmin()): ?>checked="checked"<?php endif; ?> /> <label for="use_secure_admin"><?php echo $this->__('Run admin interface with SSL') ?></label><br /> - <!--<p style="margin-top:4px; line-height:1.3em; color:#666;"> - <small><?php echo $this->__('') ?></small> - </p>--> </li> <li> <input type="checkbox" name="skip_url_validation" id="skip_url_validation" value="1" <?php if($this->getSkipUrlValidation()): ?>checked="checked"<?php endif; ?> /> diff --git a/app/code/core/Mage/Install/view/install/create_admin.phtml b/app/code/core/Mage/Install/view/install/create_admin.phtml index 61df414140c..670b0c533f9 100644 --- a/app/code/core/Mage/Install/view/install/create_admin.phtml +++ b/app/code/core/Mage/Install/view/install/create_admin.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/code/core/Mage/Install/view/install/db/main.phtml b/app/code/core/Mage/Install/view/install/db/main.phtml index c40468fcd3a..6efb2448c67 100644 --- a/app/code/core/Mage/Install/view/install/db/main.phtml +++ b/app/code/core/Mage/Install/view/install/db/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/code/core/Mage/Install/view/install/db/mysql4.phtml b/app/code/core/Mage/Install/view/install/db/mysql4.phtml index 9b3c6fd147f..6f3aedf4bd3 100644 --- a/app/code/core/Mage/Install/view/install/db/mysql4.phtml +++ b/app/code/core/Mage/Install/view/install/db/mysql4.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/code/core/Mage/Install/view/install/download.phtml b/app/code/core/Mage/Install/view/install/download.phtml index 5582ef84fc9..dc59b24615b 100644 --- a/app/code/core/Mage/Install/view/install/download.phtml +++ b/app/code/core/Mage/Install/view/install/download.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/code/core/Mage/Install/view/install/end.phtml b/app/code/core/Mage/Install/view/install/end.phtml index b00b7ae3f2a..bba70ff0728 100644 --- a/app/code/core/Mage/Install/view/install/end.phtml +++ b/app/code/core/Mage/Install/view/install/end.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/code/core/Mage/Install/view/install/layout.xml b/app/code/core/Mage/Install/view/install/layout.xml index d670ef68933..c3ca1bc4c44 100644 --- a/app/code/core/Mage/Install/view/install/layout.xml +++ b/app/code/core/Mage/Install/view/install/layout.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/code/core/Mage/Install/view/install/locale.phtml b/app/code/core/Mage/Install/view/install/locale.phtml index 850ecd958ca..a29c749315a 100644 --- a/app/code/core/Mage/Install/view/install/locale.phtml +++ b/app/code/core/Mage/Install/view/install/locale.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/code/core/Mage/Install/view/install/page.phtml b/app/code/core/Mage/Install/view/install/page.phtml index e9602d055fa..af921d7d9bc 100644 --- a/app/code/core/Mage/Install/view/install/page.phtml +++ b/app/code/core/Mage/Install/view/install/page.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/code/core/Mage/Install/view/install/state.phtml b/app/code/core/Mage/Install/view/install/state.phtml index 842203c6c00..a596d614e85 100644 --- a/app/code/core/Mage/Install/view/install/state.phtml +++ b/app/code/core/Mage/Install/view/install/state.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/code/core/Mage/Log/Helper/Data.php b/app/code/core/Mage/Log/Helper/Data.php index 3e373039a15..cfc6dd24f44 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 3b9c1c6d6cd..b0280c86627 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 29ad84fc1cc..411544b5ba3 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 dce045652b8..420c5a80de3 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 dd24e26bbfe..ad4f1380205 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/Resource/Aggregation.php b/app/code/core/Mage/Log/Model/Resource/Aggregation.php index cb6bfb79703..a1b2e44facb 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 4bc99c61da0..571cd87e058 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/Helper/Mysql4.php b/app/code/core/Mage/Log/Model/Resource/Helper/Mysql4.php index 92ab41e6341..0a455e8190f 100644 --- a/app/code/core/Mage/Log/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Log/Model/Resource/Helper/Mysql4.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 e72fd89f3a3..9f2da7d1ca4 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/Shell.php b/app/code/core/Mage/Log/Model/Resource/Shell.php index 885eba63339..159127da5a3 100644 --- a/app/code/core/Mage/Log/Model/Resource/Shell.php +++ b/app/code/core/Mage/Log/Model/Resource/Shell.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 401eae93cb3..36d8810a529 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) */ @@ -119,6 +119,26 @@ class Mage_Log_Model_Resource_Visitor extends Mage_Core_Model_Resource_Db_Abstra 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'), '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/Model/Resource/Visitor/Collection.php b/app/code/core/Mage/Log/Model/Resource/Visitor/Collection.php index 3773a74e3dc..a85eef35270 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 42b0dad4807..4eaa15dfba1 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 4c2c099b557..262cb34a6aa 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/Shell.php b/app/code/core/Mage/Log/Model/Shell.php index 79ff31f79d8..7818becdbc3 100644 --- a/app/code/core/Mage/Log/Model/Shell.php +++ b/app/code/core/Mage/Log/Model/Shell.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 8fbfcfac0f8..896a5d64fb8 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) */ diff --git a/app/code/core/Mage/Log/Model/Visitor/Online.php b/app/code/core/Mage/Log/Model/Visitor/Online.php index c1400093160..c36233816d9 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 b847d09f212..b0f458aed2d 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 dd25e4c50ca..86383e00eba 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 ccfdb1fced1..8dc7e2a6289 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 347e0bb6516..dcd8acd2db8 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/Media/Helper/Data.php b/app/code/core/Mage/Media/Helper/Data.php index b5613f0f048..7680cc3f6fe 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 8ad2108f38d..b8b0cd83a4f 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 6de54ea89c0..e6e08d1e605 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 8b5fac849cb..2efb2e44ad5 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 2cd94b68003..b8320ec95b7 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 7143466c448..2aa18880be4 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 b04aa7812c5..40de3527d60 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 b5b00aafdca..0a4928fb598 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/Observer.php b/app/code/core/Mage/Newsletter/Model/Observer.php index d86abf46eb3..2ec75112e2d 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 bcb2beddeb9..2b83a30c5db 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 241777fdb86..cc8026988c3 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 a449564b74a..a4f9d16bd98 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 a06892ae4b5..7c2d01895a0 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) */ @@ -68,6 +68,7 @@ class Mage_Newsletter_Model_Resource_Problem_Collection extends Mage_Core_Model_ '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; @@ -84,7 +85,7 @@ class Mage_Newsletter_Model_Resource_Problem_Collection extends Mage_Core_Model_ '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 546a9c16666..c0fd9fb5b66 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 f3f18f2d793..075a4a337b4 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 3526dadc074..acf2b5a7381 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 c19d9ff80c0..f5b65bc9650 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 6eeff3b7771..73fda5b1f78 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 88543b56b49..924200ac757 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 83b889bd057..3f9826b9d38 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 41aafc82ab3..e03dae5ea32 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) */ diff --git a/app/code/core/Mage/Newsletter/Model/Template.php b/app/code/core/Mage/Newsletter/Model/Template.php index 1701432ad22..d9cf4df6a70 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 88835a00755..7bef97a92b6 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 3d4a2a858d4..18afa268efc 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 f7dccd5952b..caaeea77453 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 004d5fc704f..180453d08d1 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 21a763f152f..e0cf764ca7c 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 f8faef0820a..7dd987c9647 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 d1360f2954d..3cd2bc00cd5 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 e648071119f..159380f4ece 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/view/frontend/layout.xml b/app/code/core/Mage/Newsletter/view/frontend/layout.xml index 67959520685..54347b1d54c 100644 --- a/app/code/core/Mage/Newsletter/view/frontend/layout.xml +++ b/app/code/core/Mage/Newsletter/view/frontend/layout.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/code/core/Mage/Newsletter/view/frontend/subscribe.phtml b/app/code/core/Mage/Newsletter/view/frontend/subscribe.phtml index 85e42a5872d..ad7e75db5cf 100644 --- a/app/code/core/Mage/Newsletter/view/frontend/subscribe.phtml +++ b/app/code/core/Mage/Newsletter/view/frontend/subscribe.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,8 +30,9 @@ </div> <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail"> <div class="block-content"> - <div class="form-subscribe-header"><?php echo $this->__('Sign up for our newsletter') ?></div> - <label for="newsletter"><?php echo $this->__('Sign Up for Our Newsletter:') ?></label> + <div class="form-subscribe-header"> + <label for="newsletter"><?php echo $this->__('Sign Up for Our Newsletter:') ?></label> + </div> <div class="input-box"> <input type="text" name="email" id="newsletter" title="<?php echo $this->__('Sign up for our newsletter') ?>" class="input-text required-entry validate-email" /> </div> diff --git a/app/code/core/Mage/Ogone/Block/Form.php b/app/code/core/Mage/Ogone/Block/Form.php index dc271ee8a22..3b96c85de89 100644 --- a/app/code/core/Mage/Ogone/Block/Form.php +++ b/app/code/core/Mage/Ogone/Block/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Block/Info.php b/app/code/core/Mage/Ogone/Block/Info.php index 54a75669aa6..8564f680ed2 100644 --- a/app/code/core/Mage/Ogone/Block/Info.php +++ b/app/code/core/Mage/Ogone/Block/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Block/Paypage.php b/app/code/core/Mage/Ogone/Block/Paypage.php index ee479c761ff..15737becbf6 100644 --- a/app/code/core/Mage/Ogone/Block/Paypage.php +++ b/app/code/core/Mage/Ogone/Block/Paypage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Block/Placeform.php b/app/code/core/Mage/Ogone/Block/Placeform.php index 50820e12d7a..b590463ffb8 100644 --- a/app/code/core/Mage/Ogone/Block/Placeform.php +++ b/app/code/core/Mage/Ogone/Block/Placeform.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Helper/Data.php b/app/code/core/Mage/Ogone/Helper/Data.php index c5f92a181a1..9be7b890097 100644 --- a/app/code/core/Mage/Ogone/Helper/Data.php +++ b/app/code/core/Mage/Ogone/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Model/Api.php b/app/code/core/Mage/Ogone/Model/Api.php index c3816c7f8fb..f0ace41387b 100644 --- a/app/code/core/Mage/Ogone/Model/Api.php +++ b/app/code/core/Mage/Ogone/Model/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Model/Config.php b/app/code/core/Mage/Ogone/Model/Config.php index 9a953d6d9a3..7e4ac7330a5 100644 --- a/app/code/core/Mage/Ogone/Model/Config.php +++ b/app/code/core/Mage/Ogone/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Model/Source/PaymentAction.php b/app/code/core/Mage/Ogone/Model/Source/PaymentAction.php index 840ca7f5b9e..5538ffef8c1 100644 --- a/app/code/core/Mage/Ogone/Model/Source/PaymentAction.php +++ b/app/code/core/Mage/Ogone/Model/Source/PaymentAction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Model/Source/Pmlist.php b/app/code/core/Mage/Ogone/Model/Source/Pmlist.php index ccd55378fdc..514206c7984 100644 --- a/app/code/core/Mage/Ogone/Model/Source/Pmlist.php +++ b/app/code/core/Mage/Ogone/Model/Source/Pmlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Model/Source/Template.php b/app/code/core/Mage/Ogone/Model/Source/Template.php index fa930e83393..53f74b7d2e7 100644 --- a/app/code/core/Mage/Ogone/Model/Source/Template.php +++ b/app/code/core/Mage/Ogone/Model/Source/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/controllers/ApiController.php b/app/code/core/Mage/Ogone/controllers/ApiController.php index b9aa8906adb..bafd6ebc66b 100644 --- a/app/code/core/Mage/Ogone/controllers/ApiController.php +++ b/app/code/core/Mage/Ogone/controllers/ApiController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/etc/config.xml b/app/code/core/Mage/Ogone/etc/config.xml index a30de63ede6..9051e3f6f0d 100644 --- a/app/code/core/Mage/Ogone/etc/config.xml +++ b/app/code/core/Mage/Ogone/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/Ogone/etc/system.xml b/app/code/core/Mage/Ogone/etc/system.xml index 542ec407e5b..d6fbf5c9998 100644 --- a/app/code/core/Mage/Ogone/etc/system.xml +++ b/app/code/core/Mage/Ogone/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/Ogone/sql/ogone_setup/install-1.6.0.0.php b/app/code/core/Mage/Ogone/sql/ogone_setup/install-1.6.0.0.php index 4a606f26403..cb7821cbdfa 100644 --- a/app/code/core/Mage/Ogone/sql/ogone_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Ogone/sql/ogone_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/view/adminhtml/info.phtml b/app/code/core/Mage/Ogone/view/adminhtml/info.phtml index 7a3f1f31886..904c92db534 100644 --- a/app/code/core/Mage/Ogone/view/adminhtml/info.phtml +++ b/app/code/core/Mage/Ogone/view/adminhtml/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/code/core/Mage/Ogone/view/frontend/form.phtml b/app/code/core/Mage/Ogone/view/frontend/form.phtml index 734e6c91971..8518ad5e50b 100644 --- a/app/code/core/Mage/Ogone/view/frontend/form.phtml +++ b/app/code/core/Mage/Ogone/view/frontend/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/code/core/Mage/Ogone/view/frontend/info.phtml b/app/code/core/Mage/Ogone/view/frontend/info.phtml index 83f3d7a8558..37e54380119 100644 --- a/app/code/core/Mage/Ogone/view/frontend/info.phtml +++ b/app/code/core/Mage/Ogone/view/frontend/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/code/core/Mage/Ogone/view/frontend/layout.xml b/app/code/core/Mage/Ogone/view/frontend/layout.xml index 4fd76cddca3..a986cb1d4d1 100644 --- a/app/code/core/Mage/Ogone/view/frontend/layout.xml +++ b/app/code/core/Mage/Ogone/view/frontend/layout.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/code/core/Mage/Ogone/view/frontend/paypage.phtml b/app/code/core/Mage/Ogone/view/frontend/paypage.phtml index 95ca8bcd79c..37c7a22afe5 100644 --- a/app/code/core/Mage/Ogone/view/frontend/paypage.phtml +++ b/app/code/core/Mage/Ogone/view/frontend/paypage.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/code/core/Mage/Ogone/view/frontend/placeform.phtml b/app/code/core/Mage/Ogone/view/frontend/placeform.phtml index 5bddedbd71c..43ac372968a 100644 --- a/app/code/core/Mage/Ogone/view/frontend/placeform.phtml +++ b/app/code/core/Mage/Ogone/view/frontend/placeform.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/code/core/Mage/Page/Block/Html.php b/app/code/core/Mage/Page/Block/Html.php index 812d42e32f2..ce9aa43ba1b 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 759a53f0c85..1ceaae6fe43 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 24f7ef1c768..5019ee7a0b8 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 b4bb83d0829..63af96bc7ec 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) */ @@ -130,11 +130,12 @@ class Mage_Page_Block_Html_Head extends Mage_Core_Block_Template * @param string|null $if * @param string|null $cond * @return Mage_Page_Block_Html_Head + * @throws Magento_Exception */ protected function _addItem($type, $name, $params = '', $if = null, $cond = null) { if (empty($name)) { - throw new Exception('File name must be not empty.'); + throw new Magento_Exception('File name must be not empty.'); } $this->_data['items'][$type . '/' . $name] = array( 'type' => $type, diff --git a/app/code/core/Mage/Page/Block/Html/Header.php b/app/code/core/Mage/Page/Block/Html/Header.php index 95da2941e31..682f9acdd3b 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 07eb0bd995a..264164938f6 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) */ diff --git a/app/code/core/Mage/Page/Block/Html/Pager.php b/app/code/core/Mage/Page/Block/Html/Pager.php index 31854ab5fa1..e5ef5d0d1fe 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/Welcome.php b/app/code/core/Mage/Page/Block/Html/Welcome.php index 661e15dd8ef..35a42db4c28 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 1364c8c580a..a0ce0fa4400 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 e7591637a05..5d789ff7394 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 13f378eb23d..b9da1ec39cf 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 <core@magentocommerce.com> */ 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 487b25bb6f3..905a31730e8 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 57e30964588..461795ebd0b 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 @@ class Mage_Page_Block_Switch extends Mage_Core_Block_Template 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 @@ class Mage_Page_Block_Switch extends Mage_Core_Block_Template $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 @@ class Mage_Page_Block_Switch extends Mage_Core_Block_Template $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 3a45c4c7d30..7b8afad9fd3 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 804d1b33112..06a7dce20fd 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) */ 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 b822c3b6785..346bdb83f47 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 92305f92e30..94b44a11646 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) */ diff --git a/app/code/core/Mage/Page/Helper/Html.php b/app/code/core/Mage/Page/Helper/Html.php index 235e337d751..20fd3e26fd7 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 839875ed559..f8dd96e456f 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 7d61f4c2fe0..763e87d66ac 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 b56667a0946..9fe4a470f4e 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 822e3ba479f..38d44942860 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 308e5f08026..7340a949dd3 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) */ --> diff --git a/app/code/core/Mage/Page/view/frontend/1column.phtml b/app/code/core/Mage/Page/view/frontend/1column.phtml index cda8615755f..b511083634f 100644 --- a/app/code/core/Mage/Page/view/frontend/1column.phtml +++ b/app/code/core/Mage/Page/view/frontend/1column.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/code/core/Mage/Page/view/frontend/2columns-left.phtml b/app/code/core/Mage/Page/view/frontend/2columns-left.phtml index 56cf49060a1..b2d41a3041d 100644 --- a/app/code/core/Mage/Page/view/frontend/2columns-left.phtml +++ b/app/code/core/Mage/Page/view/frontend/2columns-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/code/core/Mage/Page/view/frontend/2columns-right.phtml b/app/code/core/Mage/Page/view/frontend/2columns-right.phtml index 3affd93d9bb..b872ee66d81 100644 --- a/app/code/core/Mage/Page/view/frontend/2columns-right.phtml +++ b/app/code/core/Mage/Page/view/frontend/2columns-right.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/code/core/Mage/Page/view/frontend/3columns.phtml b/app/code/core/Mage/Page/view/frontend/3columns.phtml index e963227e079..54da9f7d85a 100644 --- a/app/code/core/Mage/Page/view/frontend/3columns.phtml +++ b/app/code/core/Mage/Page/view/frontend/3columns.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/code/core/Mage/Page/view/frontend/callouts/left_col.phtml b/app/code/core/Mage/Page/view/frontend/callouts/left_col.phtml index 5248e8bfb44..8f8202d9e3b 100644 --- a/app/code/core/Mage/Page/view/frontend/callouts/left_col.phtml +++ b/app/code/core/Mage/Page/view/frontend/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/code/core/Mage/Page/view/frontend/callouts/right_col.phtml b/app/code/core/Mage/Page/view/frontend/callouts/right_col.phtml index 5248e8bfb44..8f8202d9e3b 100644 --- a/app/code/core/Mage/Page/view/frontend/callouts/right_col.phtml +++ b/app/code/core/Mage/Page/view/frontend/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/code/core/Mage/Page/view/frontend/empty.phtml b/app/code/core/Mage/Page/view/frontend/empty.phtml index 00ff2170761..825a1a43a4a 100644 --- a/app/code/core/Mage/Page/view/frontend/empty.phtml +++ b/app/code/core/Mage/Page/view/frontend/empty.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/code/core/Mage/Page/view/frontend/html/breadcrumbs.phtml b/app/code/core/Mage/Page/view/frontend/html/breadcrumbs.phtml index c4123cc8599..a3305450710 100644 --- a/app/code/core/Mage/Page/view/frontend/html/breadcrumbs.phtml +++ b/app/code/core/Mage/Page/view/frontend/html/breadcrumbs.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/code/core/Mage/Page/view/frontend/html/footer.phtml b/app/code/core/Mage/Page/view/frontend/html/footer.phtml index a5c6881b719..e059aacc712 100644 --- a/app/code/core/Mage/Page/view/frontend/html/footer.phtml +++ b/app/code/core/Mage/Page/view/frontend/html/footer.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/code/core/Mage/Page/view/frontend/html/head.phtml b/app/code/core/Mage/Page/view/frontend/html/head.phtml index 9abe28405ee..5f94808debf 100644 --- a/app/code/core/Mage/Page/view/frontend/html/head.phtml +++ b/app/code/core/Mage/Page/view/frontend/html/head.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/code/core/Mage/Page/view/frontend/html/header.phtml b/app/code/core/Mage/Page/view/frontend/html/header.phtml index 59620fed12a..8ce9d6a7594 100644 --- a/app/code/core/Mage/Page/view/frontend/html/header.phtml +++ b/app/code/core/Mage/Page/view/frontend/html/header.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/code/core/Mage/Page/view/frontend/html/notices.phtml b/app/code/core/Mage/Page/view/frontend/html/notices.phtml index 975aec9c2e2..e84cab48963 100644 --- a/app/code/core/Mage/Page/view/frontend/html/notices.phtml +++ b/app/code/core/Mage/Page/view/frontend/html/notices.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) */ ?> @@ -33,7 +33,7 @@ <noscript> <div class="noscript"> <div class="noscript-inner"> - <p><strong><?php echo $this->__('JavaScript seem to be disabled in your browser.'); ?></strong></p> + <p><strong><?php echo $this->__('JavaScript seems to be disabled in your browser.'); ?></strong></p> <p><?php echo $this->__('You must have JavaScript enabled in your browser to utilize the functionality of this website.'); ?></p> </div> </div> diff --git a/app/code/core/Mage/Page/view/frontend/html/pager.phtml b/app/code/core/Mage/Page/view/frontend/html/pager.phtml index f131eed5fbb..7d14bb5e0df 100644 --- a/app/code/core/Mage/Page/view/frontend/html/pager.phtml +++ b/app/code/core/Mage/Page/view/frontend/html/pager.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/code/core/Mage/Page/view/frontend/js/calendar.phtml b/app/code/core/Mage/Page/view/frontend/js/calendar.phtml index 2af7ed839bd..67dd2936d99 100644 --- a/app/code/core/Mage/Page/view/frontend/js/calendar.phtml +++ b/app/code/core/Mage/Page/view/frontend/js/calendar.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/code/core/Mage/Page/view/frontend/js/cookie.phtml b/app/code/core/Mage/Page/view/frontend/js/cookie.phtml index e75d91f6e31..afa95006484 100644 --- a/app/code/core/Mage/Page/view/frontend/js/cookie.phtml +++ b/app/code/core/Mage/Page/view/frontend/js/cookie.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/code/core/Mage/Page/view/frontend/js/cookies.js b/app/code/core/Mage/Page/view/frontend/js/cookies.js index 26a204701a4..f9dbc7aff56 100644 --- a/app/code/core/Mage/Page/view/frontend/js/cookies.js +++ b/app/code/core/Mage/Page/view/frontend/js/cookies.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ // old school cookie functions grabbed off the web diff --git a/app/code/core/Mage/Page/view/frontend/layout.xml b/app/code/core/Mage/Page/view/frontend/layout.xml index cffaf77b007..caac86bd297 100644 --- a/app/code/core/Mage/Page/view/frontend/layout.xml +++ b/app/code/core/Mage/Page/view/frontend/layout.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/code/core/Mage/Page/view/frontend/menu.js b/app/code/core/Mage/Page/view/frontend/menu.js index 331b0a944f7..4aa72cb2fac 100644 --- a/app/code/core/Mage/Page/view/frontend/menu.js +++ b/app/code/core/Mage/Page/view/frontend/menu.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/view/frontend/popup.phtml b/app/code/core/Mage/Page/view/frontend/popup.phtml index 51e2141bf2e..7fe7c89f284 100644 --- a/app/code/core/Mage/Page/view/frontend/popup.phtml +++ b/app/code/core/Mage/Page/view/frontend/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/code/core/Mage/Page/view/frontend/print.phtml b/app/code/core/Mage/Page/view/frontend/print.phtml index 65bf14a75e2..b14d04ab12e 100644 --- a/app/code/core/Mage/Page/view/frontend/print.phtml +++ b/app/code/core/Mage/Page/view/frontend/print.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/code/core/Mage/Page/view/frontend/redirect.phtml b/app/code/core/Mage/Page/view/frontend/redirect.phtml index fa65e416e70..1abe5a9c5ff 100644 --- a/app/code/core/Mage/Page/view/frontend/redirect.phtml +++ b/app/code/core/Mage/Page/view/frontend/redirect.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/code/core/Mage/Page/view/frontend/switch/flags.phtml b/app/code/core/Mage/Page/view/frontend/switch/flags.phtml index a9386a0a44c..512fd4d4bad 100644 --- a/app/code/core/Mage/Page/view/frontend/switch/flags.phtml +++ b/app/code/core/Mage/Page/view/frontend/switch/flags.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/code/core/Mage/Page/view/frontend/switch/languages.phtml b/app/code/core/Mage/Page/view/frontend/switch/languages.phtml index 6feacc888a1..a20e8e6d832 100644 --- a/app/code/core/Mage/Page/view/frontend/switch/languages.phtml +++ b/app/code/core/Mage/Page/view/frontend/switch/languages.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/code/core/Mage/Page/view/frontend/switch/stores.phtml b/app/code/core/Mage/Page/view/frontend/switch/stores.phtml index 32768dc744a..12e9c6225d8 100644 --- a/app/code/core/Mage/Page/view/frontend/switch/stores.phtml +++ b/app/code/core/Mage/Page/view/frontend/switch/stores.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/code/core/Mage/Page/view/frontend/template/container.phtml b/app/code/core/Mage/Page/view/frontend/template/container.phtml index a86bdc57dda..1a18786899f 100644 --- a/app/code/core/Mage/Page/view/frontend/template/container.phtml +++ b/app/code/core/Mage/Page/view/frontend/template/container.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/code/core/Mage/Page/view/frontend/template/links.phtml b/app/code/core/Mage/Page/view/frontend/template/links.phtml index 2799d77f676..78c141726ba 100644 --- a/app/code/core/Mage/Page/view/frontend/template/links.phtml +++ b/app/code/core/Mage/Page/view/frontend/template/links.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/code/core/Mage/Page/view/frontend/template/linksblock.phtml b/app/code/core/Mage/Page/view/frontend/template/linksblock.phtml index 825a3697ec0..e80b8195e15 100644 --- a/app/code/core/Mage/Page/view/frontend/template/linksblock.phtml +++ b/app/code/core/Mage/Page/view/frontend/template/linksblock.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/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php b/app/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php index 4fa43694df4..ebc877857b1 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 9f1581d571e..218a44b575b 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 e3dc6c4d688..c540b494e02 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 9df13fbd5bd..6825dd5e4a6 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 49c6cf3890a..22e40c54537 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 219c183b3f6..3de03f087cc 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 93f5c9a9161..09bf254c85a 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 cbc2b595010..66ff55a2eac 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 86722040887..5ae7aee961e 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 46cbe3eca88..d1fe46e68a8 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/PageCache/view/adminhtml/cache/additional.phtml b/app/code/core/Mage/PageCache/view/adminhtml/cache/additional.phtml index ad43b4086fb..fcbf4f76cc7 100644 --- a/app/code/core/Mage/PageCache/view/adminhtml/cache/additional.phtml +++ b/app/code/core/Mage/PageCache/view/adminhtml/cache/additional.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/code/core/Mage/PageCache/view/adminhtml/layout.xml b/app/code/core/Mage/PageCache/view/adminhtml/layout.xml index 26f969ec432..d8d3f399b5e 100644 --- a/app/code/core/Mage/PageCache/view/adminhtml/layout.xml +++ b/app/code/core/Mage/PageCache/view/adminhtml/layout.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/code/core/Mage/PageCache/view/frontend/cookie.phtml b/app/code/core/Mage/PageCache/view/frontend/cookie.phtml index 12b31b7d862..bcc8dd747d7 100644 --- a/app/code/core/Mage/PageCache/view/frontend/cookie.phtml +++ b/app/code/core/Mage/PageCache/view/frontend/cookie.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/code/core/Mage/PageCache/view/frontend/layout.xml b/app/code/core/Mage/PageCache/view/frontend/layout.xml index 9c4a95fa8a5..5bb019f729a 100644 --- a/app/code/core/Mage/PageCache/view/frontend/layout.xml +++ b/app/code/core/Mage/PageCache/view/frontend/layout.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/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php b/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php index 5f232451f67..611dfffce3b 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 afa8e26ace9..757532ca779 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 19bab1007ce..7b6111d0537 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) */ @@ -51,9 +51,9 @@ class Mage_Paygate_Helper_Data extends Mage_Core_Helper_Abstract * @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 ); @@ -72,8 +72,8 @@ class Mage_Paygate_Helper_Data extends Mage_Core_Helper_Abstract * @return bool|string */ public function getExtendedTransactionMessage($payment, $requestType, $lastTransactionId, $card, $amount = false, - $exception = false, $additionalMessage = false) - { + $exception = false, $additionalMessage = false + ) { $operation = $this->_getOperation($requestType); if (!$operation) { diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet.php b/app/code/core/Mage/Paygate/Model/Authorizenet.php index 38bd8eb4b74..7a880e4467f 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) */ @@ -831,8 +831,9 @@ class Mage_Paygate_Model_Authorizenet extends Mage_Payment_Model_Method_Cc break; case self::RESPONSE_CODE_DECLINED: case self::RESPONSE_CODE_ERROR: - if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_NOT_FOUND && - $this->_isTransactionExpired($realAuthTransactionId)) { + if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_NOT_FOUND + && $this->_isTransactionExpired($realAuthTransactionId) + ) { $voidTransactionId = $realAuthTransactionId . '-void'; return $this->_addTransaction( $payment, diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Cards.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Cards.php index 5ef38690507..2c801340742 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 7683f89fa39..13211b82606 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 a787417a655..511f349f9c3 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 56760c94f21..db0f641cd79 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 aeeabc688e7..8595c9ac49c 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 121687e5669..12db82b150f 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/Resource/Authorizenet/Debug.php b/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug.php index e51550cb288..a15c971905c 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 c0a77c0152b..1b9a90d2595 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 91f37cc60da..696d5cfb3a6 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 61b2e2814f4..a033d5c7f41 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 6e4c79a5de6..61e12620263 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 8cf3449f82d..7facb044f7f 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 6fe48533691..c8bb5e7e582 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/view/adminhtml/form/cc.phtml b/app/code/core/Mage/Paygate/view/adminhtml/form/cc.phtml index 10be8c1838c..c146b5577cd 100644 --- a/app/code/core/Mage/Paygate/view/adminhtml/form/cc.phtml +++ b/app/code/core/Mage/Paygate/view/adminhtml/form/cc.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/code/core/Mage/Paygate/view/adminhtml/info/cc.phtml b/app/code/core/Mage/Paygate/view/adminhtml/info/cc.phtml index eb703c20aa9..099c8e843fb 100644 --- a/app/code/core/Mage/Paygate/view/adminhtml/info/cc.phtml +++ b/app/code/core/Mage/Paygate/view/adminhtml/info/cc.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/code/core/Mage/Paygate/view/adminhtml/info/pdf.phtml b/app/code/core/Mage/Paygate/view/adminhtml/info/pdf.phtml index 6efe244ce94..65e631d8687 100644 --- a/app/code/core/Mage/Paygate/view/adminhtml/info/pdf.phtml +++ b/app/code/core/Mage/Paygate/view/adminhtml/info/pdf.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/code/core/Mage/Paygate/view/frontend/form/cc.phtml b/app/code/core/Mage/Paygate/view/frontend/form/cc.phtml index cd980f857a5..3cbe4292078 100644 --- a/app/code/core/Mage/Paygate/view/frontend/form/cc.phtml +++ b/app/code/core/Mage/Paygate/view/frontend/form/cc.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/code/core/Mage/Paygate/view/frontend/info/cc.phtml b/app/code/core/Mage/Paygate/view/frontend/info/cc.phtml index 4d302362370..27a956caa18 100644 --- a/app/code/core/Mage/Paygate/view/frontend/info/cc.phtml +++ b/app/code/core/Mage/Paygate/view/frontend/info/cc.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/code/core/Mage/Payment/Block/Catalog/Product/View/Profile.php b/app/code/core/Mage/Payment/Block/Catalog/Product/View/Profile.php index eac525091fa..81f0cc196d2 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 92ad4b08dc4..f7f98c0e180 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 51467821bf8..c9693517254 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 27480612ac6..feecb322499 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 ea7db7d96f1..a6ed9932b51 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 1d8c56a0c30..c23bf915b89 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 8cffc52f5be..42515370bb2 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 af2905c69dd..0e2798dd291 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 b8397dd9818..55c7da0fb61 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 860586fd8b3..afdf070d483 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 fe03a1b70b9..dc6d4d152dc 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 22cbd065f5d..fecebf76a7f 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 994eda155ee..5939258439f 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 af6dfc129b3..cc2b017fef7 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 0c54dcc9b91..b2e6a3a97b0 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 9d02c9b7bfd..fc49d1b44ed 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 0ac8af3e6ac..6c1e4dd2ef4 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 960fcbe5b50..73bceb0f344 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 1a855487927..2ea4a0e8fc6 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 1f1888328ba..6293c7eafd3 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 f05c673e147..e99303ba86b 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) */ @@ -297,7 +297,8 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object */ 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 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object public function getCode() { if (empty($this->_code)) { - Mage::throwException($this->_getHelper()->__('Cannot retrieve the payment method code.')); + Mage::throwException(Mage::helper('Mage_Payment_Helper_Data')->__('Cannot retrieve the payment method code.')); } return $this->_code; } @@ -352,7 +353,7 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object { $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('Mage_Payment_Helper_Data')->__('Cannot retrieve the payment information object instance.')); } return $instance; } @@ -360,13 +361,12 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object /** * 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 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object $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('Mage_Payment_Helper_Data')->__('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('Mage_Payment_Helper_Data')->__('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('Mage_Payment_Helper_Data')->__('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('Mage_Payment_Helper_Data')->__('Capture action is not available.')); } return $this; @@ -456,16 +460,17 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object } /** - * 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) { if (!$this->canRefund()) { - Mage::throwException($this->_getHelper()->__('Refund action is not available.')); + Mage::throwException(Mage::helper('Mage_Payment_Helper_Data')->__('Refund action is not available.')); } return $this; } @@ -483,10 +488,11 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object } /** - * 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) { @@ -494,15 +500,16 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object } /** - * 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('Mage_Payment_Helper_Data')->__('Void action is not available.')); } return $this; } @@ -511,7 +518,7 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object * 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) @@ -562,8 +569,10 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object /** * 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) { @@ -603,8 +612,11 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object /** * 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) @@ -630,10 +642,12 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object /** * 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) { @@ -641,7 +655,7 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object } /** - * 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 86ef1c3fe94..e7f68a3fadf 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) */ @@ -107,14 +107,29 @@ class Mage_Payment_Model_Method_Cc extends Mage_Payment_Model_Method_Abstract $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 @@ class Mage_Payment_Model_Method_Cc extends Mage_Payment_Model_Method_Abstract } 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('Mage_Payment_Helper_Data')->__('Credit card number mismatch with credit card type.'); } } else { - $errorCode = 'ccsave_cc_number'; - $errorMsg = $this->_getHelper()->__('Invalid Credit Card Number'); + $errorMsg = Mage::helper('Mage_Payment_Helper_Data')->__('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('Mage_Payment_Helper_Data')->__('Credit card type is not allowed for this payment method.'); } //validate credit card verification number @@ -145,18 +157,16 @@ class Mage_Payment_Model_Method_Cc extends Mage_Payment_Model_Method_Abstract $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('Mage_Payment_Helper_Data')->__('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('Mage_Payment_Helper_Data')->__('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 @@ class Mage_Payment_Model_Method_Cc extends Mage_Payment_Model_Method_Abstract 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/Ccsave.php b/app/code/core/Mage/Payment/Model/Method/Ccsave.php index a0fa8c06900..4d8460dd14b 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 71c01681782..f865236d16f 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 0ca45647aa9..a1aada4d731 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 @@ class Mage_Payment_Model_Method_Free extends Mage_Payment_Model_Method_Abstract 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 487558bfe53..c45d33217fc 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 e49dcdf4c32..196f43b2574 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/Result.php b/app/code/core/Mage/Payment/Model/Paygate/Result.php index dcd7cdbbd21..545fd02c14d 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 e68bb188b2b..28c9a5e175e 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 b5674fb8eba..d4dd6261342 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 5bfc82eeb2c..6b8b81d82f0 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 bff33047682..4c8e3c6369d 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 0569e7bfafb..ce1975b700c 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 bb81014fcc9..d551c11c7e0 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 8f5888d2a00..0684816261d 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) */ --> @@ -79,6 +79,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> @@ -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> @@ -299,6 +301,9 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> + <depends> + <order_status separator=",">processing,processed_ogone</order_status> + </depends> </payment_action> <sort_order translate="label"> <label>Sort Order</label> @@ -307,6 +312,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 +396,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/Payment/view/adminhtml/form/cc.phtml b/app/code/core/Mage/Payment/view/adminhtml/form/cc.phtml index 36f011831d9..a2eb2b94fcc 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/form/cc.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/form/cc.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/code/core/Mage/Payment/view/adminhtml/form/ccsave.phtml b/app/code/core/Mage/Payment/view/adminhtml/form/ccsave.phtml index 6ee545bb20d..798bf7426bf 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/form/ccsave.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/form/ccsave.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/code/core/Mage/Payment/view/adminhtml/form/checkmo.phtml b/app/code/core/Mage/Payment/view/adminhtml/form/checkmo.phtml index 5309aa254be..3eb4e00f4be 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/form/checkmo.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/form/checkmo.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/code/core/Mage/Payment/view/adminhtml/form/purchaseorder.phtml b/app/code/core/Mage/Payment/view/adminhtml/form/purchaseorder.phtml index 3f8a72f979f..2f91b5e5601 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/form/purchaseorder.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/form/purchaseorder.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/code/core/Mage/Payment/view/adminhtml/info/checkmo.phtml b/app/code/core/Mage/Payment/view/adminhtml/info/checkmo.phtml index c1afd92f19b..f452e9f3405 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/info/checkmo.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/info/checkmo.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/code/core/Mage/Payment/view/adminhtml/info/default.phtml b/app/code/core/Mage/Payment/view/adminhtml/info/default.phtml index ca93bcb4976..07992a60d40 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/info/default.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/info/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/code/core/Mage/Payment/view/adminhtml/info/pdf/checkmo.phtml b/app/code/core/Mage/Payment/view/adminhtml/info/pdf/checkmo.phtml index 35f848e6da7..e86a3fe9318 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/info/pdf/checkmo.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/info/pdf/checkmo.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/code/core/Mage/Payment/view/adminhtml/info/pdf/default.phtml b/app/code/core/Mage/Payment/view/adminhtml/info/pdf/default.phtml index a9eee2f3101..1b738ed9fb4 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/info/pdf/default.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/info/pdf/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/code/core/Mage/Payment/view/adminhtml/info/pdf/purchaseorder.phtml b/app/code/core/Mage/Payment/view/adminhtml/info/pdf/purchaseorder.phtml index 1b40a5c0ef0..d06132e1bb4 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/info/pdf/purchaseorder.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/info/pdf/purchaseorder.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/code/core/Mage/Payment/view/adminhtml/info/purchaseorder.phtml b/app/code/core/Mage/Payment/view/adminhtml/info/purchaseorder.phtml index b6d6fc2c196..e00b266be19 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/info/purchaseorder.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/info/purchaseorder.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/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/options.phtml b/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/options.phtml index d4b6466d5aa..af0daeb359d 100644 --- a/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/options.phtml +++ b/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/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/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/schedule.phtml b/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/schedule.phtml index 59d3b8f4abc..8998c3f3e72 100644 --- a/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/schedule.phtml +++ b/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/schedule.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/code/core/Mage/Payment/view/frontend/form/cc.phtml b/app/code/core/Mage/Payment/view/frontend/form/cc.phtml index d4208de0b64..45451c2c0c3 100644 --- a/app/code/core/Mage/Payment/view/frontend/form/cc.phtml +++ b/app/code/core/Mage/Payment/view/frontend/form/cc.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/code/core/Mage/Payment/view/frontend/form/ccsave.phtml b/app/code/core/Mage/Payment/view/frontend/form/ccsave.phtml index d714237d67c..830c92c95b2 100644 --- a/app/code/core/Mage/Payment/view/frontend/form/ccsave.phtml +++ b/app/code/core/Mage/Payment/view/frontend/form/ccsave.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/code/core/Mage/Payment/view/frontend/form/checkmo.phtml b/app/code/core/Mage/Payment/view/frontend/form/checkmo.phtml index d03d5c4c39b..ea551af0613 100644 --- a/app/code/core/Mage/Payment/view/frontend/form/checkmo.phtml +++ b/app/code/core/Mage/Payment/view/frontend/form/checkmo.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/code/core/Mage/Payment/view/frontend/form/purchaseorder.phtml b/app/code/core/Mage/Payment/view/frontend/form/purchaseorder.phtml index 132b0bca9f1..af44aa7818b 100644 --- a/app/code/core/Mage/Payment/view/frontend/form/purchaseorder.phtml +++ b/app/code/core/Mage/Payment/view/frontend/form/purchaseorder.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/code/core/Mage/Payment/view/frontend/info/checkmo.phtml b/app/code/core/Mage/Payment/view/frontend/info/checkmo.phtml index 64b5d8cb2ad..8cca6ba7c5a 100644 --- a/app/code/core/Mage/Payment/view/frontend/info/checkmo.phtml +++ b/app/code/core/Mage/Payment/view/frontend/info/checkmo.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/code/core/Mage/Payment/view/frontend/info/default.phtml b/app/code/core/Mage/Payment/view/frontend/info/default.phtml index a76f630371f..b2eed7cf204 100644 --- a/app/code/core/Mage/Payment/view/frontend/info/default.phtml +++ b/app/code/core/Mage/Payment/view/frontend/info/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/code/core/Mage/Payment/view/frontend/info/purchaseorder.phtml b/app/code/core/Mage/Payment/view/frontend/info/purchaseorder.phtml index 00384bc5c36..f440775abda 100644 --- a/app/code/core/Mage/Payment/view/frontend/info/purchaseorder.phtml +++ b/app/code/core/Mage/Payment/view/frontend/info/purchaseorder.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/code/core/Mage/Payment/view/frontend/layout.xml b/app/code/core/Mage/Payment/view/frontend/layout.xml index eab4518a4e5..d3583d738db 100644 --- a/app/code/core/Mage/Payment/view/frontend/layout.xml +++ b/app/code/core/Mage/Payment/view/frontend/layout.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/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details.php b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details.php index 4cea0c64aad..91d104f1402 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 cf8992484d1..03389c15eb7 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 32cce82b1d0..99705a99029 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 c036872654b..f5b620cb082 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 86e2743e8aa..8b7d4d9192a 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 230073c7720..d5b7d674acb 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 33b9d66fd06..bdfc9c65a9d 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 8f7296bb7ab..c379fafd208 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 1c17289759d..c7bf5cd25c2 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 d2f3ed2e6df..86cbee19c4b 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 a4a90e3d25d..e04569a0d7a 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 d50e90a3436..6b34e898c3b 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) */ 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 b92efcef592..f1b699b310d 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/Shortcut.php b/app/code/core/Mage/Paypal/Block/Express/Shortcut.php index cb630539fe0..1126e6584c8 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 f27380c9d14..8db12c228a6 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 393cde8c65c..e0c2f4d22a5 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 5b33cf228d1..7e47b5a5089 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 1fe3498c50c..59fef66f1db 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,9 @@ class Mage_Paypal_Block_Iframe extends Mage_Payment_Block_Form ->getMethod(); if (in_array($paymentCode, $this->helper('Mage_Paypal_Helper_Hss')->getHssMethods())) { $this->_paymentMethodCode = $paymentCode; + $template_path = str_replace('_', '', $paymentCode); + $this->setTemplate("{$template_path}/iframe.phtml"); } - $this->setTemplate('hss/iframe.phtml'); } /** diff --git a/app/code/core/Mage/Paypal/Block/Logo.php b/app/code/core/Mage/Paypal/Block/Logo.php index b086e8f2e4c..3ba06a4396d 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 27a31936a92..13712586020 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) */ @@ -41,7 +41,7 @@ class Mage_Paypal_Block_Payflow_Advanced_Form extends Mage_Paypal_Block_Payflow_ protected function _construct() { parent::_construct(); - $this->setTemplate('payflowadvanced/iframe.phtml'); + $this->setTemplate('payflowadvanced/info.phtml'); } /** 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 bc60efb38f1..bc67b7220d5 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) */ @@ -33,6 +33,15 @@ */ 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 * 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 0fa276f768d..0b2ac3cf7ba 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 4e6058ff09c..ec5f015ea62 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php @@ -20,13 +20,14 @@ * * @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) */ /** * 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> 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 fbb4d27981d..055f990c432 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) */ @@ -41,7 +41,7 @@ class Mage_Paypal_Block_Payflow_Link_Form extends Mage_Payment_Block_Form protected function _construct() { parent::_construct(); - $this->setTemplate('payflowlink/iframe.phtml'); + $this->setTemplate('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 61c58aca5c8..7c147742927 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) */ @@ -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 @@ class Mage_Paypal_Block_Payflow_Link_Iframe extends Mage_Payment_Block_Form */ public function getSecureToken() { - return $this->_getSalesDocument() + return $this->_getOrder() ->getPayment() ->getAdditionalInformation('secure_token'); } @@ -62,7 +71,7 @@ class Mage_Paypal_Block_Payflow_Link_Iframe extends Mage_Payment_Block_Form */ public function getSecureTokenId() { - return $this->_getSalesDocument() + return $this->_getOrder() ->getPayment() ->getAdditionalInformation('secure_token_id'); } @@ -85,18 +94,8 @@ class Mage_Paypal_Block_Payflow_Link_Iframe extends Mage_Payment_Block_Form public function isTestMode() { $mode = Mage::helper('Mage_Payment_Helper_Data') - ->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('Mage_Checkout_Model_Session')->getQuote(); - } } 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 e521d4b1f8f..16dbfd873b3 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 b8fb86aaa54..12c76484222 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php @@ -20,13 +20,14 @@ * * @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) */ /** * Paypal PayflowLink Express Onepage checkout block * + * @deprecated since 1.6.2.0 * @category Mage * @package Mage_Paypal * @author Magento Core Team <core@magentocommerce.com> @@ -41,11 +42,6 @@ class Mage_Paypal_Block_Payflow_Link_Review extends Mage_Paypal_Block_Express_Re */ protected function _beforeToHtml() { - parent::_beforeToHtml(); - $this->setPlaceOrderUrl($this->getUrl("*/*/placeOrder")); - $this->setEditUrl(); - $this->setSuccessUrl($this->getUrl("checkout/onepage/success")); - $this->setUseAjax(true); - return $this; + return parent::_beforeToHtml(); } } diff --git a/app/code/core/Mage/Paypal/Block/Payment/Info.php b/app/code/core/Mage/Paypal/Block/Payment/Info.php index 0297519d815..a75ccd8d897 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 47d3cf578be..b72265e0ad3 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 25da18f4f74..a4b90608e13 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 diff --git a/app/code/core/Mage/Paypal/Controller/Express/Abstract.php b/app/code/core/Mage/Paypal/Controller/Express/Abstract.php index 4d844a7d9ee..b457722dad0 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) */ @@ -69,7 +69,7 @@ abstract class Mage_Paypal_Controller_Express_Abstract extends Mage_Core_Control $customer = Mage::getSingleton('Mage_Customer_Model_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/Exception.php b/app/code/core/Mage/Paypal/Exception.php index de8ed4c19c0..07af9449294 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 df6948f4070..8a9674fd66f 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 665c085a525..970f64894a3 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) */ @@ -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/Abstract.php b/app/code/core/Mage/Paypal/Model/Api/Abstract.php index dc716ec05c0..08317b1da84 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 7b832911e9b..6fb28c1ca81 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) */ diff --git a/app/code/core/Mage/Paypal/Model/Api/Standard.php b/app/code/core/Mage/Paypal/Model/Api/Standard.php index e6d5f95a4d3..8b969955de9 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) */ diff --git a/app/code/core/Mage/Paypal/Model/Cart.php b/app/code/core/Mage/Paypal/Model/Cart.php index a8a715911fd..d15d127421d 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 ac567b4467b..93e1860ae15 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 82ff3fdec6f..c39453906cb 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) */ @@ -98,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; @@ -873,16 +875,12 @@ class Mage_Paypal_Model_Config /** * 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('Mage_Paypal_Helper_Data')->__('$0 Auth'), - self::AUTHORIZATION_AMOUNT_ONE => Mage::helper('Mage_Paypal_Helper_Data')->__('$1 Auth'), - self::AUTHORIZATION_AMOUNT_FULL => Mage::helper('Mage_Paypal_Helper_Data')->__('Full Auth'), - ); - return $authorizationAmount; + return array(); } /** @@ -1367,4 +1365,3 @@ class Mage_Paypal_Model_Config return Mage::getModel('Mage_Paypal_Model_Cert')->loadByWebsite($websiteId, false)->getCertPath(); } } - diff --git a/app/code/core/Mage/Paypal/Model/Direct.php b/app/code/core/Mage/Paypal/Model/Direct.php index 404987a5c07..1477bd1af25 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 908c5ec54f3..aeb16f459ac 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) */ diff --git a/app/code/core/Mage/Paypal/Model/Express/Checkout.php b/app/code/core/Mage/Paypal/Model/Express/Checkout.php index 33eec398a38..6f4c68f9347 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) */ diff --git a/app/code/core/Mage/Paypal/Model/Hostedpro.php b/app/code/core/Mage/Paypal/Model/Hostedpro.php index 620ccd5630f..e0751acba01 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 f6e5748f863..4095234d0d1 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 be2f8bdd664..eb958cbf087 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 97d43ca5455..5bf09da9eaa 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) */ @@ -170,7 +170,12 @@ class Mage_Paypal_Model_Ipn $id = $this->_request['invoice']; $this->_order = Mage::getModel('Mage_Sales_Model_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/Method/Agreement.php b/app/code/core/Mage/Paypal/Model/Method/Agreement.php index 55401cede69..bb856218e81 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/Observer.php b/app/code/core/Mage/Paypal/Model/Observer.php index 239a75e3ff6..e067a44832b 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) */ @@ -57,35 +57,12 @@ class Mage_Paypal_Model_Observer /** * 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('Mage_Core_Model_Date'); - $createdBefore = strtotime('-1 hour', $date->timestamp()); - - /** @var $collection Mage_Paypal_Model_Resource_Payment_Transaction_Collection */ - $collection = Mage::getModel('Mage_Paypal_Model_Payment_Transaction')->getCollection(); - $collection->addCreatedBeforeFilter($date->gmtDate(null, $createdBefore)); - - /** @var $method Mage_Paypal_Model_Payflowlink */ - $method = Mage::helper('Mage_Payment_Helper_Data')->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/Payflow/Request.php b/app/code/core/Mage/Paypal/Model/Payflow/Request.php index 28ba1695ee1..2a0023ad86c 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 55f57e694a7..1a2ca8f6ec5 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) */ @@ -54,32 +54,4 @@ class Mage_Paypal_Model_Payflowadvanced extends Mage_Paypal_Model_Payflowlink * @var string */ protected $_infoBlockType = 'Mage_Paypal_Block_Payflow_Advanced_Info'; - - /** - * Instantiate state and set it to state object - * PayflowAdvanced should always use full authorization amount - * - * @param string $paymentAction - * @param Varien_Object $stateObject - * @return Mage_Paypal_Model_Payflowadvanced - */ - public function initialize($paymentAction, $stateObject) - { - $payment = $this->getInfoInstance(); - - $salesDocument = $payment->getOrder(); - if (!$salesDocument) { - $salesDocument = $payment->getQuote(); - $amount = $salesDocument->getBaseGrandTotal(); - } else { - $amount = $salesDocument->getBaseTotalDue(); - } - - $this->_initialize($payment, $amount); - - $payment->setAdditionalInformation('authorization_amount', - Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL); - - return $this; - } } diff --git a/app/code/core/Mage/Paypal/Model/Payflowlink.php b/app/code/core/Mage/Paypal/Model/Payflowlink.php index dac5c16f9f5..41fa0e48e04 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) */ @@ -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,207 +108,29 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro */ 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); - break; - case Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_ONE: - $this->_initialize($payment, 1); + 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_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; - } - - /** - * Check whether order review has enough data to initialize - * - * @param $token - * @throws Mage_Core_Exception - */ - public function prepareOrderReview($token = null) - { - } - - /** - * 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('Mage_Paypal_Model_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('Mage_Paypal_Model_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); - - // Handle case when order is placed via 'Pay With PayPal' button of Payflowlink iFrame - if (!$payment->getAdditionalInformation('express_checkout_token')) { - $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; } /** @@ -359,49 +176,63 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro $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('Mage_Paypal_Model_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('Mage_Sales_Model_Quote') + ->load($order->getQuoteId()) + ->setIsActive(false) + ->save(); + } catch (Exception $e) { + Mage::throwException(Mage::helper('Mage_Paypal_Helper_Data')->__('Can not send new order email.')); + } } /** @@ -420,58 +251,49 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro 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('Mage_Paypal_Helper_Data')->__(self::SHOPPING_CART_CHANGED_ERROR_MSG)); - } - - $authorizedAmt = $transaction->getAdditionalInformation('amt'); - - if (!$authorizedAmt || $amount > $authorizedAmt) { - Mage::throwException(Mage::helper('Mage_Paypal_Helper_Data')->__(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('Mage_Sales_Model_Quote')->load($response->getPonum()); - $salesDocument->getPayment()->setMethod($this->_code); + $order = Mage::getModel('Mage_Sales_Model_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')); + } + + $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 $salesDocument; + return $order; } /** @@ -480,42 +302,29 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro * @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()); + //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)) { + return $request; } - $billing = $salesDocument->getBillingAddress(); + $billing = $order->getBillingAddress(); if (!empty($billing)) { $request->setFirstname($billing->getFirstname()) ->setLastname($billing->getLastname()) @@ -524,9 +333,9 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro ->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()) @@ -538,7 +347,7 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro ->setShiptocountry($shipping->getCountry()); } //pass store Id to request - $request->setUser1($salesDocument->getStoreId()) + $request->setUser1($order->getStoreId()) ->setUser2($this->_getSecureSilentPostHash($payment)); return $request; @@ -576,25 +385,6 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro ->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; } @@ -605,7 +395,12 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro */ 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; + } } /** @@ -640,9 +435,7 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro */ protected function _processTokenErrors($response, $payment) { - if ($response->getResult() == self::RESPONSE_CODE_INVALID_AMOUNT) { - throw new Mage_Paypal_Exception(Mage::helper('Mage_Paypal_Helper_Data')->__('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()); @@ -677,21 +470,88 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro } /** - * 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 bfd177d7364..b8776356d6e 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 1d806ac2279..2b9b985a1f3 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 4e8f70d99fc..062a9f04f54 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 c008d10accf..49d4f5adf3f 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 bcfa815d1bf..87678dfd083 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 a24ed60384a..dd7df39d763 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 d0e9effb009..530451b73fb 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php @@ -20,13 +20,14 @@ * * @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) */ /** * 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 8b9c86ef211..61bf8cefbf6 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,13 +20,14 @@ * * @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) */ /** * 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/Resource/Report/Settlement.php b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php index 7f8e24b7166..c37ef615d37 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 f9583eeea08..f15f919c5dd 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 234213bb99c..0b1f8dc6c5a 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 861cac4263b..c9b945e2ac6 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 8c7e7277830..e762fd3e0a6 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 54c4ed4c40a..f69f389bc24 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) */ 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 beb4206ea07..5b5dd0cdae9 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 36490595bdc..532fe4931b7 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 9a33e743a76..442410179d2 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 0aa5e8635f5..5b45191acec 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,12 +20,17 @@ * * @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) */ /** * 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('Mage_Paypal_Model_Config'); - return $configModel->getAuthorizationAmounts(); + return array(); } } 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 e6d1e4b7975..52ed48a9a83 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 91869a062eb..a7bc2607d20 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 0f2b640471b..e4217ab8727 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 bf688eb5641..0a203f98e32 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 d51bcd39de0..e421a3540ea 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 ba1fa0d8dd8..41729f3c200 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/Paypal/controllers/Adminhtml/Paypal/ReportsController.php b/app/code/core/Mage/Paypal/controllers/Adminhtml/Paypal/ReportsController.php index c9fb5112d1d..734af430bf5 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 87c64bf74ca..0f940ddb5f3 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) */ diff --git a/app/code/core/Mage/Paypal/controllers/HostedproController.php b/app/code/core/Mage/Paypal/controllers/HostedproController.php index 61495fa3a33..d9f366c57fc 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 29fc18d77d0..5acb4667cb2 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 9b78d7e92a9..4083f236dab 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,29 +31,8 @@ * @package Mage_Paypal * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Paypal_PayflowController extends Mage_Paypal_Controller_Express_Abstract +class Mage_Paypal_PayflowController extends Mage_Core_Controller_Front_Action { - /** - * Config mode type - * - * @var string - */ - protected $_configType = 'Mage_Paypal_Model_Config'; - - /** - * Config method type - * - * @var string - */ - protected $_configMethod = Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK; - - /** - * Checkout mode type - * - * @var string - */ - protected $_checkoutType = 'paypal/payflowlink'; - /** * When a customer cancel payment from payflow gateway. */ @@ -71,43 +50,56 @@ class Mage_Paypal_PayflowController extends Mage_Paypal_Controller_Express_Abstr */ public function returnUrlAction() { - $errorMsg = ''; - $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'; - $errorMsg = $this->__('Payment has been declined. Please try again.'); - } + $redirectBlock = $this->_getIframeBlock() + ->setTemplate('paypal/payflowlink/redirect.phtml'); - $checkToken = $this->getRequest()->getParam('TOKEN'); - if ($checkToken) { - $payment->setAdditionalInformation('express_checkout_token', $checkToken)->save(); - Mage::getSingleton('Mage_Paypal_Model_Session')->setExpressCheckoutToken($checkToken); - $this->_redirect('*/*/review'); - return; - } + $session = $this->_getCheckout(); + if ($session->getLastRealOrderId()) { + $order = Mage::getModel('Mage_Sales_Model_Order')->loadByIncrementId($session->getLastRealOrderId()); - $redirectBlock = $this->_getIframeBlock() - ->setTemplate('payflowlink/redirect.phtml'); + 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->setErrorMsg($errorMsg); - $redirectBlock->setGotoSection($gotoSection); $this->getResponse()->setBody($redirectBlock->toHtml()); } /** - * When a customer return to website from payflow gateway. + * Submit transaction to Payflow getaway into iframe */ - public function placeOrderAction() + public function formAction() { - $session = $this->_getCheckout(); - $quote = $session->getQuote(); - $quote->collectTotals(); - $this->_forward('saveOrder', 'onepage', 'checkout'); + $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('Mage_Paypal_Model_Payflowlink'); + try { + $paymentModel->process($data); + } catch (Exception $e) { + Mage::logException($e); + } + } } /** @@ -146,55 +138,6 @@ class Mage_Paypal_PayflowController extends Mage_Paypal_Controller_Express_Abstr return $gotoSection; } - /** - * Submit transaction to Payflow getaway into iframe - */ - public function formAction() - { - $quote = $this->_getCheckout()->getQuote(); - $payment = $quote->getPayment(); - - try { - $method = Mage::helper('Mage_Payment_Helper_Data') - ->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'])) { - /** @var $paymentModel Mage_Paypal_Model_Payflowlink */ - $paymentModel = Mage::getModel('Mage_Paypal_Model_Payflowlink'); - try { - $paymentModel->process($data); - } catch (Exception $e) { - Mage::logException($e); - } - } - } - /** * Get frontend checkout session object * @@ -216,4 +159,4 @@ class Mage_Paypal_PayflowController extends Mage_Paypal_Controller_Express_Abstr return $this->getLayout() ->getBlock('payflow.link.iframe'); } -} \ No newline at end of file +} diff --git a/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php b/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php index d1b7d255d86..9b129006d62 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) */ @@ -33,27 +33,6 @@ */ class Mage_Paypal_PayflowadvancedController extends Mage_Paypal_Controller_Express_Abstract { - /** - * Config mode type - * - * @var string - */ - protected $_configType = 'paypal/config'; - - /** - * Config method type - * - * @var string - */ - protected $_configMethod = Mage_Paypal_Model_Config::METHOD_PAYFLOWADVANCED; - - /** - * Checkout mode type - * - * @var string - */ - protected $_checkoutType = 'paypal/payflowadvanced'; - /** * When a customer cancel payment from payflow gateway. * @@ -75,46 +54,60 @@ class Mage_Paypal_PayflowadvancedController extends Mage_Paypal_Controller_Expre */ public function returnUrlAction() { - $errorMsg = ''; + $redirectBlock = $this->_getIframeBlock() + ->setTemplate('paypal/payflowadvanced/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'; - $errorMsg = $this->__('Payment has been declined. Please try again.'); - } + if ($session->getLastRealOrderId()) { + $order = Mage::getModel('Mage_Sales_Model_Order')->loadByIncrementId($session->getLastRealOrderId()); - $checkToken = $this->getRequest()->getParam('TOKEN'); - if ($checkToken) { - $payment->setAdditionalInformation('express_checkout_token', $checkToken)->save(); - Mage::getSingleton('Mage_Paypal_Model_Session')->setExpressCheckoutToken($checkToken); - $this->_redirect('*/*/review'); - return; + 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 = $this->_getIframeBlock() - ->setTemplate('payflowadvanced/redirect.phtml'); - - $redirectBlock->setErrorMsg($errorMsg); - $redirectBlock->setGotoSection($gotoSection); $this->getResponse()->setBody($redirectBlock->toHtml()); } /** - * When a customer return to website from payflow gateway. + * Submit transaction to Payflow getaway into iframe * * @return void */ - public function placeOrderAction() + public function formAction() { - $session = $this->_getCheckout(); - $quote = $session->getQuote(); - $quote->collectTotals(); - $this->_forward('saveOrder', 'onepage', 'checkout'); + $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('Mage_Paypal_Model_Payflowadvanced'); + try { + $paymentModel->process($data); + } catch (Exception $e) { + Mage::logException($e); + } + } } /** @@ -153,58 +146,6 @@ class Mage_Paypal_PayflowadvancedController extends Mage_Paypal_Controller_Expre return $gotoSection; } - /** - * Submit transaction to Payflow getaway into iframe - * - * @return void - */ - public function formAction() - { - $quote = $this->_getCheckout()->getQuote(); - $payment = $quote->getPayment(); - - try { - $method = Mage::helper('Mage_Payment_Helper_Data')->getMethodInstance($this->_configMethod); - $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_advanced_iframe'); - - $block = $this->getLayout()->getBlock('payflow.advanced.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 - * - * @return void - */ - public function silentPostAction() - { - $data = $this->getRequest()->getPost(); - if (isset($data['INVNUM'])) { - /** @var $paymentModel Mage_Paypal_Model_Payflowadvanced */ - $paymentModel = Mage::getModel('Mage_Paypal_Model_Payflowadvanced'); - try { - $paymentModel->process($data); - } catch (Exception $e) { - Mage::logException($e); - } - } - } - /** * Get frontend checkout session object * @@ -226,4 +167,4 @@ class Mage_Paypal_PayflowadvancedController extends Mage_Paypal_Controller_Expre return $this->getLayout() ->getBlock('payflow.advanced.iframe'); } -} \ No newline at end of file +} diff --git a/app/code/core/Mage/Paypal/controllers/StandardController.php b/app/code/core/Mage/Paypal/controllers/StandardController.php index 084b9dbba56..2a3d13e21df 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 fb57830a40e..d5b67ed94ae 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 32346c13286..92c4afa0530 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) */ --> @@ -261,14 +261,6 @@ <model>Mage_Paypal_Model_Observer::fetchReports</model> </run> </paypal_fetch_settlement_reports> - <paypal_payment_transaction_clean> - <schedule> - <cron_expr>*/15 * * * *</cron_expr> - </schedule> - <run> - <model>Mage_Paypal_Model_Observer::cleanTransactions</model> - </run> - </paypal_payment_transaction_clean> </jobs> </crontab> <admin> diff --git a/app/code/core/Mage/Paypal/etc/system.xml b/app/code/core/Mage/Paypal/etc/system.xml index 28ef8ee1e9e..00b1abf1693 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) */ --> @@ -382,6 +382,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -557,6 +558,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -654,6 +656,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -803,6 +806,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -890,6 +894,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -1107,6 +1112,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -1313,6 +1319,7 @@ <sort_order>10</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -1589,6 +1596,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -1599,16 +1607,6 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> </payment_action> - <authorization_amount translate="label"> - <label>Verification Authorization Amount</label> - <comment><![CDATA[<a id="PayFlowLinkLearnMore" href="#">Learn More</a>]]></comment> - <config_path>payment/payflow_link/authorization_amount</config_path> - <frontend_type>select</frontend_type> - <source_model>Mage_Paypal_Model_System_Config_Source_AuthorizationAmounts</source_model> - <sort_order>15</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - </authorization_amount> <allowspecific translate="label"> <label>Payment Applicable From</label> <config_path>payment/payflow_link/allowspecific</config_path> @@ -1718,7 +1716,7 @@ </payflow_link> <payflow_advanced translate="label"> - <label>PayPal Paymets Advanced</label> + <label>PayPal Payments Advanced</label> <frontend_type>text</frontend_type> <sort_order>90</sort_order> <show_in_default>1</show_in_default> @@ -1750,6 +1748,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -1894,6 +1893,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> 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 7d9607b479d..a48575c1e6c 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/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 2b365d61da1..2a72d3e3809 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 cd2d420d4cf..7533b880769 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/Paypal/view/adminhtml/boxes.css b/app/code/core/Mage/Paypal/view/adminhtml/boxes.css index a5e78a00653..7c13c60dd3f 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/boxes.css +++ b/app/code/core/Mage/Paypal/view/adminhtml/boxes.css @@ -19,7 +19,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) */ .paypal-payment-notice { background:url(logo.gif) no-repeat 5px center #eaf0ee; border:1px solid #ccc; margin-bottom:10px; padding:10px 5px 5px 115px; } diff --git a/app/code/core/Mage/Paypal/view/adminhtml/layout.xml b/app/code/core/Mage/Paypal/view/adminhtml/layout.xml index 0f6bc806c9a..436b356085a 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Paypal/view/adminhtml/layout.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/code/core/Mage/Paypal/view/adminhtml/system/config/api_wizard.phtml b/app/code/core/Mage/Paypal/view/adminhtml/system/config/api_wizard.phtml index 292c3a0bb4e..57f79cc3c2a 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/system/config/api_wizard.phtml +++ b/app/code/core/Mage/Paypal/view/adminhtml/system/config/api_wizard.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,12 +33,12 @@ <tr> <td> <button style="" onclick="javascript:window.open('<?php echo $this->getButtonUrl()?>', 'apiwizard','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, ,left=100, top=100, width=380, height=470'); return false;" class="scalable" type="button" id="<?php echo $this->getHtmlId() ?>"> - <span><?php echo $this->escapeHtml($this->getButtonLabel()); ?></span> + <span><span><span><?php echo $this->escapeHtml($this->getButtonLabel()); ?></span></span></span> </button> </td> <td> <button style="" onclick="javascript:window.open('<?php echo $this->getSandboxButtonUrl()?>', 'apiwizard','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, ,left=100, top=100, width=380, height=470'); return false;" class="scalable" type="button" id="<?php echo $this->getSandboxHtmlId() ?>"> - <span><?php echo $this->escapeHtml($this->getSandboxButtonLabel()); ?></span> + <span><span><span><?php echo $this->escapeHtml($this->getSandboxButtonLabel()); ?></span></span></span> </button> </td> </tr> diff --git a/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/global.phtml b/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/global.phtml index 4be6da72679..e72622c8e2b 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/global.phtml +++ b/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/global.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/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/hint.phtml b/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/hint.phtml index 0d24af45e6f..fedcd1064b3 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/hint.phtml +++ b/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/hint.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/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/store.phtml b/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/store.phtml index 5c770061ea7..4633bfde60d 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/store.phtml +++ b/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/store.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/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/advanced.phtml b/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/advanced.phtml index a4b1332450d..da0c3df77f6 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/advanced.phtml +++ b/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/advanced.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) */ @@ -44,6 +44,12 @@ <li> Under Display <span style="text-decoration: underline">Options on Payment Page</span>, enter the following: <ul style="list-style:lower-roman;padding:0 2em;"> + <li> + <span style="text-decoration: underline">Cancel URL</span>:<br /> + <a href="<?php echo $this->getFrontendUrl('paypal/payflowadvanced/cancelPayment') ?>" onclick="return false;"> + <?php echo $this->getFrontendUrl('paypal/payflowadvanced/cancelPayment') ?> + </a> + </li> <li> <span style="text-decoration: underline">Error URL</span>:<br /> <a href="<?php echo $this->getFrontendUrl('paypal/payflowadvanced/returnUrl') ?>" onclick="return false;"> diff --git a/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/info.phtml b/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/info.phtml index 258d36f633c..2e3a0574f27 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/info.phtml +++ b/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/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) */ ?> @@ -45,6 +45,12 @@ <li> Under Display <span style="text-decoration: underline">Options on Payment Page</span>, enter the following: <ul style="list-style:lower-roman;padding:0 2em;"> + <li> + <span style="text-decoration: underline">Cancel URL</span>:<br /> + <a href="<?php echo $this->getFrontendUrl('paypal/payflow/cancelPayment') ?>" onclick="return false;"> + <?php echo $this->getFrontendUrl('paypal/payflow/cancelPayment') ?> + </a> + </li> <li> <span style="text-decoration: underline">Error URL</span>:<br /> <a href="<?php echo $this->getFrontendUrl('paypal/payflow/returnUrl') ?>" onclick="return false;"> @@ -95,27 +101,3 @@ </ul> </div> </div> -<div id="PayFlowLinkLearnMoreText" style="display:none"> - <?php echo $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.') ?> - - <ul style="list-style:disc; padding-left:2em;"> - <li> - <?php echo $this->__('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.') ?> - </li> - <li> - <?php echo $this->__('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.') ?> - </li> - </ul> -</div> -<script type="text/javascript"> -//<![CDATA[ - document.observe("dom:loaded", function() { - $('row_paypal_payflow_link_authorization_amount').insert({after:'<tr id="PayFlowLinkLearnMoreRow"><td colspan="4"><tr>'}); - $('PayFlowLinkLearnMoreRow').down().insert({top:$('PayFlowLinkLearnMoreText')}); - $('PayFlowLinkLearnMore').observe('click', function(event){ - $('PayFlowLinkLearnMoreText').toggle(); - event.stop(); - }); - }); -//]]> -</script> diff --git a/app/code/core/Mage/Paypal/view/frontend/express/review.phtml b/app/code/core/Mage/Paypal/view/frontend/express/review.phtml index 8844d19c2b2..2c549347114 100644 --- a/app/code/core/Mage/Paypal/view/frontend/express/review.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/express/review.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/code/core/Mage/Paypal/view/frontend/express/review/details.phtml b/app/code/core/Mage/Paypal/view/frontend/express/review/details.phtml index 85c4f223c68..210c56f83eb 100644 --- a/app/code/core/Mage/Paypal/view/frontend/express/review/details.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/express/review/details.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/code/core/Mage/Paypal/view/frontend/express/shortcut.phtml b/app/code/core/Mage/Paypal/view/frontend/express/shortcut.phtml index d6d53b27101..2648cdb86fd 100644 --- a/app/code/core/Mage/Paypal/view/frontend/express/shortcut.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/express/shortcut.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/code/core/Mage/Paypal/view/frontend/hss/form.phtml b/app/code/core/Mage/Paypal/view/frontend/hss/form.phtml index 513d9d3a548..2567d7659b7 100644 --- a/app/code/core/Mage/Paypal/view/frontend/hss/form.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/hss/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/code/core/Mage/Paypal/view/frontend/hss/iframe.phtml b/app/code/core/Mage/Paypal/view/frontend/hss/iframe.phtml index 1746f4502e8..3bf2e229d50 100644 --- a/app/code/core/Mage/Paypal/view/frontend/hss/iframe.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/hss/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/code/core/Mage/Paypal/view/frontend/hss/info.phtml b/app/code/core/Mage/Paypal/view/frontend/hss/info.phtml index bcc14191a70..ac8abc841df 100644 --- a/app/code/core/Mage/Paypal/view/frontend/hss/info.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/hss/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/code/core/Mage/Paypal/view/frontend/hss/js.phtml b/app/code/core/Mage/Paypal/view/frontend/hss/js.phtml index e5ba7a3a85f..c3457797afb 100644 --- a/app/code/core/Mage/Paypal/view/frontend/hss/js.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/hss/js.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/code/core/Mage/Paypal/view/frontend/hss/redirect.phtml b/app/code/core/Mage/Paypal/view/frontend/hss/redirect.phtml index a1b7983356c..37aff5c332d 100644 --- a/app/code/core/Mage/Paypal/view/frontend/hss/redirect.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/hss/redirect.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) */ @@ -32,6 +32,9 @@ <head> <script type="text/javascript"> //<![CDATA[ +if (window.top == window.self) { + window.location = "<?php echo $this->getUrl('checkout/cart') ?>"; +} <?php if ($this->getGotoSection()): ?> for (var s = 0; s < window.top.checkout.steps.length; s++) { if (window.top.checkout.steps[s] == '<?php echo $this->getGotoSection() ?>') { diff --git a/app/code/core/Mage/Paypal/view/frontend/hss/review/button.phtml b/app/code/core/Mage/Paypal/view/frontend/hss/review/button.phtml index 0ccca06a005..d4e0d8d7cb8 100644 --- a/app/code/core/Mage/Paypal/view/frontend/hss/review/button.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/hss/review/button.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/code/core/Mage/Paypal/view/frontend/layout.xml b/app/code/core/Mage/Paypal/view/frontend/layout.xml index 4868f6acad0..73f8165498f 100644 --- a/app/code/core/Mage/Paypal/view/frontend/layout.xml +++ b/app/code/core/Mage/Paypal/view/frontend/layout.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,56 +77,6 @@ </block> </paypal_express_review_details> - <paypal_payflow_review translate="label"> - <label>Order Review Form</label> - <remove name="right"/> - <remove name="left"/> - - <reference name="root"> - <action method="setTemplate"><template>1column.phtml</template></action> - </reference> - <reference name="content"> - <block type="Mage_Paypal_Block_Payflow_Link_Review" name="paypal.express.review" template="express/review.phtml"> - <block type="Mage_Paypal_Block_Express_Review_Details" name="paypal.express.review.details" as="details" template="express/review/details.phtml"> - <action method="addItemRender"><type>default</type><block>Mage_Checkout_Block_Cart_Item_Renderer</block><template>onepage/review/item.phtml</template></action> - <action method="addItemRender"><type>grouped</type><block>Mage_Checkout_Block_Cart_Item_Renderer_Grouped</block><template>onepage/review/item.phtml</template></action> - <action method="addItemRender"><type>configurable</type><block>Mage_Checkout_Block_Cart_Item_Renderer_Configurable</block><template>onepage/review/item.phtml</template></action> - <block type="Mage_Checkout_Block_Cart_Totals" name="paypal.express.review.details.totals" as="totals" template="onepage/review/totals.phtml"/> - </block> - <block type="Mage_Checkout_Block_Agreements" name="paypal.express.review.details.agreements" as="agreements" template="onepage/agreements.phtml"/> - </block> - </reference> - <reference name="head"> - <action method="addJs"><file>Mage_Paypal::review.js</file></action> - </reference> - <block type="Mage_Core_Block_Text_List" name="additional.product.info" /> - </paypal_payflow_review> - - <paypal_payflowadvanced_review translate="label"> - <label>Order Review Form</label> - <remove name="right"/> - <remove name="left"/> - - <reference name="root"> - <action method="setTemplate"><template>1column.phtml</template></action> - </reference> - <reference name="content"> - <block type="Mage_Paypal_Block_Payflow_Advanced_Review" name="paypal.express.review" template="express/review.phtml"> - <block type="Mage_Paypal_Block_Express_Review_Details" name="paypal.express.review.details" as="details" template="express/review/details.phtml"> - <action method="addItemRender"><type>default</type><block>Mage_Checkout_Block_Cart_Item_Renderer</block><template>onepage/review/item.phtml</template></action> - <action method="addItemRender"><type>grouped</type><block>Mage_Checkout_Block_Cart_Item_Renderer_Grouped</block><template>onepage/review/item.phtml</template></action> - <action method="addItemRender"><type>configurable</type><block>Mage_Checkout_Block_Cart_Item_Renderer_Configurable</block><template>onepage/review/item.phtml</template></action> - <block type="Mage_Checkout_Block_Cart_Totals" name="paypal.express.review.details.totals" as="totals" template="onepage/review/totals.phtml"/> - </block> - <block type="Mage_Checkout_Block_Agreements" name="paypal.express.review.details.agreements" as="agreements" template="onepage/agreements.phtml"/> - </block> - </reference> - <reference name="head"> - <action method="addJs"><file>Mage_Paypal::review.js</file></action> - </reference> - <block type="Mage_Core_Block_Text_List" name="additional.product.info" /> - </paypal_payflowadvanced_review> - <!-- Available logo types can be assigned with action="setLogoType": - wePrefer_150x60 @@ -228,12 +178,10 @@ Available logo types can be assigned with action="setLogoType": <paypal_payflow_link_iframe> <block type="Mage_Paypal_Block_Payflow_Link_Iframe" name="payflow.link.iframe" template="payflowlink/form.phtml" /> - <block type="Mage_Paypal_Block_Payflow_Link_Info" name="payflow.link.info" template="payflowlink/info.phtml" /> </paypal_payflow_link_iframe> <paypal_payflow_advanced_iframe> <block type="Mage_Paypal_Block_Payflow_Advanced_Iframe" name="payflow.advanced.iframe" template="payflowadvanced/form.phtml" /> - <block type="Mage_Paypal_Block_Payflow_Advanced_Info" name="payflow.advanced.info" template="payflowadvanced/info.phtml" /> </paypal_payflow_advanced_iframe> <paypal_hosted_pro_iframe> diff --git a/app/code/core/Mage/Paypal/view/frontend/partner/logo.phtml b/app/code/core/Mage/Paypal/view/frontend/partner/logo.phtml index f84a1448598..628315262e2 100644 --- a/app/code/core/Mage/Paypal/view/frontend/partner/logo.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/partner/logo.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/code/core/Mage/Paypal/view/frontend/payflowadvanced/form.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/form.phtml index 0a412e3f9c4..4dfaade3489 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/form.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/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/code/core/Mage/Paypal/view/frontend/payflowadvanced/iframe.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/iframe.phtml index 97dafa9f517..100bea56a24 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/iframe.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/iframe.phtml @@ -20,100 +20,29 @@ * * @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_Paypal_Block_Payflow_Advanced_Form */ ?> -<?php $_code = $this->getMethodCode() ?> -<div id="payment_form_<?php echo $_code ?>" style="display:none;"> -<div id="iframe-warning" class="warning-message" style="display:none;"> +<div id="iframe-warning" class="warning-message"> <?php echo $this->__('Please do not refresh the page until you complete payment.') ?> </div> - +<iframe id="payflow-advanced-iframe" style="display:none;" scrolling="no" frameborder="0" border="0" src="<?php echo $this->getFrameActionUrl() ?>" height="610" width="570"></iframe> <script type="text/javascript"> //<![CDATA[ -var PayflowAdvanced = Class.create(); -PayflowAdvanced.prototype = { - stepName: 'payment', - loadingText: ' <?php echo $this->__('Loading payment information...') ?> ', - loadingDefaultText: '', - buttonContinue: '', - pleaseWaitBox: '', - pleaseWaitBoxTextNode: '', - initialize: function(){ - this.buttonContinue = $(this.stepName + '-buttons-container').select('button').first(); - this.pleaseWaitBox = $(this.stepName + '-please-wait'); - - if (Prototype.Browser.IE) { - this.pleaseWaitBoxTextNode = this.pleaseWaitBox.childNodes[1]; - } else { - this.pleaseWaitBoxTextNode = this.pleaseWaitBox.childNodes[2]; - } - - this.loadingDefaultText = this.pleaseWaitBoxTextNode.nodeValue; - }, - showFrame: function(){ - if (!$('payflow-advanced-iframe')) { - this.showLoading(); - checkout.setLoadWaiting(this.stepName); - var payflowAdvancedIframe = '<iframe id="payflow-advanced-iframe" style="display:none;" scrolling="no" frameborder="0" border="0" ' - + 'src="<?php echo $this->getFrameActionUrl() ?>" height="610" width="570"></iframe>'; - $('payment_form_<?php echo $_code ?>').insert({bottom:payflowAdvancedIframe}); - $('payflow-advanced-iframe').observe('load', function(){ - if (!$('payflow-advanced-iframe').visible()) { - $('payflow-advanced-iframe').show(); - $('iframe-warning').show(); - } - payflowAdvanced.setSpinnerDefaultText(); - checkout.setLoadWaiting(false, true); - $(payflowAdvanced.buttonContinue).addClassName('disabled'); - - window.name = '<?php echo Mage::getBaseUrl(); ?>'; - }); - } else { - $(this.buttonContinue).addClassName('disabled'); - checkout.setLoadWaiting(this.stepName); - checkout.setLoadWaiting(false, true); - } - }, - hideFrame: function(){ - checkout.setLoadWaiting(this.stepName); - checkout.setLoadWaiting(false); - $(this.buttonContinue).removeClassName('disabled'); - }, - setSpinnerText: function(text){ - if (!text) { - text = this.loadingText; - } - this.pleaseWaitBoxTextNode.nodeValue = text; - }, - setSpinnerDefaultText: function(){ - this.pleaseWaitBoxTextNode.nodeValue = this.loadingDefaultText; - }, - showLoading: function(){ - this.setSpinnerText(); - $(this.buttonContinue).addClassName('disabled'); - checkout.setLoadWaiting(this.stepName); - } -} -var payflowAdvanced; - -Event.observe($('payment_form_<?php echo $_code ?>'), 'payment-method:switched', function(event){ - if (!window.payflowAdvanced) { - window.payflowAdvanced = new PayflowAdvanced(); - } - if (!payflowAdvanced) { - payflowAdvanced = window.payflowAdvanced; - } - payflowAdvanced.showFrame(); +var headers = $$('#' + checkout.accordion.container.readAttribute('id') + ' .section'); +headers.each(function(header) { + header.removeClassName('allow'); }); -Event.observe($('payment_form_<?php echo $_code ?>'), 'payment-method:switched-off', function(event){ - payflowAdvanced.hideFrame(); +$('payflow-advanced-iframe').observe('load', function(){ + $('payflow-advanced-iframe').show(); + $('iframe-warning').show(); + checkout.loadWaiting = 'review'; + checkout.setLoadWaiting(false); + if (checkout.accordion.currentSection == 'opc-review') { + $('checkout-review-submit').hide(); + } }); -if ($('p_method_payflow_advanced').checked) { - $('payment_form_<?php echo $_code ?>').fire('payment-method:switched', {method_code : '<?php echo $_code ?>'}); -} //]]> </script> -</div> diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/info.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/info.phtml index 9b3bf830608..5c7a437bb11 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/info.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/info.phtml @@ -20,22 +20,16 @@ * * @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_Paypal_Block_Payflow_Advanced_Info + * @var $this Mage_Paypal_Block_Payflow_Advanced_Form */ ?> -<html> -<head></head> -<body> -<script type="text/javascript"> - var errorMessage = '<?php echo $this->getErrorMessage() ?>'; - if (errorMessage) { - alert(errorMessage); - } -</script> -</body> -</html> +<ul id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none" class="form-list"> + <li> + <?php echo $this->__('You will be required to enter your payment details after you place an order.') ?> + </li> +</ul> diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/redirect.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/redirect.phtml index 654b5f04715..1b01f8db6e9 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/redirect.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/redirect.phtml @@ -20,66 +20,49 @@ * * @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_Paypal_Block_Iframe + * @var $this Mage_Paypal_Block_Payflow_Advanced_Iframe */ ?> <html> <head> <script type="text/javascript"> //<![CDATA[ - function allowCheckoutSteps(allow) - { - var window_top = window.top; - for (var s = 0; s < window_top.checkout.steps.length; s++) { - if (window_top.checkout.steps[s] == '<?php echo $this->getGotoSection() ?>') { - break; - } - if (window_top.document.getElementById('opc-' + window_top.checkout.steps[s])) { - if (allow) { - window_top.document.getElementById('opc-' + window_top.checkout.steps[s]).addClassName('allow'); - } else { - window_top.document.getElementById('opc-' + window_top.checkout.steps[s]).removeClassName('allow'); - } - } - } + if (window.top == window.self) { + window.location = "<?php echo $this->getUrl('checkout/cart') ?>"; } -if (window.top==window.self) { - window.location = "<?php echo $this->getUrl('checkout/cart') ?>"; -} -var window_name = '<?php echo Mage::getBaseUrl(); ?>'; -var window_top = window.top; -var allowed_domain = false; -try{ - allowed_domain = window_name == window_top.name -}catch(e){ - allowed_domain = false; -} -<?php if ($this->getErrorMsg()): ?> - alert('<?php echo $this->getErrorMsg() ?>'); - if (allowed_domain) { - window_top.payflowAdvanced.showLoading(); + var window_top = window.top; +<?php if ($this->getGotoSection()): ?> + var checkout_steps; + + try{ + checkout_steps = window.top.checkout.steps + }catch(e){ + window_top.location="<?php echo $this->getUrl('checkout/cart') ?>"; } - window.location = "<?php echo $this->getUrl('paypal/payflowadvanced/form') ?>"; -<?php else: ?> - if (allowed_domain) { - <?php if ($this->getGotoSection()): ?> - allowCheckoutSteps(true); - <?php if ($this->getGotoSection() == 'review'): ?> - allowCheckoutSteps(false); - window_top.payment.save(); - <?php else : ?> - window_top.checkout.gotoSection("<?php echo $this->getGotoSection() ?>"); - <?php endif; ?> - <?php else : ?> - window_top.location="<?php echo $this->getUrl('checkout/cart') ?>"; - <?php endif; ?> - } else { - alert('<?php echo $this->jsQuoteEscape($this->__('Wrong configuration of Payment Method'));?>'); + + for (var s = 0; s < checkout_steps.length; s++) { + if (checkout_steps[s] == '<?php echo $this->getGotoSection() ?>') { + break; + } + if (window_top.document.getElementById('opc-' + checkout_steps[s])) { + window_top.document.getElementById('opc-' + checkout_steps[s]).addClassName('allow'); + } } + window_top.checkout.gotoSection("<?php echo $this->getGotoSection() ?>"); + window_top.document.getElementById('checkout-review-submit').show(); + window_top.document.getElementById('iframe-warning').hide(); + <?php if ($this->getErrorMsg()): ?> + alert('<?php echo $this->getErrorMsg() ?>'); + <?php endif; ?> +<?php elseif ($this->getGotoSuccessPage()) : ?> + window_top.location="<?php echo $this->getUrl('checkout/onepage/success') ?>"; +<?php else : ?> + window_top.location="<?php echo $this->getUrl('checkout/cart') ?>"; <?php endif; ?> //]]> </script> diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowlink/form.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowlink/form.phtml index 513d9d3a548..2567d7659b7 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowlink/form.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowlink/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/code/core/Mage/Paypal/view/frontend/payflowlink/iframe.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowlink/iframe.phtml index e77f2c25f87..3156003c7a2 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowlink/iframe.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowlink/iframe.phtml @@ -20,100 +20,29 @@ * * @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_Paypal_Block_Payflow_Link_Form */ ?> -<?php $_code=$this->getMethodCode() ?> -<div id="payment_form_<?php echo $_code ?>" style="display:none;"> -<div id="iframe-warning" class="warning-message" style="display:none;"> +<div id="iframe-warning" class="warning-message"> <?php echo $this->__('Please do not refresh the page until you complete payment.') ?> </div> - +<iframe id="payflow-link-iframe" style="display:none;" scrolling="no" frameborder="0" border="0" src="<?php echo $this->getFrameActionUrl() ?>" height="610" width="570"></iframe> <script type="text/javascript"> //<![CDATA[ -var PayflowLink = Class.create(); -PayflowLink.prototype = { - stepName: 'payment', - loadingText: ' <?php echo $this->__('Loading payment information...') ?> ', - loadingDefaultText: '', - buttonContinue: '', - pleaseWaitBox: '', - pleaseWaitBoxTextNode: '', - initialize: function(){ - this.buttonContinue = $(this.stepName + '-buttons-container').select('button').first(); - this.pleaseWaitBox = $(this.stepName + '-please-wait'); - - if (Prototype.Browser.IE) { - this.pleaseWaitBoxTextNode = this.pleaseWaitBox.childNodes[1]; - } else { - this.pleaseWaitBoxTextNode = this.pleaseWaitBox.childNodes[2]; - } - - this.loadingDefaultText = this.pleaseWaitBoxTextNode.nodeValue; - }, - showFrame: function(){ - if (!$('payflow-link-iframe')) { - this.showLoading(); - checkout.setLoadWaiting(this.stepName); - var payflowLinkIframe = '<iframe id="payflow-link-iframe" style="display:none;" scrolling="no" frameborder="0" border="0" ' - + 'src="<?php echo $this->getFrameActionUrl() ?>" height="610" width="570"></iframe>'; - $('payment_form_<?php echo $_code ?>').insert({bottom:payflowLinkIframe}); - $('payflow-link-iframe').observe('load', function(){ - if (!$('payflow-link-iframe').visible()) { - $('payflow-link-iframe').show(); - $('iframe-warning').show(); - } - payflowLink.setSpinnerDefaultText(); - checkout.setLoadWaiting(false, true); - $(payflowLink.buttonContinue).addClassName('disabled'); - - window.name = '<?php echo Mage::getBaseUrl(); ?>'; - }); - } else { - $(this.buttonContinue).addClassName('disabled'); - checkout.setLoadWaiting(this.stepName); - checkout.setLoadWaiting(false, true); - } - }, - hideFrame: function(){ - checkout.setLoadWaiting(this.stepName); - checkout.setLoadWaiting(false); - $(this.buttonContinue).removeClassName('disabled'); - }, - setSpinnerText: function(text){ - if (!text) { - text = this.loadingText; - } - this.pleaseWaitBoxTextNode.nodeValue = text; - }, - setSpinnerDefaultText: function(){ - this.pleaseWaitBoxTextNode.nodeValue = this.loadingDefaultText; - }, - showLoading: function(){ - this.setSpinnerText(); - $(this.buttonContinue).addClassName('disabled'); - checkout.setLoadWaiting(this.stepName); - } -} -var payflowLink; - -Event.observe($('payment_form_<?php echo $_code ?>'), 'payment-method:switched', function(event){ - if (!window.payflowLink) { - window.payflowLink = new PayflowLink(); - } - if (!payflowLink) { - payflowLink = window.payflowLink; - } - payflowLink.showFrame(); +var headers = $$('#' + checkout.accordion.container.readAttribute('id') + ' .section'); +headers.each(function(header) { + header.removeClassName('allow'); }); -Event.observe($('payment_form_<?php echo $_code ?>'), 'payment-method:switched-off', function(event){ - payflowLink.hideFrame(); +$('payflow-link-iframe').observe('load', function(){ + $('payflow-link-iframe').show(); + $('iframe-warning').show(); + checkout.loadWaiting = 'review'; + checkout.setLoadWaiting(false); + if (checkout.accordion.currentSection == 'opc-review') { + $('checkout-review-submit').hide(); + } }); -if ($('p_method_payflow_link').checked) { - $('payment_form_<?php echo $_code ?>').fire('payment-method:switched', {method_code : '<?php echo $_code ?>'}); -} //]]> </script> -</div> diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowlink/info.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowlink/info.phtml index 26bcb98cc13..00f72ad74f8 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowlink/info.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowlink/info.phtml @@ -20,22 +20,16 @@ * * @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_Paypal_Block_Payflow_Link_Info + * @var $this Mage_Paypal_Block_Payflow_Link_Form */ ?> -<html> -<head></head> -<body> -<script type="text/javascript"> - var errorMessage = '<?php echo $this->getErrorMessage() ?>'; - if (errorMessage) { - alert(errorMessage); - } -</script> -</body> -</html> +<ul id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none" class="form-list"> + <li> + <?php echo $this->__('You will be required to enter your payment details after you place an order.') ?> + </li> +</ul> diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowlink/redirect.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowlink/redirect.phtml index 5cc0c5f6331..fbc11ac9950 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowlink/redirect.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowlink/redirect.phtml @@ -20,66 +20,49 @@ * * @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_Paypal_Block_Iframe + * @var $this Mage_Paypal_Block_Payflow_Link_Iframe */ ?> <html> <head> <script type="text/javascript"> //<![CDATA[ - function allowCheckoutSteps(allow) - { - var window_top = window.top; - for (var s = 0; s < window_top.checkout.steps.length; s++) { - if (window_top.checkout.steps[s] == '<?php echo $this->getGotoSection() ?>') { - break; - } - if (window_top.document.getElementById('opc-' + window_top.checkout.steps[s])) { - if (allow) { - window_top.document.getElementById('opc-' + window_top.checkout.steps[s]).addClassName('allow'); - } else { - window_top.document.getElementById('opc-' + window_top.checkout.steps[s]).removeClassName('allow'); - } - } - } + if (window.top == window.self) { + window.location = "<?php echo $this->getUrl('checkout/cart') ?>"; } -if (window.top==window.self) { - window.location = "<?php echo $this->getUrl('checkout/cart') ?>"; -} -var window_name = '<?php echo Mage::getBaseUrl(); ?>'; -var window_top = window.top; -var allowed_domain = false; -try{ - allowed_domain = window_name == window_top.name -}catch(e){ - allowed_domain = false; -} -<?php if ($this->getErrorMsg()): ?> - alert('<?php echo $this->getErrorMsg() ?>'); - if (allowed_domain) { - window_top.payflowLink.showLoading(); + var window_top = window.top; +<?php if ($this->getGotoSection()): ?> + var checkout_steps; + + try{ + checkout_steps = window.top.checkout.steps + }catch(e){ + window_top.location="<?php echo $this->getUrl('checkout/cart') ?>"; } - window.location = "<?php echo $this->getUrl('paypal/payflow/form') ?>"; -<?php else: ?> - if (allowed_domain) { - <?php if ($this->getGotoSection()): ?> - allowCheckoutSteps(true); - <?php if ($this->getGotoSection() == 'review'): ?> - allowCheckoutSteps(false); - window_top.payment.save(); - <?php else : ?> - window_top.checkout.gotoSection("<?php echo $this->getGotoSection() ?>"); - <?php endif; ?> - <?php else : ?> - window_top.location="<?php echo $this->getUrl('checkout/cart') ?>"; - <?php endif; ?> - } else { - alert('<?php echo $this->jsQuoteEscape($this->__('Wrong configuration of Payment Method')) ;?>'); + + for (var s = 0; s < checkout_steps.length; s++) { + if (checkout_steps[s] == '<?php echo $this->getGotoSection() ?>') { + break; + } + if (window_top.document.getElementById('opc-' + checkout_steps[s])) { + window_top.document.getElementById('opc-' + checkout_steps[s]).addClassName('allow'); + } } + window_top.checkout.gotoSection("<?php echo $this->getGotoSection() ?>"); + window_top.document.getElementById('checkout-review-submit').show(); + window_top.document.getElementById('iframe-warning').hide(); + <?php if ($this->getErrorMsg()): ?> + alert('<?php echo $this->getErrorMsg() ?>'); + <?php endif; ?> +<?php elseif ($this->getGotoSuccessPage()) : ?> + window_top.location="<?php echo $this->getUrl('checkout/onepage/success') ?>"; +<?php else : ?> + window_top.location="<?php echo $this->getUrl('checkout/cart') ?>"; <?php endif; ?> //]]> </script> diff --git a/app/code/core/Mage/Paypal/view/frontend/payment/mark.phtml b/app/code/core/Mage/Paypal/view/frontend/payment/mark.phtml index 1c16cc4d69a..da7afe8809a 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payment/mark.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payment/mark.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/code/core/Mage/Paypal/view/frontend/payment/redirect.phtml b/app/code/core/Mage/Paypal/view/frontend/payment/redirect.phtml index 29198e83c61..93362d07bba 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payment/redirect.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payment/redirect.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/code/core/Mage/Paypal/view/frontend/review.js b/app/code/core/Mage/Paypal/view/frontend/review.js index 8b308dc5b6b..2fdf46c3a71 100644 --- a/app/code/core/Mage/Paypal/view/frontend/review.js +++ b/app/code/core/Mage/Paypal/view/frontend/review.js @@ -19,7 +19,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/code/core/Mage/PaypalUk/Block/Express/Form.php b/app/code/core/Mage/PaypalUk/Block/Express/Form.php index 199e02e618a..bea0dae6114 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 119754eda16..fef56af7d57 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 347bb5411c7..9c5c7a8d8f0 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 c59f3e8de6c..1c447af357a 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 2f9097f1b88..325956d842f 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 87df733a801..64383eb90ce 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 8a0ed78c7f8..e06cdca4523 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) */ diff --git a/app/code/core/Mage/PaypalUk/Model/Pro.php b/app/code/core/Mage/PaypalUk/Model/Pro.php index eeeef6da4c0..bfd680eec04 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 327b7024294..e4e8f51446a 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 cb7a04d0fbf..5bd8dc644ec 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 d3374b9a03b..434f2cece1c 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 0689c15811a..f974f2264af 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/view/frontend/layout.xml b/app/code/core/Mage/PaypalUk/view/frontend/layout.xml index 5ee8435d778..8fa647dc79e 100644 --- a/app/code/core/Mage/PaypalUk/view/frontend/layout.xml +++ b/app/code/core/Mage/PaypalUk/view/frontend/layout.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/code/core/Mage/Persistent/Block/Form/Remember.php b/app/code/core/Mage/Persistent/Block/Form/Remember.php index da87deb601b..fd5fedba47e 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 028086f454b..3732630aae7 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 e7bc5f7ab7a..2ddb5e92fea 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 df58f5c8039..18256e7bff1 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 @@ class Mage_Persistent_Helper_Session extends Mage_Core_Helper_Data */ public function isPersistent() { - return (bool)$this->getSession()->getId() && Mage::helper('Mage_Persistent_Helper_Data')->isEnabled(); + return $this->getSession()->getId() && Mage::helper('Mage_Persistent_Helper_Data')->isEnabled(); } /** diff --git a/app/code/core/Mage/Persistent/Model/Observer.php b/app/code/core/Mage/Persistent/Model/Observer.php index e8d3a31b51e..75d7ff2068d 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) */ @@ -299,8 +299,7 @@ class Mage_Persistent_Model_Observer { /** @var $customerSession Mage_Customer_Model_Session */ $customerSession = Mage::getSingleton('Mage_Customer_Model_Session'); - $customerSession->setCustomerId(null) - ->setCustomerGroupId(null); + $customerSession->setCustomerId(null)->setCustomerGroupId(null); if (Mage::app()->getRequest()->getParam('context') != 'checkout') { $this->_expirePersistentSession(); @@ -325,8 +324,7 @@ class Mage_Persistent_Model_Observer /** @var $customerSession Mage_Customer_Model_Session */ $customerSession = Mage::getSingleton('Mage_Customer_Model_Session'); if (!$customerSession->isLoggedIn()) { - $customerSession->setCustomerId(null) - ->setCustomerGroupId(null); + $customerSession->setCustomerId(null)->setCustomerGroupId(null); } $this->setQuoteGuest(); @@ -502,6 +500,8 @@ class Mage_Persistent_Model_Observer && !$this->_isPersistent() && !$customerSession->isLoggedIn() && Mage::getSingleton('Mage_Checkout_Model_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 f84599273e4..0571e43dffd 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 4f85b8da084..04be60a875c 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 a2ac749d90f..d308fb83f44 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 @@ class Mage_Persistent_Model_Resource_Session extends Mage_Core_Model_Resource_Db { $select = parent::_getLoadSelect($field, $value, $object); if (!$object->getLoadExpired()) { - $select->where('updated_at >= ?', $object->getExpiredBefore()); + $select->join( + array('customer' => $this->getTable('customer_entity')), + 'customer.entity_id = persistent_session.customer_id' + )->where('persistent_session.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 c235f7e1255..8cff9ed6af3 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 2ebafa6ef3e..e5019215974 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) */ diff --git a/app/code/core/Mage/Persistent/etc/adminhtml.xml b/app/code/core/Mage/Persistent/etc/adminhtml.xml index 5ccdc32bc49..7aeb3491c68 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 adb22ff0094..99392349cf7 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) */ --> diff --git a/app/code/core/Mage/Persistent/etc/persistent.xml b/app/code/core/Mage/Persistent/etc/persistent.xml index a59670c68ff..60846b683fe 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 6ddca53a841..5f715beaba7 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 342cb44575d..b0f12af6cd0 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/Persistent/view/frontend/checkout/onepage/billing.phtml b/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/billing.phtml index 854b359aa9f..7094709660c 100644 --- a/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/billing.phtml +++ b/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/billing.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 Mage_Checkout_Block_Onepage_Billing $this */ @@ -70,6 +70,12 @@ </div> </li> <?php endfor ?> + <li class="wide"> + <label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label> + <div class="input-box"> + <input type="text" id="billing:vat_id" name="billing[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text" /> + </div> + </li> <li class="fields"> <div class="field"> <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label> @@ -166,6 +172,7 @@ <?php else:?> <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li> <?php endif; ?> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?> </fieldset> diff --git a/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/login.phtml b/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/login.phtml index cee555445c4..6e9e703c646 100644 --- a/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/login.phtml +++ b/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/login.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) */ ?> @@ -87,6 +87,7 @@ <input type="password" class="input-text required-entry" id="login-password" name="login[password]" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> <?php echo $this->getChildHtml('persistent.remember.me'); ?> </ul> <input name="context" type="hidden" value="checkout" /> diff --git a/app/code/core/Mage/Persistent/view/frontend/customer/form/login.phtml b/app/code/core/Mage/Persistent/view/frontend/customer/form/login.phtml index 35b6a02b6ee..b1c3f552cf0 100644 --- a/app/code/core/Mage/Persistent/view/frontend/customer/form/login.phtml +++ b/app/code/core/Mage/Persistent/view/frontend/customer/form/login.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,6 +62,7 @@ <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> <?php echo $this->getChildHtml('persistent.remember.me'); ?> </ul> <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?> diff --git a/app/code/core/Mage/Persistent/view/frontend/customer/form/register.phtml b/app/code/core/Mage/Persistent/view/frontend/customer/form/register.phtml index f36b3d45772..52c5342c04a 100644 --- a/app/code/core/Mage/Persistent/view/frontend/customer/form/register.phtml +++ b/app/code/core/Mage/Persistent/view/frontend/customer/form/register.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) */ ?> @@ -165,6 +165,7 @@ </div> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> <?php echo $this->getChildHtml('persistent.remember.me'); ?> </ul> <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?> diff --git a/app/code/core/Mage/Persistent/view/frontend/layout.xml b/app/code/core/Mage/Persistent/view/frontend/layout.xml index 09aac8c75b2..c326592c90c 100644 --- a/app/code/core/Mage/Persistent/view/frontend/layout.xml +++ b/app/code/core/Mage/Persistent/view/frontend/layout.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/code/core/Mage/Persistent/view/frontend/remember_me.phtml b/app/code/core/Mage/Persistent/view/frontend/remember_me.phtml index 8f5b309b713..9b821229c55 100644 --- a/app/code/core/Mage/Persistent/view/frontend/remember_me.phtml +++ b/app/code/core/Mage/Persistent/view/frontend/remember_me.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/code/core/Mage/Persistent/view/frontend/remember_me_tooltip.phtml b/app/code/core/Mage/Persistent/view/frontend/remember_me_tooltip.phtml index bcb46ccd23f..fa796e3c0d3 100644 --- a/app/code/core/Mage/Persistent/view/frontend/remember_me_tooltip.phtml +++ b/app/code/core/Mage/Persistent/view/frontend/remember_me_tooltip.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/code/core/Mage/Poll/Block/ActivePoll.php b/app/code/core/Mage/Poll/Block/ActivePoll.php index 1bfecd1b81b..40937c32ecd 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) */ diff --git a/app/code/core/Mage/Poll/Helper/Data.php b/app/code/core/Mage/Poll/Helper/Data.php index 44d9c973598..a0b915e64f7 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/Poll.php b/app/code/core/Mage/Poll/Model/Poll.php index 922ff7a1d34..c7d3409bf46 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) */ diff --git a/app/code/core/Mage/Poll/Model/Poll/Answer.php b/app/code/core/Mage/Poll/Model/Poll/Answer.php index a9180c19199..0767dc5b418 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 6e3045fbed3..87d545fc3ea 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 a91eca5a665..acc1cc433f2 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 d020e9275a4..7bfd60b8397 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 7140e7d8717..91496935989 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 8ef2aebd5f9..86774ea5640 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 422ac77945d..ae669cca02d 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 6f21cbf78ea..7cf9fd44ff1 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 ccf376e4066..cae80f3a9b0 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 f950a2f6988..0a1bbc1e82e 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 aba9bab9faa..74529904f2f 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 247e62aed4a..358736f9edf 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 68000ec8272..a7d22648be9 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/view/frontend/active.phtml b/app/code/core/Mage/Poll/view/frontend/active.phtml index 3bbfd4b134e..f54ef112ec9 100644 --- a/app/code/core/Mage/Poll/view/frontend/active.phtml +++ b/app/code/core/Mage/Poll/view/frontend/active.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/code/core/Mage/Poll/view/frontend/layout.xml b/app/code/core/Mage/Poll/view/frontend/layout.xml index 3ba15ef7a44..44c01dc1f4c 100644 --- a/app/code/core/Mage/Poll/view/frontend/layout.xml +++ b/app/code/core/Mage/Poll/view/frontend/layout.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/code/core/Mage/Poll/view/frontend/result.phtml b/app/code/core/Mage/Poll/view/frontend/result.phtml index c2229d7348b..e1b9c095e4c 100644 --- a/app/code/core/Mage/Poll/view/frontend/result.phtml +++ b/app/code/core/Mage/Poll/view/frontend/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/code/core/Mage/ProductAlert/Block/Email/Abstract.php b/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php index b6ff4b950e6..5dc880d0695 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 622c849c909..44a4b9ff811 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 1f78e9ee892..6b7121d07ae 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/Product/View.php b/app/code/core/Mage/ProductAlert/Block/Product/View.php index b6f8969d6e8..fabe2868c77 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) */ diff --git a/app/code/core/Mage/ProductAlert/Helper/Data.php b/app/code/core/Mage/ProductAlert/Helper/Data.php index cad126a2241..690fca27d0c 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('Mage_Customer_Model_Session'); diff --git a/app/code/core/Mage/ProductAlert/Model/Email.php b/app/code/core/Mage/ProductAlert/Model/Email.php index a64898bff44..1e6d0dd309f 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/Observer.php b/app/code/core/Mage/ProductAlert/Model/Observer.php index d303680c58b..65e5b6c1e34 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 836b2b66be8..7ef817fa539 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 d09ed0894c2..e44885b06d9 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 823ca683690..eb7be8428dd 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 07e123cd7e2..192eb458f03 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 31d799f0185..e85beacefda 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 99d997de84c..7afdd421c5c 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 ebe4e3ddd3e..ea31c0c85a8 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 e963f39af65..e6c551ab8b8 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 41bb588aad8..b92aa06acc5 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 eeabb9baaf1..8cc72c2637c 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 @@ class Mage_ProductAlert_AddController extends Mage_Core_Controller_Front_Action 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 e3da6eb42c4..036499c8d7b 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 ecf02ac3733..2552ebe7400 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 4fdaabb6b38..b9b801e8d26 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 16aaf0bf0a8..415676cd736 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/view/frontend/email/price.phtml b/app/code/core/Mage/ProductAlert/view/frontend/email/price.phtml index 680800d485b..6f8a3056364 100644 --- a/app/code/core/Mage/ProductAlert/view/frontend/email/price.phtml +++ b/app/code/core/Mage/ProductAlert/view/frontend/email/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/code/core/Mage/ProductAlert/view/frontend/email/stock.phtml b/app/code/core/Mage/ProductAlert/view/frontend/email/stock.phtml index b2566d282c5..0ab15959522 100644 --- a/app/code/core/Mage/ProductAlert/view/frontend/email/stock.phtml +++ b/app/code/core/Mage/ProductAlert/view/frontend/email/stock.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/code/core/Mage/ProductAlert/view/frontend/layout.xml b/app/code/core/Mage/ProductAlert/view/frontend/layout.xml index 0f0399c0cca..369319f454c 100644 --- a/app/code/core/Mage/ProductAlert/view/frontend/layout.xml +++ b/app/code/core/Mage/ProductAlert/view/frontend/layout.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/code/core/Mage/ProductAlert/view/frontend/product/view.phtml b/app/code/core/Mage/ProductAlert/view/frontend/product/view.phtml index 1f502d865e7..c28dcb44f88 100644 --- a/app/code/core/Mage/ProductAlert/view/frontend/product/view.phtml +++ b/app/code/core/Mage/ProductAlert/view/frontend/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/code/core/Mage/Rating/Block/Entity/Detailed.php b/app/code/core/Mage/Rating/Block/Entity/Detailed.php index 66f389323f8..74d73afdd2e 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 a71b6c27561..1c4e894cbca 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/Observer.php b/app/code/core/Mage/Rating/Model/Observer.php index de2c51b5f5c..e3aa81d9742 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 333b93e4bec..aec5ef9c29e 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 447a09d0fed..6c4dc2bff83 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 939afac1727..042226aec5e 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 4807f2dc6e1..13e04d216c7 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 6752b305784..b2f164c1fe1 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) */ 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 12566eda696..7786852f078 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 a84c23f9a8b..1b48176f5bd 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 e71fda1615a..b11f3a49704 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 b027beacd60..f4ad412a8e8 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 82217277e5a..2d3be94a10c 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 13afd075c28..54d71ddb620 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 09b8cad32f2..31ddee90776 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 9a3f92b53b2..b90406640b1 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 e17357aa9a2..111a431a6f9 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 12a98e35b86..574d69f54e8 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/view/frontend/detailed.phtml b/app/code/core/Mage/Rating/view/frontend/detailed.phtml index 9acff8d8968..f813ad07cf3 100644 --- a/app/code/core/Mage/Rating/view/frontend/detailed.phtml +++ b/app/code/core/Mage/Rating/view/frontend/detailed.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/code/core/Mage/Rating/view/frontend/empty.phtml b/app/code/core/Mage/Rating/view/frontend/empty.phtml index 4ef3ac05cc0..f61cce5ea1b 100644 --- a/app/code/core/Mage/Rating/view/frontend/empty.phtml +++ b/app/code/core/Mage/Rating/view/frontend/empty.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/code/core/Mage/Reports/Block/Product/Abstract.php b/app/code/core/Mage/Reports/Block/Product/Abstract.php index 8860c41aa20..56ab21443bf 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 abd5c7b5dca..4c5e5b54148 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 c09553aee97..5ff979fbd80 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 899733dc2b1..1717a33f6e4 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 3a983d3ef6a..9afd18002fc 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 bea573e35ad..9696c56c882 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 4b6cc23784b..7021a7a828a 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 64d8993a4a6..93c5e25e24c 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 493ac93f989..0b1544b4b7e 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 1249d763669..d5a5ea207a9 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 378fe2e2437..757e307250f 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 fe2fad95f93..891d1fdc36f 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) */ @@ -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/Grouped/Collection.php b/app/code/core/Mage/Reports/Model/Grouped/Collection.php index 5503174b1dc..1852b2c5ba5 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/Product/Index/Abstract.php b/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php index 261d86c337b..f82ebdc4ec2 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 2afc71b8e1b..176bde8f294 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 cc5cb69a37e..79ba3614ad7 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 8644f537309..5f6ae7c015b 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 143c50fbc6e..d91f7826f03 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/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php index c7b44eb6256..14532fa86cb 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 c5c42ceb889..dc2e763e107 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 d7c9045eb95..f42e1e628dd 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 9bdd82060e5..acb791253fe 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 dc6c35223ca..eb0755219f0 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 dac9d073b45..20bfbadc802 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 f9aeee042fd..d40b4ffbc8a 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 c13989f34f0..64a147ebda8 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 new file mode 100644 index 00000000000..a4fa36f108f --- /dev/null +++ b/app/code/core/Mage/Reports/Model/Resource/Helper/Interface.php @@ -0,0 +1,51 @@ +<?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_Reports + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Reports resource helper interface + */ +interface Mage_Reports_Model_Resource_Helper_Interface +{ + /** + * Merge Index data + * + * @param string $mainTable + * @param array $data + * @return string + */ + public function mergeVisitorProductIndex($mainTable, $data, $matchFields); + + /** + * Update rating position + * + * @param string $type day|month|year + * @param string $column + * @param string $mainTable + * @param string $aggregationTable + * @return Mage_Core_Model_Resource_Helper_Abstract + */ + public function updateReportRatingPos($type, $column, $mainTable, $aggregationTable); +} 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 cbd353c44d4..b16f776ade9 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_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 @@ * @author Magento Core Team <core@magentocommerce.com> */ 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 @@ class Mage_Reports_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource 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/Order/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php index 7745d2587d2..f7f5bfc1e26 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 c700907d5d4..73fb5bbd114 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 7d9316671cb..c312cfa8bbe 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 9e13008f89b..d3664df3ab6 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 f890264a79e..5f2bb29c7d9 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 c6e6e9ae222..83c612fe2d4 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 416595751e2..7eac32a367d 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 2366ce0bc75..f32b82f990a 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 26ffcabbfae..6dfb31d327a 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 350ecbd390d..8a72c9277d5 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 840fec7365c..698ea3653ad 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 a0cc06164ae..680243556f4 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 6c7476732bc..d6ec47e4e77 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 027c2c25052..e44d93a02c8 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/Report/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php index 6949d944eed..f719943f620 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) */ @@ -368,7 +368,7 @@ abstract class Mage_Reports_Model_Resource_Report_Abstract extends Mage_Core_Mod 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 @@ abstract class Mage_Reports_Model_Resource_Report_Abstract extends Mage_Core_Mod $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 @@ abstract class Mage_Reports_Model_Resource_Report_Abstract extends Mage_Core_Mod 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.php b/app/code/core/Mage/Reports/Model/Resource/Report/Collection.php index 2658baf7547..9bbd170563b 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 new file mode 100644 index 00000000000..9244b4a3606 --- /dev/null +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php @@ -0,0 +1,287 @@ +<?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_Reports + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Report collection abstract model + * + * @category Mage + * @package Mage_Reports + * @author Magento Core Team <core@magentocommerce.com> + */ +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 + 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 00000000000..f9ea9587a2d --- /dev/null +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed.php @@ -0,0 +1,212 @@ +<?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_Reports + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Most viewed product report aggregate resource model + * + * @category Mage + * @package Mage_Reports + * @author Magento Core Team <core@magentocommerce.com> + */ +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('report_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('report_event')), + 'source_table.logged_at', $from, $to + ) + ); + + $helper = Mage::getResourceHelper('Mage_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('report_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('Mage_Catalog_Model_Resource_Product'); + + $select->joinInner( + array( + 'product' => $this->getTable('catalog_product_entity')), + '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('Mage_Reports') + ->updateReportRatingPos('day', 'views_num', $mainTable, $this->getTable(self::AGGREGATION_DAILY)); + Mage::getResourceHelper('Mage_Reports') + ->updateReportRatingPos('month', 'views_num', $mainTable, $this->getTable(self::AGGREGATION_MONTHLY)); + Mage::getResourceHelper('Mage_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 00000000000..2aaafdc15a1 --- /dev/null +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php @@ -0,0 +1,367 @@ +<?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_Reports + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Report most viewed collection + */ +class Mage_Reports_Model_Resource_Report_Product_Viewed_Collection + extends Mage_Reports_Model_Resource_Report_Collection_Abstract +{ + /** + * Rating limit + * + * @var int + */ + protected $_ratingLimit = 5; + + /** + * Selected columns + * + * @var array + */ + protected $_selectedColumns = array(); + + /** + * Initialize custom resource model + * + */ + public function __construct() + { + parent::_construct(); + $this->setModel('Mage_Adminhtml_Model_Report_Item'); + $this->_resource = Mage::getResourceModel('Mage_Sales_Model_Resource_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_entity')), 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('Mage_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/Review/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php index 791ff8f8f7e..5e0bc7c8790 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 4a1a94af450..748158eb65a 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 7097f23f68f..a1cb50c04dc 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) */ 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 b07208dc890..158ea024438 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 014919f3f0f..8a4952f0358 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) */ @@ -45,12 +45,13 @@ class Mage_Reports_Model_Resource_Tag_Collection extends Mage_Tag_Model_Resource $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'); /** @@ -60,4 +61,4 @@ class Mage_Reports_Model_Resource_Tag_Collection extends Mage_Tag_Model_Resource return $this; } -} +} \ No newline at end of file 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 9c9ede3b600..863d21f60d4 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 1204d969fca..f9431bb6bc6 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/Wishlist/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php index d9bec50eb75..1756da5c003 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 ff3c9283425..8a36447fac6 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 6f948c7e04b..e82cd808437 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 a77e8495878..426b6a643f1 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 0610f6a108f..cc4e54290c7 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 a74cb2a6b98..082e0c83caa 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_ - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.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 83997ad047e..3c36e1df784 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 @@ <title>Low stock</title> <action>adminhtml/report_product/lowstock</action> </lowstock> - <downloads translate="title" module="Mage_Reports"> - <title>Downloads</title> - <action>adminhtml/report_product/downloads</action> - </downloads> </children> </products> <customers translate="title" module="Mage_Reports"> diff --git a/app/code/core/Mage/Reports/etc/config.xml b/app/code/core/Mage/Reports/etc/config.xml index 9d6468a8775..032244dba29 100644 --- a/app/code/core/Mage/Reports/etc/config.xml +++ b/app/code/core/Mage/Reports/etc/config.xml @@ -21,14 +21,14 @@ * * @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) */ --> <config> <modules> <Mage_Reports> - <version>1.6.0.0</version> + <version>1.6.0.0.1</version> </Mage_Reports> </modules> <global> @@ -176,4 +176,4 @@ </dashboard> </reports> </default> -</config> +</config> \ No newline at end of file diff --git a/app/code/core/Mage/Reports/etc/system.xml b/app/code/core/Mage/Reports/etc/system.xml index b6e100d6500..e1a5c5ce051 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 7a01663b192..994c5b1ff3b 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 3db7ec7c8c5..4c3d2f7ecc4 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-1.6.0.0.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php index d282606b223..b7b91df0777 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/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 00000000000..f21eb3bbce3 --- /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 @@ +<?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_Reports + * @copyright 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 */ +$installer = $this; +/* + * Prepare database for tables install + */ +$installer->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', 'entity_id'), + 'product_id', $installer->getTable('catalog_product_entity'), '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/Reports/view/frontend/home_product_compared.phtml b/app/code/core/Mage/Reports/view/frontend/home_product_compared.phtml index 2bd1355a09f..33f6b178e0b 100644 --- a/app/code/core/Mage/Reports/view/frontend/home_product_compared.phtml +++ b/app/code/core/Mage/Reports/view/frontend/home_product_compared.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_Reports_Block_Product_Compared */ diff --git a/app/code/core/Mage/Reports/view/frontend/home_product_viewed.phtml b/app/code/core/Mage/Reports/view/frontend/home_product_viewed.phtml index 6f478fde0a3..8f964afaca5 100644 --- a/app/code/core/Mage/Reports/view/frontend/home_product_viewed.phtml +++ b/app/code/core/Mage/Reports/view/frontend/home_product_viewed.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_Reports_Block_Product_Viewed */ diff --git a/app/code/core/Mage/Reports/view/frontend/layout.xml b/app/code/core/Mage/Reports/view/frontend/layout.xml index 8e1c785450a..e40939379c6 100644 --- a/app/code/core/Mage/Reports/view/frontend/layout.xml +++ b/app/code/core/Mage/Reports/view/frontend/layout.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/code/core/Mage/Reports/view/frontend/product_compared.phtml b/app/code/core/Mage/Reports/view/frontend/product_compared.phtml index ab75a110606..5c7cdd27843 100644 --- a/app/code/core/Mage/Reports/view/frontend/product_compared.phtml +++ b/app/code/core/Mage/Reports/view/frontend/product_compared.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_Reports_Block_Product_Compared */ diff --git a/app/code/core/Mage/Reports/view/frontend/product_viewed.phtml b/app/code/core/Mage/Reports/view/frontend/product_viewed.phtml index cd2e237b9f1..eba5f4e1a74 100644 --- a/app/code/core/Mage/Reports/view/frontend/product_viewed.phtml +++ b/app/code/core/Mage/Reports/view/frontend/product_viewed.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_Reports_Block_Product_Viewed */ diff --git a/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_default_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_default_list.phtml index 2c0eacde733..cd6d5d77b07 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_default_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_default_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/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_images_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_images_list.phtml index 72973eaf267..57b4acd3007 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_images_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_images_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/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_names_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_names_list.phtml index 0590e06fe82..4c19842a433 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_names_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_names_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/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_grid.phtml b/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_grid.phtml index efc80f1c3d5..acd525284bf 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_grid.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_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/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_list.phtml index 7e28a76e1a5..cb6ca0be249 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_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/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_default_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_default_list.phtml index 1e4e129de1f..eaa4a639f64 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_default_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_default_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/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_images_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_images_list.phtml index 65bca1a495a..4763a286389 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_images_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_images_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/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_names_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_names_list.phtml index ac17828bda3..cdf9bf7d00d 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_names_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_names_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/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_grid.phtml b/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_grid.phtml index a6af6642a0b..ae157722478 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_grid.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_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/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_list.phtml index c5abbbb7897..bb5d0327062 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_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/code/core/Mage/Reports/view/frontend/widgets.css b/app/code/core/Mage/Reports/view/frontend/widgets.css index 11e2d7a50c5..d0eaa2687aa 100644 --- a/app/code/core/Mage/Reports/view/frontend/widgets.css +++ b/app/code/core/Mage/Reports/view/frontend/widgets.css @@ -19,7 +19,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/code/core/Mage/Review/Block/Customer/List.php b/app/code/core/Mage/Review/Block/Customer/List.php index 3b90a678e3c..5d5fef48307 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('Mage_Review_Model_Review')->getProductCollection(); @@ -46,50 +53,94 @@ class Mage_Review_Block_Customer_List extends Mage_Customer_Block_Account_Dashbo ->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('Mage_Page_Block_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 @@ class Mage_Review_Block_Customer_List extends Mage_Customer_Block_Account_Dashbo ->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 5303bca99f4..44a2cff7951 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 67a5292f568..33c2e3f955f 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 77900eae3e2..f81d3f988fe 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 66ac57ef385..10434a493db 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 3ca37b63406..a0fff8bdda2 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 b0e83ba17c3..10d5eecda00 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 afff936d81e..f400142a33b 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 91449213c34..9c72fb0015b 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/Observer.php b/app/code/core/Mage/Review/Model/Observer.php index 2981eaf01f5..6ba4b22a05a 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 90ad2fa2c3f..125843351ed 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 3e3f0a0f35f..9b742039658 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 d3bfa95bab9..fb9bb732487 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 @@ class Mage_Review_Model_Resource_Review_Product_Collection extends Mage_Catalog_ 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 f52aebc0a11..407169541ed 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 816aa9e48db..567a792153e 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 1786ea67f9d..6982544b99d 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 c2389d31e91..040cedb3082 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 0727b2e1ae0..a8594e245d9 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) */ @@ -113,18 +113,16 @@ class Mage_Review_Model_Review extends Mage_Core_Model_Abstract { $errors = array(); - $helper = Mage::helper('Mage_Customer_Helper_Data'); - if (!Zend_Validate::is($this->getTitle(), 'NotEmpty')) { - $errors[] = $helper->__('Review summary can\'t be empty'); + $errors[] = Mage::helper('Mage_Review_Helper_Data')->__('Review summary can\'t be empty'); } if (!Zend_Validate::is($this->getNickname(), 'NotEmpty')) { - $errors[] = $helper->__('Nickname can\'t be empty'); + $errors[] = Mage::helper('Mage_Review_Helper_Data')->__('Nickname can\'t be empty'); } if (!Zend_Validate::is($this->getDetail(), 'NotEmpty')) { - $errors[] = $helper->__('Review can\'t be empty'); + $errors[] = Mage::helper('Mage_Review_Helper_Data')->__('Review can\'t be empty'); } if (empty($errors)) { diff --git a/app/code/core/Mage/Review/Model/Review/Status.php b/app/code/core/Mage/Review/Model/Review/Status.php index f9a3f2f9dc6..831a90d06bf 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 3962d49d92b..d97085a7f4f 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 0225f8b7695..bc46d9626b1 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 b6d80e65acb..c5243aaf45d 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 da5142e2bef..726ebd3d573 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) */ @@ -75,6 +75,9 @@ class Mage_Review_ProductController extends Mage_Core_Controller_Front_Action $productId = (int) $this->getRequest()->getParam('id'); $product = $this->_loadProduct($productId); + if (!$product) { + return false; + } if ($categoryId) { $category = Mage::getModel('Mage_Catalog_Model_Category')->load($categoryId); @@ -83,7 +86,10 @@ class Mage_Review_ProductController extends Mage_Core_Controller_Front_Action 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/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 c3c7bcad8fc..cc07852900c 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 b4ddb90864d..37899f53e70 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 12e40cfa90f..2693c92f626 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 6d39a1fd918..5db7c578392 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 8b78769afdb..e2748bc3a03 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/view/frontend/customer/list.phtml b/app/code/core/Mage/Review/view/frontend/customer/list.phtml index 7f14bbb026c..09ad5b4a022 100644 --- a/app/code/core/Mage/Review/view/frontend/customer/list.phtml +++ b/app/code/core/Mage/Review/view/frontend/customer/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/code/core/Mage/Review/view/frontend/customer/recent.phtml b/app/code/core/Mage/Review/view/frontend/customer/recent.phtml index 4a2eea63e71..af87fc6d94c 100644 --- a/app/code/core/Mage/Review/view/frontend/customer/recent.phtml +++ b/app/code/core/Mage/Review/view/frontend/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/code/core/Mage/Review/view/frontend/customer/view.phtml b/app/code/core/Mage/Review/view/frontend/customer/view.phtml index cc239510258..47dbeead407 100644 --- a/app/code/core/Mage/Review/view/frontend/customer/view.phtml +++ b/app/code/core/Mage/Review/view/frontend/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/code/core/Mage/Review/view/frontend/form.phtml b/app/code/core/Mage/Review/view/frontend/form.phtml index 71ab783c0d6..39f3bf7c1df 100644 --- a/app/code/core/Mage/Review/view/frontend/form.phtml +++ b/app/code/core/Mage/Review/view/frontend/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/code/core/Mage/Review/view/frontend/helper/summary.phtml b/app/code/core/Mage/Review/view/frontend/helper/summary.phtml index 2b92b873296..b3a081d4796 100644 --- a/app/code/core/Mage/Review/view/frontend/helper/summary.phtml +++ b/app/code/core/Mage/Review/view/frontend/helper/summary.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/code/core/Mage/Review/view/frontend/helper/summary_short.phtml b/app/code/core/Mage/Review/view/frontend/helper/summary_short.phtml index bc3f32a9a74..f422e5caeb0 100644 --- a/app/code/core/Mage/Review/view/frontend/helper/summary_short.phtml +++ b/app/code/core/Mage/Review/view/frontend/helper/summary_short.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/code/core/Mage/Review/view/frontend/layout.xml b/app/code/core/Mage/Review/view/frontend/layout.xml index 15c914c421c..d40063a0436 100644 --- a/app/code/core/Mage/Review/view/frontend/layout.xml +++ b/app/code/core/Mage/Review/view/frontend/layout.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/code/core/Mage/Review/view/frontend/product/view/count.phtml b/app/code/core/Mage/Review/view/frontend/product/view/count.phtml index be80b8caa11..6213dc383d5 100644 --- a/app/code/core/Mage/Review/view/frontend/product/view/count.phtml +++ b/app/code/core/Mage/Review/view/frontend/product/view/count.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/code/core/Mage/Review/view/frontend/product/view/list.phtml b/app/code/core/Mage/Review/view/frontend/product/view/list.phtml index 5ad605c3af0..b8b92b4d5fa 100644 --- a/app/code/core/Mage/Review/view/frontend/product/view/list.phtml +++ b/app/code/core/Mage/Review/view/frontend/product/view/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/code/core/Mage/Review/view/frontend/product/view/other.phtml b/app/code/core/Mage/Review/view/frontend/product/view/other.phtml index 734278eab0e..95c89cdf592 100644 --- a/app/code/core/Mage/Review/view/frontend/product/view/other.phtml +++ b/app/code/core/Mage/Review/view/frontend/product/view/other.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/code/core/Mage/Review/view/frontend/view.phtml b/app/code/core/Mage/Review/view/frontend/view.phtml index f5a8a095f2d..53ef2977096 100644 --- a/app/code/core/Mage/Review/view/frontend/view.phtml +++ b/app/code/core/Mage/Review/view/frontend/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/code/core/Mage/Rss/Block/Abstract.php b/app/code/core/Mage/Rss/Block/Abstract.php index bd7af50d2e1..58db571a661 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 9592da839d2..bf55a29ff07 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 013e3880d52..5e5de1091ad 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 e3e2d87fe15..d7aee895318 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) */ @@ -65,20 +65,31 @@ getFinalPrice() - used in shopping cart calculations */ $product = Mage::getModel('Mage_Catalog_Model_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') @@ -151,4 +162,4 @@ getFinalPrice() - used in shopping cart calculations ); $rssObj->_addEntry($data); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php b/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php index 961981a33b2..4c0a7217013 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) */ @@ -64,9 +64,7 @@ class Mage_Rss_Block_Catalog_NotifyStock extends Mage_Rss_Block_Abstract protected function _toHtml() { $newUrl = Mage::getUrl('rss/catalog/notifystock'); - /* @var $helper Mage_Rss_Helper_Data */ - $helper = Mage::helper('Mage_Rss_Helper_Data'); - $title = $helper->__('Low Stock Products'); + $title = Mage::helper('Mage_Rss_Helper_Data')->__('Low Stock Products'); $rssObj = Mage::getModel('Mage_Rss_Model_Rss'); $data = array( @@ -81,7 +79,7 @@ class Mage_Rss_Block_Catalog_NotifyStock extends Mage_Rss_Block_Abstract 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('Mage_Rss_Helper_Data')->disableFlat(); /* @var $product Mage_Catalog_Model_Product */ $product = Mage::getModel('Mage_Catalog_Model_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 79f8a2e3b4a..80ff79fcbd9 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) */ @@ -64,10 +64,8 @@ class Mage_Rss_Block_Catalog_Review extends Mage_Rss_Block_Abstract protected function _toHtml() { $newUrl = Mage::getUrl('rss/catalog/review'); - /* @var $helper Mage_Rss_Helper_Data */ - $helper = Mage::helper('Mage_Rss_Helper_Data'); - $title = $helper->__('Pending product review(s)'); - $helper->disableFlat(); + $title = Mage::helper('Mage_Rss_Helper_Data')->__('Pending product review(s)'); + Mage::helper('Mage_Rss_Helper_Data')->disableFlat(); $rssObj = Mage::getModel('Mage_Rss_Model_Rss'); $data = array( diff --git a/app/code/core/Mage/Rss/Block/Catalog/Salesrule.php b/app/code/core/Mage/Rss/Block/Catalog/Salesrule.php index 60c96b402a4..826ffe7daa2 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 @@ class Mage_Rss_Block_Catalog_Salesrule extends Mage_Rss_Block_Abstract $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('Mage_Rss_Helper_Data')->__('%s - Discounts and Coupons',Mage::app()->getStore($storeId)->getName()); - $lang = Mage::getStoreConfig('general/locale/code'); - - $rssObj = Mage::getModel('Mage_Rss_Model_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('Mage_Rss_Helper_Data')->__('%s - Discounts and Coupons',Mage::app()->getStore($storeId)->getName()); - $now = date('Y-m-d'); - $_saleRule = Mage::getModel('Mage_SalesRule_Model_Rule'); + /** @var $rssObject Mage_Rss_Model_Rss */ + $rssObject = Mage::getModel('Mage_Rss_Model_Rss'); + /** @var $collection Mage_SalesRule_Model_Resource_Rule_Collection */ + $collection = Mage::getModel('Mage_SalesRule_Model_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 = '<table><tr>'. '<td style="text-decoration:none;">'.$sr->getDescription(). @@ -89,12 +86,13 @@ class Mage_Rss_Block_Catalog_Salesrule extends Mage_Rss_Block_Abstract '</td>'. '</tr></table>'; $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 c76eb044d70..c6f4e68c92b 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 4cdb59ea634..3eb8e8b134c 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 4a59062602c..96991844beb 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 9f4d77d3f89..a4cdbe8fef5 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 69c43a5ab87..eda9fe8567b 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 3aa629b25ce..f354554dbdf 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 78a7412eaeb..4c0a8936962 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) */ diff --git a/app/code/core/Mage/Rss/Helper/Catalog.php b/app/code/core/Mage/Rss/Helper/Catalog.php index a0241346cde..cd22bf7f00d 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 180fdaafb6c..8f517dd8200 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 34fa58ee133..3561b3bbfd3 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/Observer.php b/app/code/core/Mage/Rss/Model/Observer.php index 60c5493b70c..ed78507fbc3 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 0af44bddff6..23c9df1918f 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 0015116bb2f..e886c5515d7 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 ee64e5af7bf..d3a90f80f44 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 83166bbdff8..3c4ea2c09a3 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 a8e6cf29d22..59cc01ea9af 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 de10f101985..bb89b7d8cba 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) */ diff --git a/app/code/core/Mage/Rss/controllers/OrderController.php b/app/code/core/Mage/Rss/controllers/OrderController.php index 1ee08828618..ad6b3d94204 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 14eef386b76..9dbafb9e366 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) */ --> diff --git a/app/code/core/Mage/Rss/etc/config.xml b/app/code/core/Mage/Rss/etc/config.xml index 95d04e58b81..ad97992cd72 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) */ --> @@ -54,22 +54,22 @@ </adminhtml> <frontend> <events> - <sales_order_item_save_after> + <sales_order_save_after> <observers> <notifystock> <class>Mage_Rss_Model_Observer</class> <method>salesOrderItemSaveAfterNotifyStock</method> </notifystock> </observers> - </sales_order_item_save_after> - <sales_order_item_save_after> + </sales_order_save_after> + <sales_order_save_after> <observers> <ordernew> <class>Mage_Rss_Model_Observer</class> <method>salesOrderItemSaveAfterOrderNew</method> </ordernew> </observers> - </sales_order_item_save_after> + </sales_order_save_after> </events> <translate> <modules> diff --git a/app/code/core/Mage/Rss/etc/system.xml b/app/code/core/Mage/Rss/etc/system.xml index 0cd4ccdfa95..e3648571c69 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/Rss/view/adminhtml/layout.xml b/app/code/core/Mage/Rss/view/adminhtml/layout.xml index 05536a7d706..c4c7f21619c 100644 --- a/app/code/core/Mage/Rss/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Rss/view/adminhtml/layout.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/code/core/Mage/Rss/view/frontend/layout.xml b/app/code/core/Mage/Rss/view/frontend/layout.xml index b610155a615..4ea01610c94 100644 --- a/app/code/core/Mage/Rss/view/frontend/layout.xml +++ b/app/code/core/Mage/Rss/view/frontend/layout.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/code/core/Mage/Rss/view/frontend/list.phtml b/app/code/core/Mage/Rss/view/frontend/list.phtml index fd5fcbb54a5..6ff2c1f437e 100644 --- a/app/code/core/Mage/Rss/view/frontend/list.phtml +++ b/app/code/core/Mage/Rss/view/frontend/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/code/core/Mage/Rss/view/frontend/nofeed.phtml b/app/code/core/Mage/Rss/view/frontend/nofeed.phtml index a34bd3ebb0c..72d0fa26742 100644 --- a/app/code/core/Mage/Rss/view/frontend/nofeed.phtml +++ b/app/code/core/Mage/Rss/view/frontend/nofeed.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/code/core/Mage/Rss/view/frontend/order/details.phtml b/app/code/core/Mage/Rss/view/frontend/order/details.phtml index 8c0b9920c6c..45cecd63d48 100644 --- a/app/code/core/Mage/Rss/view/frontend/order/details.phtml +++ b/app/code/core/Mage/Rss/view/frontend/order/details.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/code/core/Mage/Rule/Block/Actions.php b/app/code/core/Mage/Rule/Block/Actions.php index ea0a56ad629..0078e62c0c0 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 678e1ef62d6..548c34fd6ef 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 6dbbca10a23..fad69543aed 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 cf77582f789..0dce976a564 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 4b8abbe9871..7ed3f924712 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 3f1ff71ddd5..603b1812019 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 00000000000..6dbc467331d --- /dev/null +++ b/app/code/core/Mage/Rule/Model/Abstract.php @@ -0,0 +1,502 @@ +<?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_Rule + * @copyright 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 Rule entity data model + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team <core@magentocommerce.com> + */ +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 rule conditions and actions + * + * @return Mage_Rule_Model_Abstract + */ + protected function _afterLoad() + { + parent::_afterLoad(); + + // 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->getConditions()->loadArray($conditions); + } + } + } + + // 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->getActions()->loadArray($actions); + } + } + } + + return $this; + } + + /** + * 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('Mage_Rule_Helper_Data')->__('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(); + } + 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(); + } + 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('Mage_Rule_Helper_Data')->__('End Date must be greater than Start Date.'); + } + } + + if ($object->hasWebsiteIds()) { + $websiteIds = $object->getWebsiteIds(); + if (empty($websiteIds)) { + $result[] = Mage::helper('Mage_Rule_Helper_Data')->__('Websites must be specified.'); + } + } + if ($object->hasCustomerGroupIds()) { + $customerGroupIds = $object->getCustomerGroupIds(); + if (empty($customerGroupIds)) { + $result[] = Mage::helper('Mage_Rule_Helper_Data')->__('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 9893024bcc8..cf33aef4fb7 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 @@ abstract class Mage_Rule_Model_Action_Abstract extends Varien_Object implements public function asXml() { - extract($this->toArray()); $xml = "<type>".$this->getType()."</type>" ."<attribute>".$this->getAttribute()."</attribute>" ."<operator>".$this->getOperator()."</operator>" @@ -219,7 +218,8 @@ abstract class Mage_Rule_Model_Action_Abstract extends Varien_Object implements public function getRemoveLinkHtml() { $src = Mage::getDesign()->getSkinUrl('images/rule_component_remove.gif'); - $html = '<span class="rule-param"><a href="javascript:void(0)" class="rule-param-remove"><img src="'.$src.'" alt="" class="v-middle" /></a></span>'; + $html = '<span class="rule-param"><a href="javascript:void(0)" class="rule-param-remove"><img src="' + . $src . '" alt="" class="v-middle" /></a></span>'; 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 782f19fb665..f654277de50 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 6710f98f0ba..d65a3c8d33e 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 df3d1b41bbf..e231bc1a62f 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 <core@magentocommerce.com> */ abstract class Mage_Rule_Model_Condition_Abstract extends Varien_Object @@ -333,6 +336,11 @@ abstract class Mage_Rule_Model_Condition_Abstract 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 c9acb1d10ec..eeaa9280e8a 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) */ @@ -235,11 +235,8 @@ class Mage_Rule_Model_Condition_Combine extends Mage_Rule_Model_Condition_Abstra public function asHtml() { $html = $this->getTypeElement()->getHtml(). - Mage::helper('Mage_Rule_Helper_Data')->__("If %s of these conditions are %s:", - $this->getAggregatorElement()->getHtml(), - $this->getValueElement()->getHtml() - ); - if ($this->getId()!='1') { + Mage::helper('Mage_Rule_Helper_Data')->__('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/Rule/Model/Condition/Interface.php b/app/code/core/Mage/Rule/Model/Condition/Interface.php index d73bd79c1aa..c3c449616d2 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 00000000000..43a460c06eb --- /dev/null +++ b/app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php @@ -0,0 +1,513 @@ +<?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_Rule + * @copyright 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 Rule product condition data model + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Eav_Model_Config') + ->getAttribute(Mage_Catalog_Model_Product::ENTITY, $this->getAttribute()); + } + catch (Exception $e) { + $obj = new Varien_Object(); + $obj->setEntity(Mage::getResourceSingleton('Mage_Catalog_Model_Product')) + ->setFrontendInput('text'); + } + return $obj; + } + + /** + * Add special attributes + * + * @param array $attributes + */ + protected function _addSpecialAttributes(array &$attributes) + { + $attributes['attribute_set_id'] = Mage::helper('Mage_CatalogRule_Helper_Data')->__('Attribute Set'); + $attributes['category_ids'] = Mage::helper('Mage_CatalogRule_Helper_Data')->__('Category'); + } + + /** + * Load attribute options + * + * @return Mage_CatalogRule_Model_Rule_Condition_Product + */ + public function loadAttributeOptions() + { + $productAttributes = Mage::getResourceSingleton('Mage_Catalog_Model_Resource_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('Mage_Eav_Model_Config') + ->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getId(); + $selectOptions = Mage::getResourceModel('Mage_Eav_Model_Resource_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 = '<a href="javascript:void(0)" class="rule-chooser-trigger"><img src="' . $image . '" alt="" class="v-middle rule-chooser-trigger" title="' . Mage::helper('Mage_Rule_Helper_Data')->__('Open Chooser') . '" /></a>'; + } + 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('Mage_Adminhtml_Helper_Data')->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/Rule/Model/Renderer/Actions.php b/app/code/core/Mage/Rule/Model/Renderer/Actions.php index 33d429a9177..b2a4f0e1873 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 6eea670f1fc..396a1749fb5 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 00000000000..d422f2acefc --- /dev/null +++ b/app/code/core/Mage/Rule/Model/Resource/Abstract.php @@ -0,0 +1,250 @@ +<?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_Rule + * @copyright 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 Rule entity resource model + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Rule_Helper_Data')->__( + 'There is no information about associated entity type "%s".', $entityType + ) + ); + throw $e; + } +} 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 00000000000..3f75cf4f3d7 --- /dev/null +++ b/app/code/core/Mage/Rule/Model/Resource/Rule/Collection/Abstract.php @@ -0,0 +1,236 @@ +<?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_Rule + * @copyright 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 Rule entity resource collection model + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team <core@magentocommerce.com> + */ +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); + $this->getSelect()->joinInner( + array('website' => $this->getTable($entityInfo['associations_table'])), + 'main_table.' . $entityInfo['rule_id_field'] . ' = website.' . $entityInfo['rule_id_field'], + array() + ); + } + + if ($websiteId instanceof Mage_Core_Model_Website) { + $websiteId = $websiteId->getId(); + } + $this->getSelect()->where('website.' . $entityInfo['entity_id_field'] . ' IN (?)', $websiteId); + + 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('Mage_Rule_Helper_Data')->__( + '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 80b57bbccbc..4f5808efbd9 100644 --- a/app/code/core/Mage/Rule/Model/Rule.php +++ b/app/code/core/Mage/Rule/Model/Rule.php @@ -20,351 +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) */ /** - * Abstract promotion rule model + * Abstract Rule entity data model * - * The class is supposed to have name "Mage_Rule_Model_RuleAbstract", - * but the old name has been retained for backwards compatibility purposes. - * Also the architecture of abstract model doesn't allow to make the _construct() method abstract + * @deprecated since 1.7.0.0 use Mage_Rule_Model_Abstract instead + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team <core@magentocommerce.com> */ -abstract class Mage_Rule_Model_Rule extends Mage_Core_Model_Abstract +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 + * Getter for rule combine conditions instance * - * @var boolean + * @return Mage_Rule_Model_Condition_Combine */ - protected $_isReadonly = false; - public function getConditionsInstance() { return Mage::getModel('Mage_Rule_Model_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('Mage_Rule_Model_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('Mage_Rule_Helper_Data')->__("Name: %s", $this->getName()) ."\n" - . Mage::helper('Mage_Rule_Helper_Data')->__("Start at: %s", $this->getStartAt()) ."\n" - . Mage::helper('Mage_Rule_Helper_Data')->__("Expire at: %s", $this->getExpireAt()) ."\n" - . Mage::helper('Mage_Rule_Helper_Data')->__("Description: %s", $this->getDescription()) ."\n\n" - . $this->getConditions()->asStringRecursive() ."\n\n" - . $this->getActions()->asStringRecursive() ."\n\n"; - return $str; - } - - public function asHtml() - { - $str = Mage::helper('Mage_Rule_Helper_Data')->__("Name: %s", $this->getName()) ."<br/>" - . Mage::helper('Mage_Rule_Helper_Data')->__("Start at: %s", $this->getStartAt()) ."<br/>" - . Mage::helper('Mage_Rule_Helper_Data')->__("Expire at: %s", $this->getExpireAt()) ."<br/>" - . Mage::helper('Mage_Rule_Helper_Data')->__("Description: %s", $this->getDescription()) .'<br/>' - . '<ul class="rule-conditions">'.$this->getConditions()->asHtmlRecursive().'</ul>' - . '<ul class="rule-actions">'.$this->getActions()->asHtmlRecursive()."</ul>"; - 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('Mage_Rule_Helper_Data')->__('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('Mage_Rule_Helper_Data')->__("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 d8ed0580856..608a24871cb 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 56a9c0b9381..6d5f7d3c1ec 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 3f73a882536..8d9d81c2c33 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 77a381aee6c..6c19f1d9c5d 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 d19d5a78ea1..ae2d58fb7ad 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 184ee9551dc..2b66be0c6ce 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 2e49be3df52..1c0e4747d2e 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 e85b2d86701..4abbd3a9076 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 2ae6cd00258..7722572bb2f 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 149018883d2..a93f6598017 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 afe91b590ad..6a23fc39317 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 87993f5cd24..fdb0615e52e 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 bed29390cbd..d479afa3d6b 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 8c9a7e44d98..f34e1f49614 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 15f83688b7c..7b958b32cd6 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 30488a7b1f0..fb5c4f3e6d1 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 57e84933c43..84043ea9488 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 408ff2a7ddb..1996a069e0d 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 90b71a9d330..826cb87eb77 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 93412e03ec8..5149606ba5f 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 new file mode 100644 index 00000000000..11e5d826cd3 --- /dev/null +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php @@ -0,0 +1,89 @@ +<?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_Sales + * @copyright 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 Adminhtml report filter form for coupons report + * + * @category Mage + * @package Mage_Sales + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Reports_Helper_Data')->__('Any'), + Mage::helper('Mage_Reports_Helper_Data')->__('Specified') + ), + 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Shopping Cart Price Rule'), + )); + + $rulesList = Mage::getResourceModel('Mage_SalesRule_Model_Resource_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('Mage_Adminhtml_Block_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/Block/Adminhtml/Report/Filter/Form/Order.php b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Order.php index f464a1e002a..45a4c1b0bd2 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 99a74141957..2f1058b621b 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 5bddb5e5bbe..5b2482d0786 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 b07835787fa..552d9d79208 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 390f0d4f129..334e16dc906 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 923de53fe18..ee4f16906b7 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 c4e4f35831e..51401effa70 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 f7957e641fc..f7d59ff4e82 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 63786743d26..eec15716ae1 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/Email/Creditmemo/Items.php b/app/code/core/Mage/Sales/Block/Order/Email/Creditmemo/Items.php index b73c865c6a3..f1c41426659 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 06dce456914..44af5855474 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 9b7e8f0b006..a2660a7ad09 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 ad66d65104e..36bc964f5f6 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 195e260271f..a3cf2af4cea 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 f428016dc68..1c6dcf7563e 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 9250f29f6bc..9b681a77635 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 4860ef9cadc..e117af685db 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 4d1d02d62d2..039432c166e 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 b83a8b72a0d..4b2db55f071 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 3f646c619d8..edf4c6083a2 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 1236919d3a5..e1b6e9c0bd6 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 9ce722c101c..dc1d42276d3 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 a9a54a19b51..f0c9436ecb5 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 479141996ce..519bfed9847 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 688e756e33d..9d08b56732c 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 15c1a45e47e..4a0c24bb290 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 33ab6efe290..015208c16ee 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 dc7548b5812..ef5c636e6b8 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 bb6d557593f..6922802c6be 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 e58c68aa033..2b6b5b3a3fe 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 f4678dec4e1..e8de43684fe 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 a7c2c15770e..62e82a733fb 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/Totals.php b/app/code/core/Mage/Sales/Block/Order/Totals.php index 9517876a956..26c9e6d28c5 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 d7c41096f34..7e0eb5c7c5c 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 7768b6f23c9..aba53e8a16f 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 7c352ccfbfa..b64bc9e0b11 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 9dfd1e9e6bf..86132518e81 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 a6f41be9c72..b394fb6fc50 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 028adf7afbc..92181614edd 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 <core@magentocommerce.com> @@ -40,7 +42,7 @@ class Mage_Sales_Block_Reorder_Sidebar extends Mage_Core_Block_Template { parent::__construct(); - if (Mage::getSingleton('Mage_Customer_Model_Session')->isLoggedIn()) { + if ($this->_getCustomerSession()->isLoggedIn()) { $this->setTemplate('order/history.phtml'); $this->initOrders(); } @@ -53,7 +55,7 @@ class Mage_Sales_Block_Reorder_Sidebar extends Mage_Core_Block_Template public function initOrders() { $customerId = $this->getCustomerId() ? $this->getCustomerId() - : Mage::getSingleton('Mage_Customer_Model_Session')->getCustomer()->getId(); + : $this->_getCustomerSession()->getCustomer()->getId(); $orders = Mage::getResourceModel('Mage_Sales_Model_Resource_Order_Collection') ->addAttributeToFilter('customer_id', $customerId) @@ -118,7 +120,7 @@ class Mage_Sales_Block_Reorder_Sidebar extends Mage_Core_Block_Template /** * Last order getter * - * @return Mage_Sales_Model_Order | false + * @return Mage_Sales_Model_Order|false */ public function getLastOrder() { @@ -128,13 +130,23 @@ class Mage_Sales_Block_Reorder_Sidebar extends Mage_Core_Block_Template return false; } + /** + * Render "My Orders" sidebar block + * + * @return string + */ protected function _toHtml() { - if (Mage::helper('Mage_Sales_Helper_Reorder')->isAllow() - && (Mage::getSingleton('Mage_Customer_Model_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('Mage_Customer_Model_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 449d13037b6..cd28e303b24 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 1a2c8049525..4cae6fa5b2f 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_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/Sales/Exception.php b/app/code/core/Mage/Sales/Exception.php index f59927a937c..2877ce5434f 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 b0d3bdd2258..db92c4a45a4 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 560160e4ac6..24818236495 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 80a767cfd41..82e19ec2f2b 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 c98cda0f12f..c56d934e133 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 d04b5b9cfa0..0711cd893c4 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 022ef6d1b50..fe7d14eb81a 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 dfe3a211b4d..5e1cbbbe697 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/Convert/Order.php b/app/code/core/Mage/Sales/Model/Convert/Order.php index d0883f03bc3..5991fb74dad 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 e236ebfeef6..22b8e2b7998 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 b870d360599..ae86621edeb 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/Observer.php b/app/code/core/Mage/Sales/Model/Observer.php index cc3b8291b26..4488b5a2861 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) */ @@ -334,5 +334,187 @@ class Mage_Sales_Model_Observer $quote->setCanApplyMsrp($canApplyMsrp); } -} + /** + * 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('Mage_Customer_Helper_Data')->__('VAT Request Identifier') + . ': ' . $vatRequestId . '<br />' . Mage::helper('Mage_Customer_Helper_Data')->__('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('Mage_Customer_Helper_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('Mage_Customer_Helper_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 changeQuoteCustomerGroupId(Varien_Event_Observer $observer) + { + /** @var $addressHelper Mage_Customer_Helper_Address */ + $addressHelper = Mage::helper('Mage_Customer_Helper_Address'); + + $quoteAddress = $observer->getQuoteAddress(); + $quoteInstance = $quoteAddress->getQuote(); + $customerInstance = $quoteInstance->getCustomer(); + + $storeId = $customerInstance->getStore(); + + $configAddressType = Mage::helper('Mage_Customer_Helper_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 $customerHelper Mage_Customer_Helper_Data */ + $customerHelper = Mage::helper('Mage_Customer_Helper_Data'); + + $customerAddressId = $quoteAddress->getCustomerAddressId(); + $customerDefaultAddressId = $this->_getVatRequiredCustomerAddress($customerInstance, $storeId); + + $customerCountryCode = $quoteAddress->getCountryId(); + $customerVatNumber = $quoteAddress->getVatId(); + + if (empty($customerVatNumber) || !Mage::helper('Mage_Core_Helper_Data')->isCountryInEU($customerCountryCode)) { + $groupId = ($customerInstance->getId()) ? $customerHelper->getDefaultCustomerGroupId($storeId) + : Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; + + $quoteAddress->setPrevQuoteCustomerGroupId($quoteInstance->getCustomerGroupId()); + $customerInstance->setGroupId($groupId); + $quoteInstance->setCustomerGroupId($groupId); + + return; + } + + /** @var $coreHelper Mage_Core_Helper_Data */ + $coreHelper = Mage::helper('Mage_Core_Helper_Data'); + $merchantCountryCode = $coreHelper->getMerchantCountryCode(); + $merchantVatNumber = $coreHelper->getMerchantVatNumber(); + + $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() + )); + } + + if ($customerAddressId != $customerDefaultAddressId || is_null($customerDefaultAddressId)) { + $groupId = $customerHelper->getCustomerGroupIdBasedOnVatNumber( + $customerCountryCode, $gatewayResponse, $customerInstance->getStore() + ); + + if ($groupId) { + $quoteAddress->setPrevQuoteCustomerGroupId($quoteInstance->getCustomerGroupId()); + $customerInstance->setGroupId($groupId); + $quoteInstance->setCustomerGroupId($groupId); + } + } + } + + /** + * Restore initial customer group ID in quote if needed on collect_totals_after event of quote address + * + * @param Varien_Event_Observer $observer + */ + public function restoreQuoteCustomerGroupId($observer) + { + $quoteAddress = $observer->getQuoteAddress(); + $configAddressType = Mage::helper('Mage_Customer_Helper_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 f3829557e37..146e20357fc 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) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Address.php b/app/code/core/Mage/Sales/Model/Order/Address.php index ea1ec4719cb..56d5a29b1df 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 8811993797b..634be825ad6 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 e466d8f4055..ae653b6250e 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 c1f4da98af1..271a7fa2e72 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) */ @@ -142,7 +142,11 @@ class Mage_Sales_Model_Order_Config extends Mage_Core_Model_Config_Base */ 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 7e49795c2f5..5f3eba4b2c3 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) */ @@ -158,6 +158,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'; @@ -312,6 +319,25 @@ class Mage_Sales_Model_Order_Creditmemo extends Mage_Sales_Model_Abstract 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('Mage_Core_Model_Calculator', $this->getStore()); + } + $price = $this->_calculators[$type]->deltaRound($price, $negative); + } + return $price; + } + public function canRefund() { if ($this->getState() != self::STATE_CANCELED @@ -377,9 +403,7 @@ class Mage_Sales_Model_Order_Creditmemo extends Mage_Sales_Model_Abstract $baseAvailableRefund = $this->getOrder()->getBaseTotalPaid()- $this->getOrder()->getBaseTotalRefunded(); Mage::throwException( - Mage::helper('Mage_Sales_Helper_Data')->__('Maximum amount available to refund is %s', - $this->getOrder()->formatBasePrice($baseAvailableRefund) - ) + Mage::helper('Mage_Sales_Helper_Data')->__('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/Api.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php index 16a907171ef..93a1e39c819 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 98db2fbd531..8e27f807956 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 1741b2357a3..ead95635abf 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 59a036f7b61..6b374a8d853 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) */ 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 1ad9a061c61..f061b885832 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) */ @@ -202,17 +202,18 @@ class Mage_Sales_Model_Order_Creditmemo_Item extends Mage_Core_Model_Abstract */ 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; } @@ -239,24 +240,31 @@ class Mage_Sales_Model_Order_Creditmemo_Item extends Mage_Core_Model_Abstract */ 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/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Abstract.php index 729331da1fa..dcdc0b41e61 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,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @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/Cost.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Cost.php index a837336140e..68bd101becf 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 ea2209cf816..476e8d704e6 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) */ @@ -49,20 +49,30 @@ class Mage_Sales_Model_Order_Creditmemo_Total_Discount extends Mage_Sales_Model_ $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/Grand.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Grand.php index 539c97a7120..6a3077a7836 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 7e791e08e45..f033d87de22 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 d1c80ca8784..542a38f6b95 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) */ @@ -41,12 +41,12 @@ class Mage_Sales_Model_Order_Creditmemo_Total_Subtotal extends Mage_Sales_Model_ $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 99108866844..be08fdd1b11 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) */ @@ -38,49 +38,38 @@ class Mage_Sales_Model_Order_Creditmemo_Total_Tax extends Mage_Sales_Model_Order $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 @@ class Mage_Sales_Model_Order_Creditmemo_Total_Tax extends Mage_Sales_Model_Order $baseTotalHiddenTax += $invoice->getBaseShippingHiddenTaxAmnt()*$taxFactor; $shippingHiddenTaxAmount = $invoice->getShippingHiddenTaxAmount()*$taxFactor; $baseShippingHiddenTaxAmount = $invoice->getBaseShippingHiddenTaxAmnt()*$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 @@ class Mage_Sales_Model_Order_Creditmemo_Total_Tax extends Mage_Sales_Model_Order $baseShippingTaxAmount = $order->getBaseShippingTaxAmount()*$basePart; $shippingHiddenTaxAmount = $order->getShippingHiddenTaxAmount()*$part; $baseShippingHiddenTaxAmount= $order->getBaseShippingHiddenTaxAmnt()*$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(); @@ -174,4 +163,4 @@ class Mage_Sales_Model_Order_Creditmemo_Total_Tax extends Mage_Sales_Model_Order $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseTotalTax + $baseTotalHiddenTax); return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice.php b/app/code/core/Mage/Sales/Model/Order/Invoice.php index d7525c0a2e5..38056cd9b1b 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) */ @@ -158,6 +158,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'; @@ -482,6 +489,25 @@ class Mage_Sales_Model_Order_Invoice extends Mage_Sales_Model_Abstract 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('Mage_Core_Model_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/Api.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php index fab21301374..2e2360ca73d 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 2a9beee6d7c..dbf5b6f628e 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 1bba00f10a1..15d79d18233 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 1050ff63fda..98ec1dba7f8 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) */ 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 7aa1aed98fd..756e59b7c16 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) */ @@ -253,24 +253,27 @@ class Mage_Sales_Model_Order_Invoice_Item extends Mage_Core_Model_Abstract */ 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/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Abstract.php index dfca69d0472..b06ae622f27 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,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @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/Cost.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Cost.php index 230b1d8c40c..7ad780b3de3 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 4d6f531b3cb..5b0068531df 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) */ @@ -52,6 +52,7 @@ class Mage_Sales_Model_Order_Invoice_Total_Discount extends Mage_Sales_Model_Ord $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 @@ class Mage_Sales_Model_Order_Invoice_Total_Discount extends Mage_Sales_Model_Ord /** * 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/Grand.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Grand.php index c8e754d82f9..33b5b207d3f 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 371e58fac5a..8ccba86065c 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 0ed5d0affa5..168ee529672 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) */ @@ -43,12 +43,12 @@ class Mage_Sales_Model_Order_Invoice_Total_Subtotal extends Mage_Sales_Model_Ord $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 @@ class Mage_Sales_Model_Order_Invoice_Total_Subtotal extends Mage_Sales_Model_Ord } $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 ca1a695d35d..f9ddf5ba482 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) */ @@ -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 @@ class Mage_Sales_Model_Order_Invoice_Total_Tax extends Mage_Sales_Model_Order_In $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 @@ class Mage_Sales_Model_Order_Invoice_Total_Tax extends Mage_Sales_Model_Order_In /** * 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 @@ class Mage_Sales_Model_Order_Invoice_Total_Tax extends Mage_Sales_Model_Order_In /** * 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 1fc0206978f..317328a224f 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) */ @@ -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 diff --git a/app/code/core/Mage/Sales/Model/Order/Payment.php b/app/code/core/Mage/Sales/Model/Order/Payment.php index 08389031e61..05ee291116f 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) */ @@ -1010,11 +1010,6 @@ class Mage_Sales_Model_Order_Payment extends Mage_Payment_Model_Info if ($isOnline) { // invoke authorization on gateway $this->getMethodInstance()->setStore($order->getStoreId())->authorize($this, $amount); - } else { - $message = Mage::helper('Mage_Sales_Helper_Data')->__( - 'Registered notification about authorized amount of %s.', - $this->_formatPrice($amount) - ); } // similar logic of "payment review" order as in capturing @@ -1551,4 +1546,4 @@ class Mage_Sales_Model_Order_Payment extends Mage_Payment_Model_Info } return false; } -} +} \ No newline at end of file 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 a44ffd2006d..b3aaf5c4dfa 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 13757a292e8..5fe6c0d968b 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) */ @@ -728,6 +728,10 @@ abstract class Mage_Sales_Model_Order_Pdf_Abstract extends Varien_Object $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/Creditmemo.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php index e1833692e04..b6acea77def 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 03ad15eb8d3..db1600c6247 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 9347c92ca90..adceb806e83 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) */ @@ -226,6 +226,48 @@ abstract class Mage_Sales_Model_Order_Pdf_Items_Abstract extends Mage_Core_Model } } + /** + * 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('Mage_Tax_Helper_Data')->displaySalesBothPrices()) { + $prices = array( + array( + 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Excl. Tax') . ':', + 'price' => $order->formatPriceTxt($item->getPrice()), + 'subtotal' => $order->formatPriceTxt($item->getRowTotal()) + ), + array( + 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Incl. Tax') . ':', + 'price' => $order->formatPriceTxt($item->getPriceInclTax()), + 'subtotal' => $order->formatPriceTxt($item->getRowTotalInclTax()) + ), + ); + } elseif (Mage::helper('Mage_Tax_Helper_Data')->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 15217ef432f..8f22c37fddb 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) */ @@ -62,13 +62,29 @@ class Mage_Sales_Model_Order_Pdf_Items_Creditmemo_Default extends Mage_Sales_Mod $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 @@ -102,8 +118,10 @@ class Mage_Sales_Model_Order_Pdf_Items_Creditmemo_Default extends Mage_Sales_Mod $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 82e3baaf293..2133347a7e8 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 12f32fcbab8..9a836eb47ca 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) */ @@ -65,13 +65,41 @@ class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_ '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( @@ -81,14 +109,6 @@ class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_ '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) { @@ -101,7 +121,11 @@ class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_ ); 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 c77cd27ceb8..71d764fe76a 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 ce9c9e8d49c..fadd9ecaa33 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 a252060498d..e9c3b2f1ba6 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 0713a9e2b26..9ab66985130 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 9bb28073d17..d96c93747e1 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 54e6530db1a..e60b0b111a5 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 67b38ce9444..b796bd67514 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 7399ab791b8..6db22ff465a 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 628c1cefd07..2a66f200520 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 b7f971e89d6..90ffbfe6336 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 c515a62da09..0e192427e41 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 655dbb3f000..066b27dc5c8 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 a1e93ff7582..8ba9400ac38 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 ba4a6039ae9..a2b63b9268b 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 a82ac34539c..59d79d47740 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/Payment/Method/Billing/AgreementAbstract.php b/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php index dcd08e26d28..d54959b06c0 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 51abdcffbe2..1a4f8035753 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) */ @@ -69,8 +69,8 @@ * @method float getBaseGrandTotal() * @method Mage_Sales_Model_Quote setBaseGrandTotal(float $value) * @method Mage_Sales_Model_Quote setCheckoutMethod(string $value) - * @method int getCustomerId() - * @method Mage_Sales_Model_Quote setCustomerId(int $value) + * @method int|null getCustomerId() + * @method Mage_Sales_Model_Quote setCustomerId(int|null $value) * @method Mage_Sales_Model_Quote setCustomerTaxClassId(int $value) * @method Mage_Sales_Model_Quote setCustomerGroupId(int $value) * @method string getCustomerEmail() @@ -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 @@ -176,6 +178,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 */ @@ -448,9 +457,10 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract */ 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; } @@ -460,7 +470,7 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract { /* * 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('Mage_Customer_Model_Group')->getTaxClassId($this->getCustomerGroupId()); @@ -671,6 +681,9 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract */ public function getItemsCollection($useCache = true) { + if ($this->hasItemsCollection()) { + return $this->getData('items_collection'); + } if (is_null($this->_items)) { $this->_items = Mage::getModel('Mage_Sales_Model_Quote_Item')->getCollection(); $this->_items->setQuote($this); @@ -798,6 +811,19 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract 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 * @@ -1191,12 +1217,7 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract 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); @@ -1261,10 +1282,7 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract $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; @@ -1332,6 +1350,11 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract return $this; } + /** + * Retrieve current quote messages + * + * @return array + */ public function getMessages() { $messages = $this->getData('messages'); @@ -1342,6 +1365,23 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract 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. * @@ -1789,4 +1829,28 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract } return $this->_getData('checkout_method'); } + + /** + * 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 1a406efd8bd..95122606b28 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'; /** @@ -863,6 +872,8 @@ class Mage_Sales_Model_Quote_Address extends Mage_Customer_Model_Address_Abstrac $request->setPackageCurrency($this->getQuote()->getStore()->getCurrentCurrency()); $request->setLimitCarrier($this->getLimitCarrier()); + $request->setBaseSubtotalInclTax($this->getBaseSubtotalInclTax()); + $result = Mage::getModel('Mage_Shipping_Model_Shipping')->collectRates($request)->getResult(); $found = false; @@ -919,9 +930,11 @@ class Mage_Sales_Model_Quote_Address extends Mage_Customer_Model_Address_Abstrac */ 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 b1ffaf9b4fd..7f4e17a950f 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 9e6ba1b6c57..f0061cba696 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 1d8696b1da2..78a93be93a9 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 7df1a568fbf..627ecf0a3d0 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 5addc9b32b2..03522620f6a 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) */ 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 aa62d63baca..ef6642722fe 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 8fbe4474d10..53708d91918 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) */ @@ -139,7 +139,8 @@ class Mage_Sales_Model_Quote_Address_Total_Discount extends Mage_Sales_Model_Quo $amount = $address->getDiscountAmount(); if ($amount!=0) { $title = Mage::helper('Mage_Sales_Helper_Data')->__('Discount'); - if ($code = $address->getCouponCode()) { + $code = $address->getCouponCode(); + if (strlen($code)) { $title = Mage::helper('Mage_Sales_Helper_Data')->__('Discount (%s)', $code); } $address->addTotal(array( @@ -151,4 +152,4 @@ class Mage_Sales_Model_Quote_Address_Total_Discount extends Mage_Sales_Model_Quo return $this; } -} +} \ No newline at end of file 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 311523ac100..5dee569a357 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 @@ class Mage_Sales_Model_Quote_Address_Total_Grand extends Mage_Sales_Model_Quote_ } /** - * 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 3ccc1ea8be4..b3c57029f0e 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 d140fa62e99..6a1b292b449 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 c96a0b3622c..f9b5188e901 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 de77181d3e4..d733d05780e 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 4f8b2f6cc86..73f8dd6147e 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 ac0c77b096d..820a27e08ef 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) */ 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 0434115440a..16b91ef64f3 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 5d14bba158c..389b7348131 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 79ee7c6544f..c0534c1b355 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 472e92e0217..d00f98994b5 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 ebb4da04362..e2cb1b2d550 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) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Config.php b/app/code/core/Mage/Sales/Model/Quote/Config.php index f1842a6b13b..6a0d60b0f70 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 3f49aedafcb..9528b56bda7 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) */ 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 2d16052a053..878a967f39f 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) */ 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 e6c42935e54..daf61417f65 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 e0345599e7d..4f495a56b2d 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 2df45417021..d3e041aca8b 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 38562109331..92f0533ea47 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 e71f02d1b2d..245bfbbd411 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 0ef3dc51da4..c5527a77408 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 43c359af75f..4f2495f80c7 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 new file mode 100644 index 00000000000..a28425f702d --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Resource/Helper/Interface.php @@ -0,0 +1,49 @@ +<?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_Sales + * @copyright 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 resource helper interface + * + * @category Mage + * @package Mage_Sales + * @author Magento Core Team <core@magentocommerce.com> + */ +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 e52f9b3af3b..8c6711a8bfe 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) */ @@ -33,6 +33,7 @@ * @author Magento Core Team <core@magentocommerce.com> */ 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('Mage_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/Order.php b/app/code/core/Mage/Sales/Model/Resource/Order.php index 919bdaa63f2..33ac33181a8 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 da40d3a520b..911645a4d8e 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 @@ abstract class Mage_Sales_Model_Resource_Order_Abstract extends Mage_Sales_Model { 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 @@ abstract class Mage_Sales_Model_Resource_Order_Abstract extends Mage_Sales_Model 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 c6a4eecd233..23d1ad427cd 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 @@ class Mage_Sales_Model_Resource_Order_Address extends Mage_Sales_Model_Resource_ 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( + 'Mage_Sales_Model_Resource_Order' => 'entity_id', + 'Mage_Sales_Model_Resource_Order_Invoice' => 'order_id', + 'Mage_Sales_Model_Resource_Order_Shipment' => 'order_id', + 'Mage_Sales_Model_Resource_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 70fc65560b1..bf2b42ae76e 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 96f42196983..03acfd47d63 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 15857d1d5fb..7dd3a5890f6 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 c16d381a0ac..52c8e42c9eb 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 73740a6320a..94d6b784582 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 fc205ef919a..e34c6c46319 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 c1ebe82a65b..404fef86cba 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 22f912d2a6a..f0948caff63 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 069c1927d21..94ef89730b4 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 3fa14d97bc7..fbfefb82fbc 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 dd1394370be..a5e9bdfbdd8 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 76d1624a6a9..d01bdb3f0f4 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 fae71a8e664..b00d5a08da2 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 7d14d8528be..0fb640064e7 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 2ad7ebc83c7..088196b12d0 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 9cd1bf22de9..1c096be462d 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 2611c16926a..ac59c7a1aae 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 2173ae40b80..0a3a68e6e7c 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) */ 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 ad566883514..00690b8abce 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 4a3fb853299..b8eb11d90a8 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 d77e31aeda6..07240a45260 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 b522931dc6d..33707831e3d 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 67a9d092224..ca9c52df5e3 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 3e05e990806..a171bac342e 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 f79c3702795..3b836a5930a 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 8bf0cef5ef5..979fcfb06b8 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 96b3119e5de..0c935319a62 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 029adea1037..352eb9aac01 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 5ac293c3d20..548a5efe45a 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 04081c89ed3..dafb887689a 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 d05b4c6935b..33c593814b2 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 7e66006408c..afe2144ae75 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 4357e3e01ab..cec4dda9ddd 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 f4787446e78..3c98b88aadc 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 6bd30365869..c5b52f8c4ed 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 be6dbe3e8ed..3f8bdf0fedf 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 260908e1ac1..a27fd5c3b93 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 e78baebaf8e..91378d670ac 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 6aedbcd7400..ee785b99283 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 c864a769179..9e71f5869a0 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 102d8e60574..cd0a5391b58 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 dcfe40923c0..13b374580dc 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 64dae9fc7c3..68b8928f7a8 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 7af2dd8f177..66f1d036e20 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 635afedb4b5..0c32fc18a13 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 b49ec79591b..fc04a0f04cd 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 6db8d35a451..19627ad251f 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 35da2472bd5..940acc67df0 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 7d3191c265b..a1ed0534cdb 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 5e89960a7eb..173dc67352a 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 5c2110edf1d..d29eb231577 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 f34efdc2219..231c54c3e10 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 798fbcc157b..0720547245c 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) */ 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 8fbecd4fb31..e297a66b391 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 56dbb432369..3f4c02a9f2b 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 cdb00856ed5..10a9ca141da 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 445ed2e4a6c..957c159d7e7 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 54dca8e1679..cc7d5f81670 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 20640c9558e..d6f4ebc8fb5 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 284ef7ee3f5..62b443ee3db 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 3614a63f7e4..9240862fbf8 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) */ @@ -46,8 +46,9 @@ class Mage_Sales_Model_Resource_Quote_Address_Attribute_Frontend_Discount $amount = $address->getDiscountAmount(); if ($amount != 0) { $title = Mage::helper('Mage_Sales_Helper_Data')->__('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', @@ -57,4 +58,4 @@ class Mage_Sales_Model_Resource_Quote_Address_Attribute_Frontend_Discount } return $this; } -} +} \ No newline at end of file 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 0ac8e3ab1bf..6dc097f9232 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 34f0c16bf40..b1451965209 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 63bd897edc1..f7a9d1161f8 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 da66589d2b9..34ef984dc6b 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 d45252c9535..481dc0928d1 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 d4b65fccf0a..f0402c88059 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 851dd542bb4..2e712e4ead6 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 d09d25db014..0b569861f1a 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 b0f627fd855..beed2f8882e 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 a5928b3137a..3398e0c536c 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 a89129a8020..b9555fbf7ac 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 4c94607c384..feff8e26f61 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 ff6533156a4..7d52f42d831 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 6dd0832735d..adecbcb3cae 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 25670eda367..c741ef65bc8 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 06eb6111058..2b2229db054 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 b00d6662058..3c25b1e1b0c 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 db7aa7ebefa..876c615fb2c 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 e010dc4d64d..d6b45d204d3 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 1db59e0a596..a7659657429 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 a45b4cda6e6..1f5bc45a75a 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 54489b29524..03c40dd6d24 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) */ @@ -111,7 +111,7 @@ class Mage_Sales_Model_Resource_Report_Bestsellers_Collection ->where('period >= ?', $from) ->where('period <= ?', $to) ->group('product_id') - ->order('qty_ordered') + ->order('qty_ordered DESC') ->limit($this->_ratingLimit); $this->_applyStoresFilterToSelect($sel); @@ -219,7 +219,6 @@ class Mage_Sales_Model_Resource_Report_Bestsellers_Collection parent::_beforeLoad(); $this->_applyStoresFilter(); - $this->_applyDateRangeFilter(); if ($this->_period) { // @@ -343,6 +342,8 @@ class Mage_Sales_Model_Resource_Report_Bestsellers_Collection } + $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 94a2add2caf..156695746a3 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) */ @@ -32,22 +32,9 @@ * @package Mage_Sales * @author Magento Core Team <core@magentocommerce.com> */ -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 - 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 @@ class Mage_Sales_Model_Resource_Report_Collection_Abstract extends Mage_Core_Mod } /** - * 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(); } -} +} \ No newline at end of file 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 391abe6bb19..f08a97e1f59 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 03c444b6eb9..3a6ccc7184f 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 43bcf72b8ba..89efb2296ad 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 cb8b8f35487..22537437612 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 4ba1054caa6..2c94f4f92b3 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 15c814c3288..ab12e77f833 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 6b7f4b73290..dd975b8a587 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 abed4a43a5a..0f223b98c33 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 a52c19f01ea..0b43b13d3ac 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 997e16b7991..eb07e4600c4 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 1b673ff6176..c6d804bb64e 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 263014be56d..1499ab27d39 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 525fdbdd45d..b64a3d0d402 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 488605d1834..180b7be3d62 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 4c2bd0b57cf..e11c04f0f45 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 e2c027a5ec7..0b3f387ce31 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 7e68e5d4f3d..27d05595818 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) */ diff --git a/app/code/core/Mage/Sales/Model/Service/Quote.php b/app/code/core/Mage/Sales/Model/Service/Quote.php index 14934907659..61a7aafa10d 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) */ @@ -279,31 +279,30 @@ class Mage_Sales_Model_Service_Quote */ protected function _validate() { - $helper = Mage::helper('Mage_Sales_Helper_Data'); 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('Mage_Sales_Helper_Data')->__('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('Mage_Sales_Helper_Data')->__('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('Mage_Sales_Helper_Data')->__('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('Mage_Sales_Helper_Data')->__('Please select a valid payment method.')); } return $this; diff --git a/app/code/core/Mage/Sales/Model/Status/List.php b/app/code/core/Mage/Sales/Model/Status/List.php index b32fabb6aec..b22c4ecbd5d 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 0a61662da1f..123b2276661 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 b1e0ad02924..e29b32ff110 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 422b4f09947..67bdf32c000 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 a5401350c11..16440ca1029 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 9866fedf180..40460c2e27e 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 ca96dfa8484..0a09fd5c53a 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 new file mode 100644 index 00000000000..18d9c4a4b81 --- /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 @@ +<?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_Sales + * @copyright 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_Resource_Setup */ +$installer = $this; + +$subSelect = $installer->getConnection()->select() + ->from( + array('citem' => $installer->getTable('sales_flat_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_flat_creditmemo')), + 'c.entity_id = citem.parent_id', + array() + ) + ->joinLeft( + array('o' => $installer->getTable('sales_flat_order')), + 'o.entity_id = c.order_id', + array() + ) + ->joinLeft( + array('oitem' => $installer->getTable('sales_flat_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_flat_order_item')) +); + +$installer->getConnection()->query($updateQuery); diff --git a/app/code/core/Mage/Sales/etc/adminhtml.xml b/app/code/core/Mage/Sales/etc/adminhtml.xml index c27cb4e81fb..12d955d6f8d 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) */ --> diff --git a/app/code/core/Mage/Sales/etc/api.xml b/app/code/core/Mage/Sales/etc/api.xml index d784a4ecf5f..ec9856c35b6 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 8a447968a90..4bdc265eddb 100644 --- a/app/code/core/Mage/Sales/etc/config.xml +++ b/app/code/core/Mage/Sales/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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> <modules> <Mage_Sales> - <version>1.6.0.4</version> + <version>1.6.0.7</version> </Mage_Sales> </modules> <global> @@ -399,6 +399,16 @@ </grand_total> </totals> </pdf> + <events> + <sales_order_place_after> + <observers> + <sales_vat_request_params_order_comment> + <class>Mage_Sales_Model_Observer</class> + <method>addVatRequestParamsOrderComment</method> + </sales_vat_request_params_order_comment> + </observers> + </sales_order_place_after> + </events> </global> <frontend> <secure_url> @@ -436,6 +446,22 @@ </updates> </layout> <events> + <sales_quote_address_collect_totals_before> + <observers> + <sales_customer_validate_vat_number> + <class>Mage_Sales_Model_Observer</class> + <method>changeQuoteCustomerGroupId</method> + </sales_customer_validate_vat_number> + </observers> + </sales_quote_address_collect_totals_before> + <sales_quote_address_collect_totals_after> + <observers> + <sales_customer_validate_vat_number> + <class>Mage_Sales_Model_Observer</class> + <method>restoreQuoteCustomerGroupId</method> + </sales_customer_validate_vat_number> + </observers> + </sales_quote_address_collect_totals_after> <sales_quote_collect_totals_after> <observers> <catalog_msrp> diff --git a/app/code/core/Mage/Sales/etc/fieldset.xml b/app/code/core/Mage/Sales/etc/fieldset.xml index f82bc049809..72445ec6b00 100644 --- a/app/code/core/Mage/Sales/etc/fieldset.xml +++ b/app/code/core/Mage/Sales/etc/fieldset.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/system.xml b/app/code/core/Mage/Sales/etc/system.xml index c9301d35ab6..307e8846299 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) */ --> diff --git a/app/code/core/Mage/Sales/etc/widget.xml b/app/code/core/Mage/Sales/etc/widget.xml index f26101dfde9..c8eb0aa1569 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 7e4e966bb49..ff8e9d711e4 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/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 b8f2a9d167c..4157327df39 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 80798062456..09d5c540a34 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 39d53819ee0..b149adde999 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 431140fe81f..641ebb13d4c 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 new file mode 100644 index 00000000000..effc49378de --- /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 @@ +<?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_Sales + * @copyright 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_Resource_Setup */ +$installer = $this; +$installer->getConnection() + ->addColumn($installer->getTable('sales_flat_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_flat_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_flat_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 00000000000..f909aab42c9 --- /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 @@ +<?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_Sales + * @copyright 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_Resource_Setup */ +$installer = $this; + +$entitiesToAlter = array( + 'quote_address', + 'order_address' +); + +$attributes = array( + 'vat_id' => 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 00000000000..d50b282b31a --- /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 @@ +<?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_Sales + * @copyright 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_Resource_Setup */ +$installer = $this; + +$installer->getConnection() + ->addColumn($installer->getTable('sales_flat_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/Sales/view/adminhtml/billing/agreement/form.phtml b/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/form.phtml index c811ef03d3a..949d311e5ef 100644 --- a/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/form.phtml +++ b/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/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/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/form.phtml b/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/form.phtml index d8c5e1d2488..ef6f4b2eaec 100644 --- a/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/form.phtml +++ b/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/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/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/tab/info.phtml b/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/tab/info.phtml index 105cd646500..11468297fe6 100644 --- a/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/tab/info.phtml +++ b/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/tab/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/code/core/Mage/Sales/view/adminhtml/payment/form/billing/agreement.phtml b/app/code/core/Mage/Sales/view/adminhtml/payment/form/billing/agreement.phtml index 20deed0b7fe..1a08f00659e 100644 --- a/app/code/core/Mage/Sales/view/adminhtml/payment/form/billing/agreement.phtml +++ b/app/code/core/Mage/Sales/view/adminhtml/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/code/core/Mage/Sales/view/adminhtml/recurring/profile/view.phtml b/app/code/core/Mage/Sales/view/adminhtml/recurring/profile/view.phtml index 37bdcf1d14d..f749b6cc4d4 100644 --- a/app/code/core/Mage/Sales/view/adminhtml/recurring/profile/view.phtml +++ b/app/code/core/Mage/Sales/view/adminhtml/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/code/core/Mage/Sales/view/adminhtml/recurring/profile/view/info.phtml b/app/code/core/Mage/Sales/view/adminhtml/recurring/profile/view/info.phtml index 83ac0370639..45585d7dfcf 100644 --- a/app/code/core/Mage/Sales/view/adminhtml/recurring/profile/view/info.phtml +++ b/app/code/core/Mage/Sales/view/adminhtml/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/code/core/Mage/Sales/view/frontend/billing/agreement/view.phtml b/app/code/core/Mage/Sales/view/frontend/billing/agreement/view.phtml index 5a4ce6e08e0..ead40558b5f 100644 --- a/app/code/core/Mage/Sales/view/frontend/billing/agreement/view.phtml +++ b/app/code/core/Mage/Sales/view/frontend/billing/agreement/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/code/core/Mage/Sales/view/frontend/billing/agreements.phtml b/app/code/core/Mage/Sales/view/frontend/billing/agreements.phtml index 4627edb657a..b66b05025a8 100644 --- a/app/code/core/Mage/Sales/view/frontend/billing/agreements.phtml +++ b/app/code/core/Mage/Sales/view/frontend/billing/agreements.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/code/core/Mage/Sales/view/frontend/billing_agreement.xml b/app/code/core/Mage/Sales/view/frontend/billing_agreement.xml index ba6b2bbc233..2178e685135 100644 --- a/app/code/core/Mage/Sales/view/frontend/billing_agreement.xml +++ b/app/code/core/Mage/Sales/view/frontend/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/code/core/Mage/Sales/view/frontend/email/creditmemo/items.phtml b/app/code/core/Mage/Sales/view/frontend/email/creditmemo/items.phtml index c304e68453f..962c21bc415 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/creditmemo/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/creditmemo/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) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/email/invoice/items.phtml b/app/code/core/Mage/Sales/view/frontend/email/invoice/items.phtml index 17b8bbc8e34..83c79ead464 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/invoice/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/invoice/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) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/email/items.phtml b/app/code/core/Mage/Sales/view/frontend/email/items.phtml index 1fd797510c7..b92a5788128 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/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) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/email/items/creditmemo/default.phtml b/app/code/core/Mage/Sales/view/frontend/email/items/creditmemo/default.phtml index 5dab6dd48f6..6edfa17cd74 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/items/creditmemo/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/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/code/core/Mage/Sales/view/frontend/email/items/invoice/default.phtml b/app/code/core/Mage/Sales/view/frontend/email/items/invoice/default.phtml index 5dab6dd48f6..6edfa17cd74 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/items/invoice/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/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/code/core/Mage/Sales/view/frontend/email/items/order/default.phtml b/app/code/core/Mage/Sales/view/frontend/email/items/order/default.phtml index 7aace983be8..e8d19c3dd0e 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/items/order/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/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/code/core/Mage/Sales/view/frontend/email/items/shipment/default.phtml b/app/code/core/Mage/Sales/view/frontend/email/items/shipment/default.phtml index 1b475e35a22..452ee3ded40 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/items/shipment/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/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/code/core/Mage/Sales/view/frontend/email/shipment/items.phtml b/app/code/core/Mage/Sales/view/frontend/email/shipment/items.phtml index f9893f70c45..b2bf2582528 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/shipment/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/shipment/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) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/email/shipment/track.phtml b/app/code/core/Mage/Sales/view/frontend/email/shipment/track.phtml index 9da529077b9..e670dd03a2e 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/shipment/track.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/shipment/track.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/code/core/Mage/Sales/view/frontend/guest/form.phtml b/app/code/core/Mage/Sales/view/frontend/guest/form.phtml index 04acce362bc..544335d1b3c 100644 --- a/app/code/core/Mage/Sales/view/frontend/guest/form.phtml +++ b/app/code/core/Mage/Sales/view/frontend/guest/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/code/core/Mage/Sales/view/frontend/layout.xml b/app/code/core/Mage/Sales/view/frontend/layout.xml index 3c2463cb5f7..6edf1d1ca31 100644 --- a/app/code/core/Mage/Sales/view/frontend/layout.xml +++ b/app/code/core/Mage/Sales/view/frontend/layout.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/code/core/Mage/Sales/view/frontend/order/comments.phtml b/app/code/core/Mage/Sales/view/frontend/order/comments.phtml index 1d0f460b839..233c3ca99fa 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/comments.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/comments.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/code/core/Mage/Sales/view/frontend/order/creditmemo.phtml b/app/code/core/Mage/Sales/view/frontend/order/creditmemo.phtml index 20758b649e6..774cc4ea1c2 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/creditmemo.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/creditmemo.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/code/core/Mage/Sales/view/frontend/order/creditmemo/items.phtml b/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items.phtml index 2b717daab71..e9cd44b0b2f 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/creditmemo/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) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items/renderer/default.phtml b/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items/renderer/default.phtml index 9cd1efc5691..04695821f88 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items/renderer/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items/renderer/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/code/core/Mage/Sales/view/frontend/order/history.phtml b/app/code/core/Mage/Sales/view/frontend/order/history.phtml index e8dc48961e9..0cf44867a04 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/history.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/history.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/code/core/Mage/Sales/view/frontend/order/info.phtml b/app/code/core/Mage/Sales/view/frontend/order/info.phtml index 3fc080cf7ae..a0f535d6bee 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/info.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/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/code/core/Mage/Sales/view/frontend/order/info/buttons.phtml b/app/code/core/Mage/Sales/view/frontend/order/info/buttons.phtml index 26dca1231b4..0f6c89acf83 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/info/buttons.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/info/buttons.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/code/core/Mage/Sales/view/frontend/order/invoice.phtml b/app/code/core/Mage/Sales/view/frontend/order/invoice.phtml index e55090ceee5..6ac908fe573 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/invoice.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/invoice.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/code/core/Mage/Sales/view/frontend/order/invoice/items.phtml b/app/code/core/Mage/Sales/view/frontend/order/invoice/items.phtml index ad07511f685..7c9a5f66b94 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/invoice/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/invoice/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) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/invoice/items/renderer/default.phtml b/app/code/core/Mage/Sales/view/frontend/order/invoice/items/renderer/default.phtml index 731fddd47a0..b791f60ff15 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/invoice/items/renderer/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/invoice/items/renderer/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/code/core/Mage/Sales/view/frontend/order/items.phtml b/app/code/core/Mage/Sales/view/frontend/order/items.phtml index 893d8f9f489..535922b9ac1 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/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) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/items/renderer/default.phtml b/app/code/core/Mage/Sales/view/frontend/order/items/renderer/default.phtml index aae9922fd73..5aeda918cc9 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/items/renderer/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/items/renderer/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/code/core/Mage/Sales/view/frontend/order/print.phtml b/app/code/core/Mage/Sales/view/frontend/order/print.phtml index 8906248ed64..30e9d88ccf1 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/print.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/print.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/code/core/Mage/Sales/view/frontend/order/print/creditmemo.phtml b/app/code/core/Mage/Sales/view/frontend/order/print/creditmemo.phtml index 537b86a350f..96d8f227d33 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/print/creditmemo.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/print/creditmemo.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/code/core/Mage/Sales/view/frontend/order/print/invoice.phtml b/app/code/core/Mage/Sales/view/frontend/order/print/invoice.phtml index 28a4c0fa8fd..926a5704cb6 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/print/invoice.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/print/invoice.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/code/core/Mage/Sales/view/frontend/order/print/shipment.phtml b/app/code/core/Mage/Sales/view/frontend/order/print/shipment.phtml index 98f9c8f768a..2419e16c2a5 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/print/shipment.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/print/shipment.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/code/core/Mage/Sales/view/frontend/order/recent.phtml b/app/code/core/Mage/Sales/view/frontend/order/recent.phtml index 292de3f96f8..1c5168cafec 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/recent.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/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/code/core/Mage/Sales/view/frontend/order/shipment.phtml b/app/code/core/Mage/Sales/view/frontend/order/shipment.phtml index 1410170bd60..bd3740b9948 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/shipment.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/shipment.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/code/core/Mage/Sales/view/frontend/order/shipment/items.phtml b/app/code/core/Mage/Sales/view/frontend/order/shipment/items.phtml index 4352b960972..d37ecbf550a 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/shipment/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/shipment/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) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/shipment/items/renderer/default.phtml b/app/code/core/Mage/Sales/view/frontend/order/shipment/items/renderer/default.phtml index e67cfc0be85..d6e32f966e0 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/shipment/items/renderer/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/shipment/items/renderer/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/code/core/Mage/Sales/view/frontend/order/totals.phtml b/app/code/core/Mage/Sales/view/frontend/order/totals.phtml index 870da0ca4fa..e17b6013149 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/totals.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/totals.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,9 +35,9 @@ <tr class="<?php echo $_code?>"> <td <?php echo $this->getLabelProperties()?>> <?php if ($_total->getStrong()):?> - <strong><?php echo $_total->getLabel()?></strong> + <strong><?php echo $this->escapeHtml($_total->getLabel());?></strong> <?php else:?> - <?php echo $_total->getLabel()?> + <?php echo $this->escapeHtml($_total->getLabel());?> <?php endif?> </td> <td <?php echo $this->getValueProperties()?>> diff --git a/app/code/core/Mage/Sales/view/frontend/order/trackinginfo.phtml b/app/code/core/Mage/Sales/view/frontend/order/trackinginfo.phtml index bd6c6635c78..93337cb36b7 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/trackinginfo.phtml +++ b/app/code/core/Mage/Sales/view/frontend/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/code/core/Mage/Sales/view/frontend/order/view.phtml b/app/code/core/Mage/Sales/view/frontend/order/view.phtml index 542cddba890..178ece774af 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/view.phtml +++ b/app/code/core/Mage/Sales/view/frontend/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/code/core/Mage/Sales/view/frontend/payment/form/billing/agreement.phtml b/app/code/core/Mage/Sales/view/frontend/payment/form/billing/agreement.phtml index 8e2ade9429c..986aaced574 100644 --- a/app/code/core/Mage/Sales/view/frontend/payment/form/billing/agreement.phtml +++ b/app/code/core/Mage/Sales/view/frontend/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/code/core/Mage/Sales/view/frontend/recurring/grid.phtml b/app/code/core/Mage/Sales/view/frontend/recurring/grid.phtml index 1adf2bd237b..47a16debd37 100644 --- a/app/code/core/Mage/Sales/view/frontend/recurring/grid.phtml +++ b/app/code/core/Mage/Sales/view/frontend/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/code/core/Mage/Sales/view/frontend/recurring/profile/view.phtml b/app/code/core/Mage/Sales/view/frontend/recurring/profile/view.phtml index 7de4ee8cff6..1aafd0f1d70 100644 --- a/app/code/core/Mage/Sales/view/frontend/recurring/profile/view.phtml +++ b/app/code/core/Mage/Sales/view/frontend/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/code/core/Mage/Sales/view/frontend/recurring/profile/view/info.phtml b/app/code/core/Mage/Sales/view/frontend/recurring/profile/view/info.phtml index 38bef14b690..fa931d9707b 100644 --- a/app/code/core/Mage/Sales/view/frontend/recurring/profile/view/info.phtml +++ b/app/code/core/Mage/Sales/view/frontend/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/code/core/Mage/Sales/view/frontend/recurring/profiles.phtml b/app/code/core/Mage/Sales/view/frontend/recurring/profiles.phtml index 05d99802ab7..945de336ce8 100644 --- a/app/code/core/Mage/Sales/view/frontend/recurring/profiles.phtml +++ b/app/code/core/Mage/Sales/view/frontend/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/code/core/Mage/Sales/view/frontend/recurring_profile.xml b/app/code/core/Mage/Sales/view/frontend/recurring_profile.xml index 4407422efa1..90cc063eb66 100644 --- a/app/code/core/Mage/Sales/view/frontend/recurring_profile.xml +++ b/app/code/core/Mage/Sales/view/frontend/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/code/core/Mage/Sales/view/frontend/reorder/sidebar.phtml b/app/code/core/Mage/Sales/view/frontend/reorder/sidebar.phtml index 711238f3971..5c0beba3b8f 100644 --- a/app/code/core/Mage/Sales/view/frontend/reorder/sidebar.phtml +++ b/app/code/core/Mage/Sales/view/frontend/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/code/core/Mage/Sales/view/frontend/widget/guest/form.phtml b/app/code/core/Mage/Sales/view/frontend/widget/guest/form.phtml index fec911587e2..531ec68a88e 100644 --- a/app/code/core/Mage/Sales/view/frontend/widget/guest/form.phtml +++ b/app/code/core/Mage/Sales/view/frontend/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/code/core/Mage/SalesRule/Exception.php b/app/code/core/Mage/SalesRule/Exception.php index 5db103e8d86..1f47bae403b 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 new file mode 100644 index 00000000000..950dc5aaa7c --- /dev/null +++ b/app/code/core/Mage/SalesRule/Helper/Coupon.php @@ -0,0 +1,147 @@ +<?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_SalesRule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Helper for coupon codes creating and managing + * + * @category Mage + * @package Mage_SalesRule + * @author Magento Core Team <core@magentocommerce.com> + */ +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 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/Helper/Data.php b/app/code/core/Mage/SalesRule/Helper/Data.php index 5a1c7541e67..6bf91eef9b0 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 b57efa16cad..dfddd03771a 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) */ @@ -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 @@ class Mage_SalesRule_Model_Coupon extends Mage_Core_Model_Abstract /** * 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/Codegenerator.php b/app/code/core/Mage/SalesRule/Model/Coupon/Codegenerator.php index a4216854fbb..5f43eacf4ad 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 1cc8e3e0539..40c991328ed 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 new file mode 100644 index 00000000000..5201b6a0cd1 --- /dev/null +++ b/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php @@ -0,0 +1,194 @@ +<?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_SalesRule + * @copyright 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 Mass Coupon Generator + * + * @method Mage_SalesRule_Model_Resource_Coupon getResource() + * + * @category Mage + * @package Mage_SalesRule + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_SalesRule_Model_Resource_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('Mage_SalesRule_Helper_Coupon')->getCharset($format); + + $code = ''; + $charsetSize = count($charset); + for ($i=0; $i<$length; $i++) { + $char = $charset[mt_rand(0, $charsetSize - 1)]; + 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('Mage_SalesRule_Helper_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('Mage_SalesRule_Model_Coupon'); + + $chars = count(Mage::helper('Mage_SalesRule_Helper_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); + } + + $now = $this->getResource()->formatDate( + Mage::getSingleton('Mage_Core_Model_Date')->gmtTimestamp() + ); + + for ($i = 0; $i < $size; $i++) { + $attempt = 0; + do { + if ($attempt >= $maxAttempts) { + Mage::throwException(Mage::helper('Mage_SalesRule_Helper_Data')->__('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) + ->setCreatedAt($now) + ->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 4eb04886820..dc7142aa4fe 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) */ @@ -213,5 +213,43 @@ class Mage_SalesRule_Model_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('Mage_SalesRule_Model_Coupon'); + $couponModel->loadByCode($couponCode); + + $ruleId = $couponModel->getRuleId(); + + if (empty($ruleId)) { + return $this; + } + + /** + * @var Mage_SalesRule_Model_Rule $ruleModel + */ + $ruleModel = Mage::getModel('Mage_SalesRule_Model_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 7cc4206be81..2515a75c17a 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) */ @@ -139,7 +139,7 @@ class Mage_SalesRule_Model_Quote_Discount extends Mage_Sales_Model_Quote_Address if ($amount!=0) { $description = $address->getDiscountDescription(); - if ($description) { + if (strlen($description)) { $title = Mage::helper('Mage_Sales_Helper_Data')->__('Discount (%s)', $description); } else { $title = Mage::helper('Mage_Sales_Helper_Data')->__('Discount'); @@ -152,4 +152,4 @@ class Mage_SalesRule_Model_Quote_Discount extends Mage_Sales_Model_Quote_Address } return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php b/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php index b481e20e732..b7e69ef46aa 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 afdce233d03..eac3aad20bc 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 ad0ce9c3981..2b00807d828 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) */ @@ -36,7 +36,6 @@ class Mage_SalesRule_Model_Resource_Coupon extends Mage_Core_Model_Resource_Db_A { /** * Constructor adds unique fields - * */ protected function _construct() { @@ -50,13 +49,13 @@ class Mage_SalesRule_Model_Resource_Coupon extends Mage_Core_Model_Resource_Db_A /** * 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) { 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)); } @@ -72,7 +71,7 @@ class Mage_SalesRule_Model_Resource_Coupon extends Mage_Core_Model_Resource_Db_A * * * @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 @@ class Mage_SalesRule_Model_Resource_Coupon extends Mage_Core_Model_Resource_Db_A $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 8f1358f6b14..442e6aff3df 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) */ @@ -76,4 +76,30 @@ class Mage_SalesRule_Model_Resource_Coupon_Collection extends Mage_Core_Model_Re $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/Coupon/Usage.php b/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Usage.php index 6536665d9d0..e86aa6b050f 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 b403f55878d..4c3ab312474 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) */ @@ -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 @@ class Mage_SalesRule_Model_Resource_Report_Collection extends Mage_Sales_Model_R $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 @@ class Mage_SalesRule_Model_Resource_Report_Collection extends Mage_Sales_Model_R 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('Mage_SalesRule_Model_Resource_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 b5f130a0593..9df8497b10f 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) */ @@ -58,4 +58,33 @@ class Mage_SalesRule_Model_Resource_Report_Rule extends Mage_Reports_Model_Resou return $this; } + + /** + * Get all unique Rule Names from aggregated coupons usage data + * + * @return array + */ + public function getUniqRulesNamesList() + { + $adapter = $this->_getReadAdapter(); + $tableName = $this->getTable('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; + } } 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 8591b9f2798..7b314fea494 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) */ @@ -66,6 +66,11 @@ class Mage_SalesRule_Model_Resource_Report_Rule_Createdat extends Mage_Reports_M */ 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_flat_order'); $adapter = $this->_getWriteAdapter(); @@ -90,6 +95,7 @@ class Mage_SalesRule_Model_Resource_Report_Rule_Createdat extends Mage_Reports_M '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 @@ class Mage_SalesRule_Model_Resource_Report_Rule_Createdat extends Mage_Reports_M '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/Report/Rule/Updatedat.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Updatedat.php index 7e74449003c..94e06fe1fc8 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 2e604a9a71a..c6313246e6e 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 8b8be424efc..f515b2f28ad 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 <core@magentocommerce.com> + * @category Mage + * @package Mage_SalesRule + * @author Magento Core Team <core@magentocommerce.com> */ -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 @@ class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abs } /** - * 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(new Zend_Db_Expr('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(new Zend_Db_Expr('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($object->getConditionsSerialized()), + $this->getProductAttributes($object->getActionsSerialized()) + ); + if (count($ruleProductAttributes)) { + $this->setActualProductAttributes($object, $ruleProductAttributes); + } + + // Update auto geterated specific coupons if exists + if ($object->getUseAutoGeneration() && $object->hasDataChanges()) { + Mage::getResourceModel('Mage_SalesRule_Model_Resource_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 @@ class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abs * * @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('Mage_Core_Helper_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 @@ class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abs * * @param Mage_SalesRule_Model_Rule $rule * @param mixed $attributes - * return Mage_SalesRule_Model_Resource_Rule + * @return Mage_SalesRule_Model_Resource_Rule */ public function setActualProductAttributes($rule, $attributes) { @@ -182,8 +269,8 @@ class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abs //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 @@ class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abs } $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 @@ class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abs } $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 960353ed0e8..24d12d58059 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 <core@magentocommerce.com> */ -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 @@ class Mage_SalesRule_Model_Resource_Rule_Collection extends Mage_Core_Model_Reso } /** - * 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|null $now + * @use $this->addWebsiteGroupDateFilter() * - * @param unknown_type $websiteId - * @param unknown_type $customerGroupId - * @param unknown_type $couponCode - * @param unknown_type $now * @return Mage_SalesRule_Model_Resource_Rule_Collection */ public function setValidationFilter($websiteId, $customerGroupId, $couponCode = '', $now = null) { - if (is_null($now)) { - $now = Mage::getModel('Mage_Core_Model_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 ($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('Mage_Core_Model_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 @@ class Mage_SalesRule_Model_Resource_Rule_Collection extends Mage_Core_Model_Reso * Find product attribute in conditions or actions * * @param string $attributeCode + * * @return Mage_SalesRule_Model_Resource_Rule_Collection */ public function addAttributeInConditionFilter($attributeCode) @@ -144,4 +190,19 @@ class Mage_SalesRule_Model_Resource_Rule_Collection extends Mage_Core_Model_Reso 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/Resource/Rule/Customer.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer.php index b933e60cd49..c3016323c69 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 812bf623959..281f9b55ae0 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/Rule.php b/app/code/core/Mage/SalesRule/Model/Rule.php index 0c5b83a6ebd..c58fcdb8c57 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() @@ -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,16 +78,30 @@ * @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 * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule +class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Abstract { - const FREE_SHIPPING_ITEM = 1; + /** + * Free Shipping option "For matching items only" + */ + const FREE_SHIPPING_ITEM = 1; + + /** + * Free Shipping option "For shipment with matching items" + */ const FREE_SHIPPING_ADDRESS = 2; + /** + * Coupon types + */ const COUPON_TYPE_NO_COUPON = 1; const COUPON_TYPE_SPECIFIC = 2; const COUPON_TYPE_AUTO = 3; @@ -100,8 +116,9 @@ 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'; - /** + * Store coupon code generator instance + * * @var Mage_SalesRule_Model_Coupon_CodegeneratorInterface */ protected static $_couponCodeGenerator; @@ -122,6 +139,13 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule */ protected $_eventObject = 'rule'; + /** + * Contain sores labels + * + * @deprecated after 1.6.2.0 + * + * @var array + */ protected $_labels = array(); /** @@ -146,12 +170,15 @@ 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(); + /** + * Set resource model and Id field name + */ protected function _construct() { parent::_construct(); @@ -160,183 +187,169 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule } /** - * Set code generator instance for auto generated coupons + * Returns code mass generator instance for auto generated specific coupons * - * @return Mage_SalesRule_Model_Coupon_CodegeneratorInterface + * @return Mage_SalesRule_Model_Coupon_MassgneratorInterface */ - public static function getCouponCodeGenerator() + public static function getCouponMassGenerator() { - if (!self::$_couponCodeGenerator) { - return Mage::getSingleton('Mage_SalesRule_Model_Coupon_Codegenerator', array('length' => 16)); - } - return self::$_couponCodeGenerator; + return Mage::getSingleton('Mage_SalesRule_Model_Coupon_Massgenerator'); } /** - * Set code generator instance for auto generated coupons + * Set coupon code and uses per coupon * - * @param Mage_SalesRule_Model_Coupon_CodegeneratorInterface + * @return Mage_SalesRule_Model_Rule */ - public static function setCouponCodeGenerator(Mage_SalesRule_Model_Coupon_CodegeneratorInterface $codeGenerator) + protected function _afterLoad() { - self::$_couponCodeGenerator = $codeGenerator; + $this->setCouponCode($this->getPrimaryCoupon()->getCode()); + if ($this->getUsesPerCoupon() !== null && !$this->getUseAutoGeneration()) { + $this->setUsesPerCoupon($this->getPrimaryCoupon()->getUsageLimit()); + } + 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('Mage_SalesRule_Model_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()); - $this->setUsesPerCoupon($this->getPrimaryCoupon()->getUsageLimit()); - return parent::_afterLoad(); + parent::loadPost($data); + + if (isset($data['store_labels'])) { + $this->setStoreLabels($data['store_labels']); + } + + return $this; } + /** + * Get rule condition combine model instance + * + * @return Mage_SalesRule_Model_Rule_Condition_Combine + */ public function getConditionsInstance() { return Mage::getModel('Mage_SalesRule_Model_Rule_Condition_Combine'); } + /** + * Get rule condition product combine model instance + * + * @return Mage_SalesRule_Model_Rule_Condition_Product_Combine + */ public function getActionsInstance() { return Mage::getModel('Mage_SalesRule_Model_Rule_Condition_Product_Combine'); } - public function toString($format='') - { - $str = Mage::helper('Mage_SalesRule_Helper_Data')->__("Name: %s", $this->getName()) ."\n" - . Mage::helper('Mage_SalesRule_Helper_Data')->__("Start at: %s", $this->getStartAt()) ."\n" - . Mage::helper('Mage_SalesRule_Helper_Data')->__("Expire at: %s", $this->getExpireAt()) ."\n" - . Mage::helper('Mage_SalesRule_Helper_Data')->__("Customer registered: %s", $this->getCustomerRegistered()) ."\n" - . Mage::helper('Mage_SalesRule_Helper_Data')->__("Customer is new buyer: %s", $this->getCustomerNewBuyer()) ."\n" - . Mage::helper('Mage_SalesRule_Helper_Data')->__("Description: %s", $this->getDescription()) ."\n\n" - . $this->getConditions()->toStringRecursive() ."\n\n" - . $this->getActions()->toStringRecursive() ."\n\n"; - return $str; - } - /** - * 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('Mage_SalesRule_Model_Coupon_Codegenerator', array('length' => 16)); } - return $this; + return self::$_couponCodeGenerator; } /** - * Returns rule as an array for admin interface - * - * Output example: - * array( - * 'name'=>'Example rule', - * 'conditions'=>{condition_combine::toArray} - * 'actions'=>{action_collection::toArray} - * ) + * Set code generator instance for auto generated coupons * - * @return array + * @param Mage_SalesRule_Model_Coupon_CodegeneratorInterface */ - public function toArray(array $arrAttributes = array()) + public static function setCouponCodeGenerator(Mage_SalesRule_Model_Coupon_CodegeneratorInterface $codeGenerator) { - $out = parent::toArray($arrAttributes); - $out['customer_registered'] = $this->getCustomerRegistered(); - $out['customer_new_buyer'] = $this->getCustomerNewBuyer(); - - return $out; + self::$_couponCodeGenerator = $codeGenerator; } - public function getResourceCollection() + /** + * Retrieve rule's primary coupon + * + * @return Mage_SalesRule_Model_Coupon + */ + public function getPrimaryCoupon() { - return Mage::getResourceModel('Mage_SalesRule_Model_Resource_Rule_Collection'); + if ($this->_primaryCoupon === null) { + $this->_primaryCoupon = Mage::getModel('Mage_SalesRule_Model_Coupon'); + $this->_primaryCoupon->loadPrimaryByRule($this->getId()); + $this->_primaryCoupon->setRule($this)->setIsPrimary(true); + } + return $this->_primaryCoupon; } /** - * Save rule labels after rule save and process product attributes used in actions and conditions + * Get sales rule customer group Ids * - * @return Mage_SalesRule_Model_Rule + * @return array */ - protected function _afterSave() + public function getCustomerGroupIds() { - if ($this->hasStoreLabels()) { - $this->_getResource()->saveStoreLabels($this->getId(), $this->getStoreLabels()); - } - $couponCode = trim($this->getCouponCode()); - if ($couponCode && $this->getCouponType() == self::COUPON_TYPE_SPECIFIC) { - $this->getPrimaryCoupon() - ->setCode($couponCode) - ->setUsageLimit($this->getUsesPerCoupon() ? $this->getUsesPerCoupon() : null) - ->setUsagePerCustomer($this->getUsesPerCustomer() ? $this->getUsesPerCustomer() : null) - ->setExpirationDate($this->getToDate()) - ->save(); - } else { - $this->getPrimaryCoupon()->delete(); + if (!$this->hasCustomerGroupIds()) { + $customerGroupIds = $this->_getResource()->getCustomerGroupIds($this->getId()); + $this->setData('customer_group_ids', (array)$customerGroupIds); } - - //Saving attributes used in rule - $ruleProductAttributes = array_merge( - $this->_getUsedAttributes($this->getConditionsSerialized()), - $this->_getUsedAttributes($this->getActionsSerialized()) - ); - if (count($ruleProductAttributes)) { - $this->getResource()->setActualProductAttributes($this, $ruleProductAttributes); - } - 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 */ @@ -346,6 +359,7 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule $labels = $this->_getResource()->getStoreLabels($this->getId()); $this->setStoreLabels($labels); } + return $this->_getData('store_labels'); } @@ -378,8 +392,8 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC => Mage::helper('Mage_SalesRule_Helper_Data')->__('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(); @@ -393,8 +407,9 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule /** * 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) @@ -407,13 +422,15 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule } /** @var Mage_SalesRule_Model_Coupon $coupon */ $coupon = Mage::getModel('Mage_SalesRule_Model_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; @@ -443,24 +460,6 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule 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 $offset => $attributeCode) { - $result[] = $attributeCode; - } - } - return $result; - } - /** * Check cached validation result for specific address * @@ -511,4 +510,55 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule } 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 7d9e6cadd33..932634a7c00 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 6fd7b8352f1..02cd04a6e84 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 ecf8468eab4..3712538ba96 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 19a96dc1ff6..b12c4c33996 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 1171b1fb67c..f392a572e54 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 <core@magentocommerce.com> + */ +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 @@ class Mage_SalesRule_Model_Rule_Condition_Product extends Mage_CatalogRule_Model * 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 09b42da81bc..2ce01863f05 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 9fdcd57fda0..575f26e7690 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) */ @@ -50,12 +50,10 @@ class Mage_SalesRule_Model_Rule_Condition_Product_Found public function asHtml() { - $html = $this->getTypeElement()->getHtml(). - Mage::helper('Mage_SalesRule_Helper_Data')->__("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('Mage_SalesRule_Helper_Data')->__("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 f5d6fec5e61..8f52c0a60d0 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) */ @@ -45,29 +45,17 @@ class Mage_SalesRule_Model_Rule_Condition_Product_Subselect public function asXml($containerKey='conditions', $itemKey='condition') { - $xml .= '<attribute>'.$this->getAttribute().'</attribute>' - .'<operator>'.$this->getOperator().'</operator>' - .parent::asXml($containerKey, $itemKey); + $xml = '<attribute>'.$this->getAttribute().'</attribute>' + . '<operator>'.$this->getOperator().'</operator>' + . parent::asXml($containerKey, $itemKey); return $xml; } -// public function loadAggregatorOptions() -// { -// $this->setAggregatorOption(array( -// '1/all' => Mage::helper('Mage_Rule_Helper_Data')->__('MATCHING ALL'), -// '1/any' => Mage::helper('Mage_Rule_Helper_Data')->__('MATCHING ANY'), -// '0/all' => Mage::helper('Mage_Rule_Helper_Data')->__('NOT MATCHING ALL'), -// '0/any' => Mage::helper('Mage_Rule_Helper_Data')->__('NOT MATCHING ANY'), -// )); -// return $this; -// } - public function loadAttributeOptions() { - $hlp = Mage::helper('Mage_SalesRule_Helper_Data'); $this->setAttributeOption(array( - 'qty' => $hlp->__('total quantity'), - 'base_row_total' => $hlp->__('total amount'), + 'qty' => Mage::helper('Mage_SalesRule_Helper_Data')->__('total quantity'), + 'base_row_total' => Mage::helper('Mage_SalesRule_Helper_Data')->__('total amount'), )); return $this; } @@ -100,15 +88,10 @@ class Mage_SalesRule_Model_Rule_Condition_Product_Subselect public function asHtml() { $html = $this->getTypeElement()->getHtml(). - Mage::helper('Mage_SalesRule_Helper_Data')->__("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('Mage_SalesRule_Helper_Data')->__("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/Rule/Customer.php b/app/code/core/Mage/SalesRule/Model/Rule/Customer.php index 3a9d09b0edd..5d912b212ce 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/System/Config/Source/Coupon/Format.php b/app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php new file mode 100755 index 00000000000..1b560d744da --- /dev/null +++ b/app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php @@ -0,0 +1,54 @@ +<?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_SalesRule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Options for Code Format Field in Auto Generated Specific Coupon Codes configuration section + * + * @category Mage + * @package Mage_SalesRule + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_SalesRule_Model_System_Config_Source_Coupon_Format +{ + /** + * Options getter + * + * @return array + */ + public function toOptionArray() + { + $formatsList = Mage::helper('Mage_SalesRule_Helper_Coupon')->getFormatsList(); + $result = array(); + foreach ($formatsList as $formatId => $formatTitle) { + $result[] = array( + 'value' => $formatId, + 'label' => $formatTitle + ); + } + + return $result; + } +} \ No newline at end of file diff --git a/app/code/core/Mage/SalesRule/Model/Validator.php b/app/code/core/Mage/SalesRule/Model/Validator.php index d16b6261e96..fc40996ba0b 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) */ @@ -388,7 +388,7 @@ class Mage_SalesRule_Model_Validator extends Mage_Core_Model_Abstract 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; @@ -683,7 +683,7 @@ class Mage_SalesRule_Model_Validator extends Mage_Core_Model_Abstract 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()); } @@ -704,11 +704,11 @@ class Mage_SalesRule_Model_Validator extends Mage_Core_Model_Abstract $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; } diff --git a/app/code/core/Mage/SalesRule/etc/adminhtml.xml b/app/code/core/Mage/SalesRule/etc/adminhtml.xml index 890853a5ab4..9dec343e924 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) */ --> @@ -41,13 +41,17 @@ <resources> <admin> <children> - <promo> + <system> <children> - <quote translate="title" module="Mage_SalesRule"> - <title>Shopping Cart Price Rules</title> - </quote> + <config> + <children> + <promo translate="title" module="Mage_SalesRule"> + <title>Shopping Cart Price Rules</title> + </promo> + </children> + </config> </children> - </promo> + </system> </children> </admin> </resources> diff --git a/app/code/core/Mage/SalesRule/etc/config.xml b/app/code/core/Mage/SalesRule/etc/config.xml index 67495d9c0fb..8ee555f0393 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) */ --> <config> <modules> <Mage_SalesRule> - <version>1.6.0.1</version> + <version>1.6.0.3</version> </Mage_SalesRule> </modules> <global> @@ -57,6 +57,14 @@ </salesrule> </observers> </sales_quote_config_get_product_attributes> + <sales_convert_quote_to_order> + <observers> + <salesrule> + <class>Mage_SalesRule_Model_Observer</class> + <method>addSalesRuleNameToOrder</method> + </salesrule> + </observers> + </sales_convert_quote_to_order> </events> <sales> <quote> @@ -80,6 +88,16 @@ </nominal_totals> </quote> </sales> + <salesrule> + <coupon> + <separator>-</separator> + <charset> + <alphanum>ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789</alphanum> + <alpha>ABCDEFGHIJKLMNOPQRSTUVWXYZ</alpha> + <num>0123456789</num> + </charset> + </coupon> + </salesrule> </global> <adminhtml> <translate> @@ -133,4 +151,12 @@ </aggregate_sales_report_coupons_data> </jobs> </crontab> + <default> + <promo> + <auto_generated_coupon_codes> + <length>12</length> + <format>1</format> + </auto_generated_coupon_codes> + </promo> + </default> </config> diff --git a/app/code/core/Mage/SalesRule/etc/fieldset.xml b/app/code/core/Mage/SalesRule/etc/fieldset.xml index a54cf577136..b19dba9b6ed 100644 --- a/app/code/core/Mage/SalesRule/etc/fieldset.xml +++ b/app/code/core/Mage/SalesRule/etc/fieldset.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/etc/system.xml b/app/code/core/Mage/SalesRule/etc/system.xml new file mode 100644 index 00000000000..66fece631ce --- /dev/null +++ b/app/code/core/Mage/SalesRule/etc/system.xml @@ -0,0 +1,95 @@ +<?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_SalesRule + * @copyright 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> + <sections> + <promo translate="label" module="Mage_SalesRule"> + <class>separator-top</class> + <label>Promotions</label> + <tab>customer</tab> + <frontend_type>text</frontend_type> + <sort_order>400</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <groups> + <auto_generated_coupon_codes translate="label" module="Mage_SalesRule"> + <label>Auto Generated Specific Coupon Codes</label> + <show_in_default>1</show_in_default> + <sort_order>10</sort_order> + <fields> + <length translate="label comment" module="Mage_SalesRule"> + <label>Code Length</label> + <frontend_type>text</frontend_type> + <sort_order>10</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <comment>Excluding prefix, suffix and separators.</comment> + <frontend_class>validate-digits</frontend_class> + </length> + <format translate="label" module="Mage_SalesRule"> + <label>Code Format</label> + <frontend_type>select</frontend_type> + <source_model>Mage_SalesRule_Model_System_Config_Source_Coupon_Format</source_model> + <sort_order>20</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </format> + <prefix translate="label" module="Mage_SalesRule"> + <label>Code Prefix</label> + <frontend_type>text</frontend_type> + <sort_order>30</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </prefix> + <suffix translate="label" module="Mage_SalesRule"> + <label>Code Suffix</label> + <frontend_type>text</frontend_type> + <sort_order>40</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </suffix> + <dash translate="label comment" module="Mage_SalesRule"> + <label>Dash Every X Characters</label> + <frontend_type>text</frontend_type> + <sort_order>50</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <comment>If empty no separation.</comment> + <frontend_class>validate-digits</frontend_class> + </dash> + </fields> + </auto_generated_coupon_codes> + </groups> + </promo> + </sections> +</config> 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 2f9db98ab3d..0dbffcac702 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/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 50f7d6fbd8e..97c6591d559 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_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.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 new file mode 100644 index 00000000000..5cdbef60832 --- /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 @@ +<?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_SalesRule + * @copyright 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 + */ +$installer = $this; + +$installer->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'), + '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'), + 'uses_per_coupon', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, + 'comment' => 'Uses Per Coupon', + 'nullable' => false, + 'default' => 0 + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('coupon_aggregated'), + 'rule_name', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'length' => 255, + 'comment' => 'Rule Name', + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('coupon_aggregated_order'), + 'rule_name', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'length' => 255, + 'comment' => 'Rule Name', + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('coupon_aggregated_updated'), + 'rule_name', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'length' => 255, + 'comment' => 'Rule Name', + ) + ); + +$installer->getConnection() + ->addIndex( + $installer->getTable('coupon_aggregated'), + $installer->getIdxName( + '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('coupon_aggregated_order'), + $installer->getIdxName( + '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('coupon_aggregated_updated'), + $installer->getIdxName( + '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/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 00000000000..9e826d646d7 --- /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 @@ +<?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_SalesRule + * @copyright 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 */ +$installer = $this; +$connection = $installer->getConnection(); + +$rulesTable = $installer->getTable('salesrule'); +$websitesTable = $installer->getTable('core_website'); +$customerGroupsTable = $installer->getTable('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_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_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_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 2fe088fa7ad..a8d908a858d 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 0279d8a3abe..561982771a6 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/Observer.php b/app/code/core/Mage/Sendfriend/Model/Observer.php index b5cb158654f..736681654b4 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 168cd611f37..e7f6bed5486 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 d9dcbfd28c3..146a57cc9e8 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 001e7057e62..4028991a552 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 3e4e8ebae77..4629150383f 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 117f123a04e..cf94e0cca6d 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 5c4ef4966f8..4079adf7f77 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 2cdd22d5e6a..106c95a4f95 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 da01a360278..e1d9b1eb39b 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/view/frontend/layout.xml b/app/code/core/Mage/Sendfriend/view/frontend/layout.xml index c4c8f190576..9b065c4f3b3 100644 --- a/app/code/core/Mage/Sendfriend/view/frontend/layout.xml +++ b/app/code/core/Mage/Sendfriend/view/frontend/layout.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/code/core/Mage/Sendfriend/view/frontend/send.phtml b/app/code/core/Mage/Sendfriend/view/frontend/send.phtml index c567e203d43..f39e4635417 100644 --- a/app/code/core/Mage/Sendfriend/view/frontend/send.phtml +++ b/app/code/core/Mage/Sendfriend/view/frontend/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/code/core/Mage/Shipping/Block/Tracking/Ajax.php b/app/code/core/Mage/Shipping/Block/Tracking/Ajax.php index 80d900c8436..18340342fc1 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 88e4203c6c0..8417eb54a62 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 737caa97f36..cc7911275f5 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 9c953575de4..d6b341edeba 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 bd330558bed..9b137bf8191 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php @@ -20,17 +20,41 @@ * * @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) */ 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 * @@ -250,7 +274,7 @@ abstract class Mage_Shipping_Model_Carrier_Abstract extends Varien_Object * @param Mage_Shipping_Model_Rate_Request $request * @return Mage_Shipping_Model_Carrier_Abstract|Mage_Shipping_Model_Rate_Result_Error|boolean */ - public function processAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) + public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) { return $this; } @@ -316,7 +340,7 @@ abstract class Mage_Shipping_Model_Carrier_Abstract extends Varien_Object return; } - $freeMethod = $this->getConfigData('free_method'); + $freeMethod = $this->getConfigData($this->_freeMethod); if (!$freeMethod) { return; } @@ -378,9 +402,9 @@ abstract class Mage_Shipping_Model_Carrier_Abstract extends Varien_Object */ 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 @@ abstract class Mage_Shipping_Model_Carrier_Abstract extends Varien_Object /** * 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 @@ abstract class Mage_Shipping_Model_Carrier_Abstract extends Varien_Object $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/Flatrate.php b/app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php index d352a66322a..592a28f83e6 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 7ebb652e168..db8b6b7e70e 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) */ @@ -53,14 +53,12 @@ class Mage_Shipping_Model_Carrier_Freeshipping } $result = Mage::getModel('Mage_Shipping_Model_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('Mage_Shipping_Model_Rate_Result_Method'); $method->setCarrier('freeshipping'); @@ -108,4 +106,4 @@ class Mage_Shipping_Model_Carrier_Freeshipping return array('freeshipping'=>$this->getConfigData('name')); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Interface.php b/app/code/core/Mage/Shipping/Model/Carrier/Interface.php index 9bc201dac32..b6edd0c5f6c 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 bb5d4348882..f68881587b4 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 b7105d183ee..78632ab2773 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 f724d731ec5..ee9f5558146 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 9a1a24ef11b..e93939c35ce 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/Rate/Abstract.php b/app/code/core/Mage/Shipping/Model/Rate/Abstract.php index 38e7aeb8288..e72f4ebec5d 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 7990f862e3a..adb127a90f2 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 fc6d23394c9..25615659060 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Result.php +++ b/app/code/core/Mage/Shipping/Model/Rate/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/Rate/Result/Abstract.php b/app/code/core/Mage/Shipping/Model/Rate/Result/Abstract.php index 91975e7c51c..6d7a4698a79 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 aa3e1590267..bda6751f91e 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 9f2e4549707..1342150cc4d 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 aa77d645374..99495a4a955 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,8 +267,7 @@ class Mage_Shipping_Model_Resource_Carrier_Tablerate extends Mage_Core_Model_Res $adapter->commit(); if ($this->_importErrors) { - $error = Mage::helper('Mage_Shipping_Helper_Data')->__('%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('Mage_Shipping_Helper_Data')->__('%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 @@ class Mage_Shipping_Model_Resource_Carrier_Tablerate extends Mage_Core_Model_Res { // validate row if (count($row) < 5) { - $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Table Rates format in the Row #%s', - $rowNumber); + $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Table Rates format in the Row #%s', $rowNumber); return false; } @@ -367,8 +365,7 @@ class Mage_Shipping_Model_Resource_Carrier_Tablerate extends Mage_Core_Model_Res } elseif ($row[0] == '*' || $row[0] == '') { $countryId = '0'; } else { - $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Country "%s" in the Row #%s.', - $row[0], $rowNumber); + $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Country "%s" in the Row #%s.', $row[0], $rowNumber); return false; } @@ -378,8 +375,7 @@ class Mage_Shipping_Model_Resource_Carrier_Tablerate extends Mage_Core_Model_Res } elseif ($row[1] == '*' || $row[1] == '') { $regionId = 0; } else { - $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Region/State "%s" in the Row #%s.', - $row[1], $rowNumber); + $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Region/State "%s" in the Row #%s.', $row[1], $rowNumber); return false; } @@ -393,24 +389,21 @@ class Mage_Shipping_Model_Resource_Carrier_Tablerate extends Mage_Core_Model_Res // validate condition value $value = $this->_parseDecimalValue($row[3]); if ($value === false) { - $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid %s "%s" in the Row #%s.', - $this->_getConditionFullName($this->_importConditionName), $row[3], $rowNumber); + $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('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('Mage_Shipping_Helper_Data')->__('Invalid Shipping Price "%s" in the Row #%s.', - $row[4], $rowNumber); + $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('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('Mage_Shipping_Helper_Data')->__('Duplicate Row #%s (Country "%s", Region/State "%s", Zip "%s" and Value "%s").', - $rowNumber, $row[0], $row[1], $zipCode, $value); + $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('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/Resource/Carrier/Tablerate/Collection.php b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate/Collection.php index e1396d28422..afb8bcfaf5d 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 5856f3f2c6d..fbed26528c2 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 f57ef82882b..620b4ba6f1c 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 d1f01df7b88..1bb9cb41182 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) */ @@ -161,7 +161,7 @@ class Mage_Shipping_Model_Shipping $carrier->setActiveFlag($this->_availabilityConfigField); $result = $carrier->checkAvailableShipCountries($request); if (false !== $result && !($result instanceof Mage_Shipping_Model_Rate_Result_Error)) { - $result = $carrier->processAdditionalValidation($request); + $result = $carrier->proccessAdditionalValidation($request); } /* * Result will be false if the admin set not to show the shipping module @@ -212,6 +212,8 @@ class Mage_Shipping_Model_Shipping $request->setPackageCurrency(Mage::app()->getStore()->getCurrentCurrency()); $request->setLimitCarrier($limitCarrier); + $request->setBaseSubtotalInclTax($address->getBaseSubtotalInclTax()); + return $this->collectRates($request); } diff --git a/app/code/core/Mage/Shipping/Model/Source/HandlingAction.php b/app/code/core/Mage/Shipping/Model/Source/HandlingAction.php index d3085e91e87..5ab32a772e7 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 40d1f8e2681..69f7e974914 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 188d1bc4584..507351ea571 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 b1e79fa1d6c..6b6f0f73509 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 9adfafd5909..65b4a23fd91 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 21e1765afb6..818312c5a09 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/TrackingController.php b/app/code/core/Mage/Shipping/controllers/TrackingController.php index 756c5b8d2d8..72543193cf7 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 0dce18fbf0c..986961e6b33 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 a3182459d27..546a92ed2ce 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 a20c50d8d35..a0436182896 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) */ --> 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 5c09811e428..c9ee0b9b2f6 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/view/frontend/layout.xml b/app/code/core/Mage/Shipping/view/frontend/layout.xml index 03ccdbc426d..7f3fb1c04c5 100644 --- a/app/code/core/Mage/Shipping/view/frontend/layout.xml +++ b/app/code/core/Mage/Shipping/view/frontend/layout.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/code/core/Mage/Shipping/view/frontend/tracking/ajax.phtml b/app/code/core/Mage/Shipping/view/frontend/tracking/ajax.phtml index 91c289cf651..c29c61e5d49 100644 --- a/app/code/core/Mage/Shipping/view/frontend/tracking/ajax.phtml +++ b/app/code/core/Mage/Shipping/view/frontend/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/code/core/Mage/Shipping/view/frontend/tracking/popup.phtml b/app/code/core/Mage/Shipping/view/frontend/tracking/popup.phtml index 5b350dcc74a..0337d5842fc 100644 --- a/app/code/core/Mage/Shipping/view/frontend/tracking/popup.phtml +++ b/app/code/core/Mage/Shipping/view/frontend/tracking/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) */ /* @var $this Mage_Shipping_Block_Tracking_Popup */ diff --git a/app/code/core/Mage/Sitemap/Helper/Data.php b/app/code/core/Mage/Sitemap/Helper/Data.php index 1cf500a0e03..7c26c17dd51 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/Observer.php b/app/code/core/Mage/Sitemap/Model/Observer.php index d6ffbc3064c..0f5d8667bcc 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 21b4a6f231e..5b3622fbf42 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 14694816ff5..0c807aed9c2 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 0a17c267697..bb28d20a5d3 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 429df129f88..12d7de7243b 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 bff8844bd84..f36d8c86047 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 5fadb692baf..67d0f290cbd 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 34676a7ba13..5ac192cfe97 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 5c986ff1072..d3c026ea184 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 812154dd37d..a5458c6330c 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 f4a6d8df8e6..0ec99a73ae5 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/Tag/Block/All.php b/app/code/core/Mage/Tag/Block/All.php index 4f383caccbc..4b152a44e41 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/Recent.php b/app/code/core/Mage/Tag/Block/Customer/Recent.php index f7f6abd63ec..88b500b72da 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 1dc291c79c9..b157895527d 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 8c0a0f42bfa..4d8e05a5e4b 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 34d6f1077da..41406ec0a6a 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 07a2b35538d..f39782e2c72 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 c844e15b917..4d312b651de 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 2a67a1d27b4..8d3fb07758b 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 a1dd897bc82..1551e9cd117 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 ad49b883a02..ca37fe380a3 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 14ce99bb45b..e4e3f3c4cd9 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 6dfefe6d2fa..e821234abe0 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/Resource/Customer/Collection.php b/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php index efc689d1bde..28956b76a4f 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 90fab39f0a2..d87cc4d896f 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) */ @@ -195,7 +195,8 @@ class Mage_Tag_Model_Resource_Indexer_Summary extends Mage_Catalog_Model_Resourc ->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); @@ -236,7 +237,8 @@ class Mage_Tag_Model_Resource_Indexer_Summary extends Mage_Catalog_Model_Resourc $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); @@ -253,4 +255,4 @@ class Mage_Tag_Model_Resource_Indexer_Summary extends Mage_Catalog_Model_Resourc return $this; } -} +} \ No newline at end of file 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 f56057744a9..6385f3b8c15 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 ae7950df3c5..3c477f16135 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 4fcfddcbade..c2b53563f97 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) */ @@ -191,4 +191,4 @@ class Mage_Tag_Model_Resource_Tag extends Mage_Core_Model_Resource_Db_Abstract return $this; } -} +} \ No newline at end of file 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 fa61eb84210..368d4cdf63b 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 357f3cf432f..ae46f73d4ec 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 @@ class Mage_Tag_Model_Resource_Tag_Relation extends Mage_Core_Model_Resource_Db_A $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 @@ class Mage_Tag_Model_Resource_Tag_Relation extends Mage_Core_Model_Resource_Db_A $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 6ba1055208e..c92a58eac31 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 8958a3930a9..a1b913768ad 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 60cb62e20b9..db2a01d5cc6 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 64d035748f7..ef2d023bb81 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 b8753878388..346480a9a40 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) */ @@ -112,11 +112,9 @@ class Mage_Tag_IndexController extends Mage_Core_Controller_Front_Action */ protected function _cleanTags(array $tagNamesArr) { - $helper = Mage::helper('Mage_Core_Helper_Data'); 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 @@ class Mage_Tag_IndexController extends Mage_Core_Controller_Front_Action protected function _fillMessageBox($counter) { $session = Mage::getSingleton('Mage_Catalog_Model_Session'); + $helper = Mage::helper('Mage_Core_Helper_Data'); 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/controllers/ListController.php b/app/code/core/Mage/Tag/controllers/ListController.php index cc7d4dbd247..6f1fa893273 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 caf9a6beeeb..aab8edca783 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 3a0cb442620..49a587f6b31 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 cbf3091829b..adfedee017b 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 23516b2081a..d7459a4153f 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/etc/view.xml b/app/code/core/Mage/Tag/etc/view.xml index 4c259e71b13..31285a67944 100644 --- a/app/code/core/Mage/Tag/etc/view.xml +++ b/app/code/core/Mage/Tag/etc/view.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 478fc963b7e..8a2f6a19e18 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/view/frontend/cloud.phtml b/app/code/core/Mage/Tag/view/frontend/cloud.phtml index 03d2d482252..c178279fef9 100644 --- a/app/code/core/Mage/Tag/view/frontend/cloud.phtml +++ b/app/code/core/Mage/Tag/view/frontend/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/code/core/Mage/Tag/view/frontend/customer/recent.phtml b/app/code/core/Mage/Tag/view/frontend/customer/recent.phtml index 4c522d3b22e..015d5fb6826 100644 --- a/app/code/core/Mage/Tag/view/frontend/customer/recent.phtml +++ b/app/code/core/Mage/Tag/view/frontend/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/code/core/Mage/Tag/view/frontend/customer/tags.phtml b/app/code/core/Mage/Tag/view/frontend/customer/tags.phtml index 8237feabe42..1ef70eaa011 100644 --- a/app/code/core/Mage/Tag/view/frontend/customer/tags.phtml +++ b/app/code/core/Mage/Tag/view/frontend/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/code/core/Mage/Tag/view/frontend/customer/view.phtml b/app/code/core/Mage/Tag/view/frontend/customer/view.phtml index 4f23a533c8c..4a3f89f26e2 100644 --- a/app/code/core/Mage/Tag/view/frontend/customer/view.phtml +++ b/app/code/core/Mage/Tag/view/frontend/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/code/core/Mage/Tag/view/frontend/layout.xml b/app/code/core/Mage/Tag/view/frontend/layout.xml index 8ddb5e18b09..7756237437f 100644 --- a/app/code/core/Mage/Tag/view/frontend/layout.xml +++ b/app/code/core/Mage/Tag/view/frontend/layout.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/code/core/Mage/Tag/view/frontend/list.phtml b/app/code/core/Mage/Tag/view/frontend/list.phtml index 3a30733d0b4..735ed049816 100644 --- a/app/code/core/Mage/Tag/view/frontend/list.phtml +++ b/app/code/core/Mage/Tag/view/frontend/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/code/core/Mage/Tag/view/frontend/popular.phtml b/app/code/core/Mage/Tag/view/frontend/popular.phtml index 3cb39aa9f54..746d1b9360f 100644 --- a/app/code/core/Mage/Tag/view/frontend/popular.phtml +++ b/app/code/core/Mage/Tag/view/frontend/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/code/core/Mage/Tax/Block/Adminhtml/Frontend/Region/Updater.php b/app/code/core/Mage/Tax/Block/Adminhtml/Frontend/Region/Updater.php index afcf4b339d4..a7983cff74f 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 2e63200d5bd..37ed20ce4b8 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 ba6fa305f40..54bf7737986 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 1934f47f1ee..9fb37a1cae1 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 a99cae737ef..85848646bec 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 a500d4f7361..b4a522918de 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 47787dcb75a..0f9904d8bee 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 572fc887060..eb77e3bc907 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 74f3ca2c93e..82e3554ef34 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 c871d3cce68..bdc78ae5000 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) */ @@ -70,7 +70,7 @@ class Mage_Tax_Model_Calculation extends Mage_Core_Model_Abstract public function getDefaultCustomerTaxClass($store = null) { if ($this->_defaultCustomerTaxClass === null) { - $defaultCustomerGroup = Mage::getStoreConfig(Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, $store); + $defaultCustomerGroup = Mage::helper('Mage_Customer_Helper_Data')->getDefaultCustomerGroupId($store); $this->_defaultCustomerTaxClass = Mage::getModel('Mage_Customer_Model_Group')->getTaxClassId($defaultCustomerGroup); } return $this->_defaultCustomerTaxClass; diff --git a/app/code/core/Mage/Tax/Model/Calculation/Rate.php b/app/code/core/Mage/Tax/Model/Calculation/Rate.php index 32e1bfdc83f..05ed6858634 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 7c0aaae7abc..61c58a9e31f 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 9bcca6061f7..954b110ac1d 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 73718a21933..eeec001561f 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 6683287a11c..376ac1e34be 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 63b212e1000..8d50c0f4605 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 e6077aea3f3..4f9bc3f0a9d 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 e0258d81ca2..06cd76fb860 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/Observer.php b/app/code/core/Mage/Tax/Model/Observer.php index 3af17041e08..d4adc8d57d7 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 af065a62a98..16e247f3c01 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 0fa81571ac6..dde6923333e 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 ee9f61561d6..d70a0a679f0 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 f9d8e6d51f9..f152ab1fd24 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 9e28326275d..35f94cc13b4 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 0ed9524fb60..65125167aad 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 b2b76c144ce..42f4c5038af 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 e05280bff13..8f02fc839f4 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 07b07d10266..6a41cfd8d52 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 b0aa1440d58..5aa408ad414 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 e7a6e173893..00a19399e24 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 62bfc2bc3af..81568a967ae 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 1f89fb45b0a..1cd5e3f2d04 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 ac753906f55..1baa178a6a8 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 4c4222b8c76..ec1ed8c95d2 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 170e6719126..1fdf12be951 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 6a60d5c9e32..95efc86407e 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 ce15e61fda3..a2b4546f7f9 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 801e763b8ab..dee0dc61bfc 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 adeeb61fe80..c1cf9d3e675 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 cf0b6f1f9b5..267828884cd 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 f75b34fd42c..3dfd563db16 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 8ab698a5065..dbb98749dc5 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 3d132608573..80d455c180d 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 7e925b39ae6..ceb7eafca58 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 6a3c6a4ddcb..405ceeeb5ae 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 efd0f292187..7cdbb337b87 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 94c946bf63f..3618738003d 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 db346692e01..d33cadb96e3 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 6716d775d7f..d7d11480c87 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 a9a8fea1064..6ddb12bb966 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) */ @@ -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(); /** @@ -81,7 +91,7 @@ class Mage_Tax_Model_Sales_Total_Quote_Subtotal extends Mage_Sales_Model_Quote_A /** * 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 @@ -588,10 +598,10 @@ class Mage_Tax_Model_Sales_Total_Quote_Subtotal extends Mage_Sales_Model_Quote_A 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 12da51766aa..cd70c72b4ab 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) */ @@ -695,12 +695,12 @@ class Mage_Tax_Model_Sales_Total_Quote_Tax extends Mage_Sales_Model_Quote_Addres 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/Tax/Model/System/Config/Source/Algorithm.php b/app/code/core/Mage/Tax/Model/System/Config/Source/Algorithm.php index ff2006e6416..05295c45ab4 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 5c28dd2c747..ebed5ea1d8f 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 6100357e50e..c94db95f533 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 b287543ad17..a7d8e961ac1 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 a39fa0ffcd3..fca4db70e64 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 821f4af92e0..e34a0eb1359 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 9a35e17597c..f07f6c3dfd7 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 3be5e71d768..a97a637ce67 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 495ca2ece0e..c176a9d91f6 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) */ --> diff --git a/app/code/core/Mage/Tax/etc/fieldset.xml b/app/code/core/Mage/Tax/etc/fieldset.xml index f46bb2bc08a..1d7ee3b7af7 100644 --- a/app/code/core/Mage/Tax/etc/fieldset.xml +++ b/app/code/core/Mage/Tax/etc/fieldset.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/system.xml b/app/code/core/Mage/Tax/etc/system.xml index 753ac60c998..df7c16b1299 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) */ --> 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 31da460377f..caef882ee4a 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/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 016f7666fea..df2a275c0fd 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_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.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 27fa5d4a539..e9850be20ed 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 eae59d1f9eb..40a2745f1db 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/Tax/view/frontend/checkout/discount.phtml b/app/code/core/Mage/Tax/view/frontend/checkout/discount.phtml index 26a415a950f..964a3fa117b 100644 --- a/app/code/core/Mage/Tax/view/frontend/checkout/discount.phtml +++ b/app/code/core/Mage/Tax/view/frontend/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/code/core/Mage/Tax/view/frontend/checkout/grandtotal.phtml b/app/code/core/Mage/Tax/view/frontend/checkout/grandtotal.phtml index f3d0ffae7ee..2f835d33de1 100644 --- a/app/code/core/Mage/Tax/view/frontend/checkout/grandtotal.phtml +++ b/app/code/core/Mage/Tax/view/frontend/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/code/core/Mage/Tax/view/frontend/checkout/shipping.phtml b/app/code/core/Mage/Tax/view/frontend/checkout/shipping.phtml index 694c434a77c..7df994d508c 100644 --- a/app/code/core/Mage/Tax/view/frontend/checkout/shipping.phtml +++ b/app/code/core/Mage/Tax/view/frontend/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) */ /** diff --git a/app/code/core/Mage/Tax/view/frontend/checkout/subtotal.phtml b/app/code/core/Mage/Tax/view/frontend/checkout/subtotal.phtml index 4319e5cb372..2949899c886 100644 --- a/app/code/core/Mage/Tax/view/frontend/checkout/subtotal.phtml +++ b/app/code/core/Mage/Tax/view/frontend/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/code/core/Mage/Tax/view/frontend/checkout/tax.phtml b/app/code/core/Mage/Tax/view/frontend/checkout/tax.phtml index 1ca2b6fced5..2a757fcd296 100644 --- a/app/code/core/Mage/Tax/view/frontend/checkout/tax.phtml +++ b/app/code/core/Mage/Tax/view/frontend/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) */ /** diff --git a/app/code/core/Mage/Tax/view/frontend/order/tax.phtml b/app/code/core/Mage/Tax/view/frontend/order/tax.phtml index f1fabf347ea..8aa6562581c 100644 --- a/app/code/core/Mage/Tax/view/frontend/order/tax.phtml +++ b/app/code/core/Mage/Tax/view/frontend/order/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) */ ?> 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 00000000000..1766570c89f --- /dev/null +++ b/app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php @@ -0,0 +1,82 @@ +<?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_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) + */ + +/** + * Frontend model for DHL shipping methods for documentation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Usa_Model_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('Mage_Usa_Helper_Data')->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('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/Helper/Data.php b/app/code/core/Mage/Usa/Helper/Data.php index 1b66194c1c4..88180689298 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 7d434e97f73..a6da8c6ee1a 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) */ @@ -144,7 +144,7 @@ abstract class Mage_Usa_Model_Shipping_Carrier_Abstract extends Mage_Shipping_Mo * @param Mage_Shipping_Model_Rate_Request $request * @return Mage_Shipping_Model_Carrier_Abstract|Mage_Shipping_Model_Rate_Result_Error|boolean */ - public function processAdditionalValidation(Mage_Shipping_Model_Rate_Request $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))) { @@ -159,7 +159,7 @@ abstract class Mage_Usa_Model_Shipping_Carrier_Abstract extends Mage_Shipping_Mo foreach ($this->getAllItems($request) as $item) { if ($item->getProduct() && $item->getProduct()->getId()) { - if ($item->getProduct()->getWeight() > $maxAllowedWeight) { + if ($item->getProduct()->getWeight() * $item->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 d59e1b0fdc7..fcc410634c4 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) */ @@ -383,6 +383,8 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl $r->setPackageId($request->getPackageId()); } + $r->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + $this->_rawRequest = $r; return $this; } @@ -798,8 +800,7 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl $code = (string)$xml->Faults->Fault->Code; $description = $xml->Faults->Fault->Description; $context = $xml->Faults->Fault->Context; - $this->_errors[$code] = Mage::helper('Mage_Usa_Helper_Data')->__('Error #%s : %s (%s)', $code, $description, - $context); + $this->_errors[$code] = Mage::helper('Mage_Usa_Helper_Data')->__('Error #%s : %s (%s)', $code, $description, $context); } else { if ($r->getDestCountryId() == self::USA_COUNTRY_ID) { if ($xml->Shipment) { @@ -1198,15 +1199,9 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl } else { $description = (string)$txml->Result->Desc; if ($description) - $errorArr[$tracknum] = Mage::helper('Mage_Usa_Helper_Data')->__( - 'Error #%s: %s', - $code, - $description - ); + $errorArr[$tracknum] = Mage::helper('Mage_Usa_Helper_Data')->__('Error #%s: %s', $code, $description); else - $errorArr[$tracknum] = Mage::helper('Mage_Usa_Helper_Data')->__( - 'Unable to retrieve tracking' - ); + $errorArr[$tracknum] = Mage::helper('Mage_Usa_Helper_Data')->__('Unable to retrieve tracking'); } } else { $errorArr[$tracknum] = Mage::helper('Mage_Usa_Helper_Data')->__('Unable to retrieve tracking'); @@ -1371,6 +1366,8 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl $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 00000000000..56f60bb1731 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php @@ -0,0 +1,1646 @@ +<?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_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) + */ + +/** + * DHL International (API v1.4) + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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'; + + /** + * Minimum allowed values for shipping package dimensions + */ + const DIMENSION_MIN_CM = 3; + const DIMENSION_MIN_IN = 1; + + /** + * 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; + + /** + * Flag if response is for shipping label creating + * + * @var bool + */ + protected $_isShippingLabelFlag = false; + + /** + * 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('Mage_Core_Helper_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('Mage_Directory_Model_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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('Pounds'), + 'K' => Mage::helper('Mage_Usa_Helper_Data')->__('Kilograms'), + ), + 'unit_of_dimension' => array( + 'I' => Mage::helper('Mage_Usa_Helper_Data')->__('Inches'), + 'C' => Mage::helper('Mage_Usa_Helper_Data')->__('Centimeters'), + ), + 'unit_of_dimension_cut' => array( + 'I' => Mage::helper('Mage_Usa_Helper_Data')->__('inch'), + 'C' => Mage::helper('Mage_Usa_Helper_Data')->__('cm'), + ), + 'dimensions' => array( + 'HEIGHT' => Mage::helper('Mage_Usa_Helper_Data')->__('Height'), + 'DEPTH' => Mage::helper('Mage_Usa_Helper_Data')->__('Depth'), + 'WIDTH' => Mage::helper('Mage_Usa_Helper_Data')->__('Width'), + ), + 'size' => array( + '0' => Mage::helper('Mage_Usa_Helper_Data')->__('Regular'), + '1' => Mage::helper('Mage_Usa_Helper_Data')->__('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]; + } + + $code = strtoupper($code); + 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('Mage_Usa_Helper_Data')->__('Easy shop'), + '5' => Mage::helper('Mage_Usa_Helper_Data')->__('Sprintline'), + '6' => Mage::helper('Mage_Usa_Helper_Data')->__('Secureline'), + '7' => Mage::helper('Mage_Usa_Helper_Data')->__('Express easy'), + '9' => Mage::helper('Mage_Usa_Helper_Data')->__('Europack'), + 'B' => Mage::helper('Mage_Usa_Helper_Data')->__('Break bulk express'), + 'C' => Mage::helper('Mage_Usa_Helper_Data')->__('Medical express'), + 'D' => Mage::helper('Mage_Usa_Helper_Data')->__('Express worldwide'), // product content code: DOX + 'U' => Mage::helper('Mage_Usa_Helper_Data')->__('Express worldwide'), // product content code: ECX + 'K' => Mage::helper('Mage_Usa_Helper_Data')->__('Express 9:00'), + 'L' => Mage::helper('Mage_Usa_Helper_Data')->__('Express 10:30'), + 'G' => Mage::helper('Mage_Usa_Helper_Data')->__('Domestic economy select'), + 'W' => Mage::helper('Mage_Usa_Helper_Data')->__('Economy select'), + 'I' => Mage::helper('Mage_Usa_Helper_Data')->__('Break bulk economy'), + 'N' => Mage::helper('Mage_Usa_Helper_Data')->__('Domestic express'), + 'O' => Mage::helper('Mage_Usa_Helper_Data')->__('Others'), + 'R' => Mage::helper('Mage_Usa_Helper_Data')->__('Globalmail business'), + 'S' => Mage::helper('Mage_Usa_Helper_Data')->__('Same day'), + 'T' => Mage::helper('Mage_Usa_Helper_Data')->__('Express 12:00'), + 'X' => Mage::helper('Mage_Usa_Helper_Data')->__('Express envelope'), + ); + } else { + // Services for shipping non-documents cargo + return array( + '1' => Mage::helper('Mage_Usa_Helper_Data')->__('Customer services'), + '3' => Mage::helper('Mage_Usa_Helper_Data')->__('Easy shop'), + '4' => Mage::helper('Mage_Usa_Helper_Data')->__('Jetline'), + '8' => Mage::helper('Mage_Usa_Helper_Data')->__('Express easy'), + 'P' => Mage::helper('Mage_Usa_Helper_Data')->__('Express worldwide'), + 'Q' => Mage::helper('Mage_Usa_Helper_Data')->__('Medical express'), + 'E' => Mage::helper('Mage_Usa_Helper_Data')->__('Express 9:00'), + 'F' => Mage::helper('Mage_Usa_Helper_Data')->__('Freight worldwide'), + 'H' => Mage::helper('Mage_Usa_Helper_Data')->__('Economy select'), + 'J' => Mage::helper('Mage_Usa_Helper_Data')->__('Jumbo box'), + 'M' => Mage::helper('Mage_Usa_Helper_Data')->__('Express 10:30'), + 'V' => Mage::helper('Mage_Usa_Helper_Data')->__('Europack'), + 'Y' => Mage::helper('Mage_Usa_Helper_Data')->__('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 + * @param string|bool $configWeightUnit + * @return float + */ + 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', (string)$this->getConfigData('unit_of_measure')); + } + + $countryWeightUnit = $this->getCode('dimensions_variables', $this->_getWeightUnit()); + + if ($configWeightUnit != $countryWeightUnit) { + $weight = Mage::helper('Mage_Usa_Helper_Data')->convertMeasureWeight( + round($weight,3), + $configWeightUnit, + $countryWeightUnit + ); + } + + 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 + * @param string|bool $configWeightUnit + * @return float + */ + protected function _getDimension($dimension, $configWeightUnit = false) + { + 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) { + $configDimensionUnit = Zend_Measure_Length::INCH; + } else { + $configDimensionUnit = Zend_Measure_Length::CENTIMETER; + } + + $countryDimensionUnit = $this->getCode('dimensions_variables', $this->_getDimensionUnit()); + + if ($configDimensionUnit != $countryDimensionUnit) { + $dimension = Mage::helper('Mage_Usa_Helper_Data')->convertMeasureDimension( + round($dimension, 3), + $configDimensionUnit, + $countryDimensionUnit + ); + } + + 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 version = "1.0" encoding = "UTF-8"?>' + . '<p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" ' + . 'xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" ' + . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' + . 'xsi:schemaLocation="http://www.dhl.com DCT-req.xsd "/>'; + $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', sprintf("%.2F", $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); + + $responseError = Mage::helper('Mage_Usa_Helper_Data')->__('The response is in wrong format.'); + + if (strlen(trim($response)) > 0) { + if (strpos(trim($response), '<?xml') === 0) { + $xml = simplexml_load_string($response); + if (is_object($xml)) { + 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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('Error #%s : %s', trim($code), trim($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); + try { + /* @var $pdf Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf */ + $pdf = Mage::getModel('Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf', array('info' => $xml)); + $result->setShippingLabelContent($pdf->render()); + } catch (Exception $e) { + Mage::throwException(Mage::helper('Mage_Usa_Helper_Data')->__($e->getMessage())); + } + return $result; + } else { + $this->_errors[] = $responseError; + } + } + } + } else { + $this->_errors[] = $responseError; + } + } else { + $this->_errors[] = $responseError; + } + + /* @var $result Mage_Shipping_Model_Rate_Result */ + $result = Mage::getModel('Mage_Shipping_Model_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('Mage_Shipping_Model_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)) { + if ($this->_isShippingLabelFlag) { + Mage::throwException($responseError); + } + 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('Mage_Directory_Model_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('Mage_Usa_Helper_Data')->__("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('Mage_Usa_Helper_Data')->__("Zero shipping charge for '%s'", $dhlProductDescription); + } + } else { + $dhlProductDescription = false; + if (isset($shipmentDetails->GlobalProductCode)) { + $dhlProductDescription = $this->getDhlProductTitle((string)$shipmentDetails->GlobalProductCode); + } + $dhlProductDescription = $dhlProductDescription ? $dhlProductDescription : Mage::helper('Mage_Usa_Helper_Data')->__("DHL"); + $this->_errors[] = Mage::helper('Mage_Usa_Helper_Data')->__("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('Mage_Usa_Helper_Data')->__("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('Mage_Usa_Helper_Data')->__("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('Mage_Usa_Helper_Data')->__('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('Mage_Shipping_Model_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('Mage_Usa_Helper_Data')->__('Documents'), + self::DHL_CONTENT_TYPE_NON_DOC => Mage::helper('Mage_Usa_Helper_Data')->__('Non Documents') + ); + } + + /** + * Map request to shipment + * + * @param Varien_Object $request + * @return null + */ + protected function _mapRequestToShipment(Varien_Object $request) + { + + $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('Mage_Usa_Helper_Data')->__('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 + * + * @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('Mage_Usa_Helper_Data')->__('Wrong Region.')); + } + + if ($originRegion == 'AM') { + $originRegion = ''; + } + + $xmlStr = '<?xml version="1.0" encoding="UTF-8"?>' + . '<req:ShipmentValidateRequest' . $originRegion + . ' xmlns:req="http://www.dhl.com"' + . ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' + . ' xsi:schemaLocation="http://www.dhl.com ship-val-req' + . ($originRegion ? '_' . $originRegion : '') . '.xsd" />'; + $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')); + + if (!$originRegion) { + $xml->addChild('RequestedPickupTime', 'N', ''); + } + $xml->addChild('NewShipper', 'N', ''); + $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('account')); + $nodeBilling->addChild('DutyPaymentType', 'S'); + $nodeBilling->addChild('DutyAccountNumber', (string)$this->getConfigData('account')); + + /* Receiver */ + $nodeConsignee = $xml->addChild('Consignee', '', ''); + + $companyName = ($rawRequest->getRecipientContactCompanyName()) + ? $rawRequest->getRecipientContactCompanyName() + : $rawRequest->getRecipientContactPersonName(); + + $nodeConsignee->addChild('CompanyName', substr($companyName, 0, 35)); + + $address = $rawRequest->getRecipientAddressStreet1(). ' ' . $rawRequest->getRecipientAddressStreet2(); + $address = Mage::helper('Mage_Core_Helper_String')->str_split($address, 35, false, true); + if (is_array($address)) { + foreach ($address as $addressLine) { + $nodeConsignee->addChild('AddressLine', $addressLine); + } + } 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', + sprintf("%.2F", $rawRequest->getOrderShipment()->getOrder()->getSubtotal()) + ); + $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 */ + $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', (string)$this->getConfigData('account')); + + $address = $rawRequest->getShipperAddressStreet1(). ' ' . $rawRequest->getShipperAddressStreet2(); + $address = Mage::helper('Mage_Core_Helper_String')->str_split($address, 35, false, true); + if (is_array($address)) { + foreach ($address as $addressLine) { + $nodeShipper->addChild('AddressLine', $addressLine); + } + } 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); + } + $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('Mage_Core_Model_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('Mage_Core_Model_Date')->date('Y-m-d')); + $nodeShipmentDetails->addChild('Contents', 'DHL Parcel TEST'); + } + } + + /** + * 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 version="1.0" encoding="UTF-8"?>' + . '<req:KnownTrackingRequest' + . ' xmlns:req="http://www.dhl.com"' + . ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' + . ' xsi:schemaLocation="http://www.dhl.com TrackingRequestKnown.xsd" />'; + + $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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Shipping_Model_Tracking_Result'); + + if (!empty($resultArr)) { + foreach ($resultArr as $trackNum => $data) { + $tracking = Mage::getModel('Mage_Shipping_Model_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('Mage_Shipping_Model_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; + } + + /** + * 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('Mage_Usa_Helper_Data')->__('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 new file mode 100644 index 00000000000..23361502745 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.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_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 Content Type + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Usa_Helper_Data')->__('Documents'), + 'value' => Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_DOC), + array('label' => Mage::helper('Mage_Usa_Helper_Data')->__('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/Method/Abstract.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php new file mode 100644 index 00000000000..0d86f6865e6 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php @@ -0,0 +1,72 @@ +<?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_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 + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Usa_Model_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('Mage_Usa_Helper_Data')->__('None'))); + } + + 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 00000000000..a3205c50e88 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Doc.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_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 + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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 00000000000..6e74cde1be0 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freedoc.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_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 + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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 00000000000..c824a26febb --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freenondoc.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_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 + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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 00000000000..a5c3a3ab60f --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Nondoc.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_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 + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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 00000000000..8f56483ee58 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php @@ -0,0 +1,51 @@ +<?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_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 + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Usa_Model_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 00000000000..5f061137b5c --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php @@ -0,0 +1,51 @@ +<?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_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 + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Usa_Model_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/Dhl/Label/Pdf.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php new file mode 100644 index 00000000000..f4582b44bc8 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php @@ -0,0 +1,104 @@ +<?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_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) + */ + +/** + * DHL International (API v1.4) Label Creation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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 00000000000..32b50f73452 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php @@ -0,0 +1,150 @@ +<?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_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) + */ + +/** + * DHL International (API v1.4) Label Creation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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('Mage_Core_Helper_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 00000000000..7662a81de50 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php @@ -0,0 +1,627 @@ +<?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_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) + */ + +/** + * DHL International (API v1.4) Label Creation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +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::getDesign()->getSkinFile('dhl/logo.jpg', array('_area' => 'adminhtml')) + ); + $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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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('Mage_Usa_Helper_Data')->__('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 75140ae602e..cf8f9e5b5eb 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 0b3318e55b1..19cae0cac33 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 809d2a410f9..b876ed0dc28 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 65b1e30c1c7..d4b4b49cf7e 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 348440080e7..8349aee73f4 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 80a05f4fa05..7965db516a0 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 e8bdd256e14..99bc8b480ae 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) */ @@ -261,6 +261,8 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex $r->setIsReturn($request->getIsReturn()); + $r->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + $this->_rawRequest = $r; return $this; @@ -316,7 +318,7 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex 'ShipTimestamp' => date('c'), 'PackagingType' => $r->getPackaging(), 'TotalInsuredValue' => array( - 'Ammount' => $r->getValue(), + 'Amount' => $r->getValue(), 'Currency' => $this->getCurrencyCode() ), 'Shipper' => array( @@ -339,6 +341,12 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex 'CountryCode' => $r->getOrigCountry() ) ), + 'CustomsClearanceDetail' => array( + 'CustomsValue' => array( + 'Amount' => $r->getValue(), + 'Currency' => $this->getCurrencyCode() + ) + ), 'RateRequestTypes' => 'LIST', 'PackageCount' => '1', 'PackageDetail' => 'INDIVIDUAL_PACKAGES', @@ -347,6 +355,10 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex 'Weight' => array( 'Value' => (float)$r->getWeight(), 'Units' => 'LB' + ), + 'InsuredValue' => array( + 'Amount' => $r->getValue(), + 'Currency' => $this->getCurrencyCode() ) ) ) @@ -395,8 +407,7 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex 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 +417,7 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex $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 +449,31 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex 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 * 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 19cb15596f1..7ee4c376b39 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,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/Source/Freemethod.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Freemethod.php index 5a42f5dd2ca..6860c22205b 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,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/Source/Method.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Method.php index c80e7b156ba..4ca22b6f0bb 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,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/Source/Packaging.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Packaging.php index ab07fb359ab..b672460f725 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,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.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php index ab1036ede77..9f24786511a 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) */ @@ -272,6 +272,8 @@ class Mage_Usa_Model_Shipping_Carrier_Ups $r->setIsReturn($request->getIsReturn()); + $r->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + $this->_rawRequest = $r; return $this; @@ -487,7 +489,7 @@ class Mage_Usa_Model_Shipping_Carrier_Ups /** * Get configuration data of carrier * - * @param strin $type + * @param string $type * @param string $code * @return array|bool */ @@ -1007,10 +1009,7 @@ XMLRequest; if (in_array($responseCurrencyCode, $allowedCurrencies)) { $cost = (float) $cost * $this->_getBaseCurrencyRate($responseCurrencyCode); } else { - $errorTitle = Mage::helper('Mage_Directory_Helper_Data') - ->__('Can\'t convert rate from "%s-%s".', - $responseCurrencyCode, - $this->_request->getPackageCurrency()->getCode()); + $errorTitle = Mage::helper('Mage_Directory_Helper_Data')->__('Can\'t convert rate from "%s-%s".', $responseCurrencyCode, $this->_request->getPackageCurrency()->getCode()); $error = Mage::getModel('Mage_Shipping_Model_Rate_Result_Error'); $error->setCarrier('ups'); $error->setCarrierTitle($this->getConfigData('title')); 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 e1cc23a1c55..52b36972f8b 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 e48d4977199..f2de3d7166f 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 dede1e0bb79..199e1d50c2c 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 4f2a8f475e9..34f502691bb 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/Mode.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php index b707b4c159e..0a2dafa7d39 100644 --- 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 @@ -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 e9beebd26fe..73af78681be 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 545ac4d51d3..07b68868c56 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 d1e9ebb1556..631b827a266 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 67f9250c47d..14e76e3e229 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 9cc187e2a2b..0c81e47668e 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) */ @@ -140,12 +140,12 @@ class Mage_Usa_Model_Shipping_Carrier_Usps * @param Mage_Shipping_Model_Rate_Request $request * @return Mage_Shipping_Model_Carrier_Abstract|Mage_Shipping_Model_Rate_Result_Error|boolean */ - public function processAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) + public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) { // zip code required for US $this->_isZipCodeRequired = $this->_isUSCountry($request->getDestCountryId()); - return parent::processAdditionalValidation($request); + return parent::proccessAdditionalValidation($request); } /** @@ -287,6 +287,8 @@ class Mage_Usa_Model_Shipping_Carrier_Usps $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/Model/Shipping/Carrier/Usps/Source/Container.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Container.php index 838567f73e5..ec9a002983c 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 3eae56ad3ac..7cce6e07a5b 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 b7d638a70e7..57a693f6517 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 9666d94604c..fc7c8d14ddc 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 6eac5d81cd6..d3643a31092 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 7d5a90b520c..06d27ed5420 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) */ --> @@ -54,6 +54,9 @@ <dhl> <class>Mage_Usa_Model_Shipping_Carrier_Dhl</class> </dhl> + <dhlint> + <class>Mage_Usa_Model_Shipping_Carrier_Dhl_International</class> + </dhlint> </carriers> </shipping> <tax> @@ -102,7 +105,7 @@ <shipment_type>P</shipment_type> <shipping_key backend_model="Mage_Adminhtml_Model_System_Config_Backend_Encrypted"/> <shipping_intlkey backend_model="Mage_Adminhtml_Model_System_Config_Backend_Encrypted"/> - <title>DHL</title> + <title>DHL (Deprecated)</title> <specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg> <max_package_weight>150</max_package_weight> <handling_type>F</handling_type> @@ -183,6 +186,25 @@ <handling_type>F</handling_type> <handling_action>O</handling_action> </usps> + <dhlint> + <model>Mage_Usa_Model_Shipping_Carrier_Dhl_International</model> + <account/> + <active>0</active> + <title>DHL</title> + <sallowspecific>0</sallowspecific> + <allowed_methods>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</allowed_methods> + <free_method>G</free_method> + <gateway_url>https://xmlpitest-ea.dhl.com/XMLShippingServlet</gateway_url> + <id backend_model="Mage_Adminhtml_Model_System_Config_Backend_Encrypted"/> + <password backend_model="Mage_Adminhtml_Model_System_Config_Backend_Encrypted"/> + <shipment_type>N</shipment_type> + <specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg> + <divide_order_weight>1</divide_order_weight> + <unit_of_measure>K</unit_of_measure> + <size>R</size> + <handling_type>F</handling_type> + <handling_action>O</handling_action> + </dhlint> </carriers> </default> </config> 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 00000000000..75854bca598 --- /dev/null +++ b/app/code/core/Mage/Usa/etc/dhl/international/countries.xml @@ -0,0 +1,1553 @@ +<?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_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<countries> + <AD> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Andorra</name> + </AD> + <AE> + <currency>AED</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>United Arab Emirates</name> + </AE> + <AF> + <currency>AFN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Afghanistan</name> + </AF> + <AG> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Antigua</name> + </AG> + <AI> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Anguilla</name> + </AI> + <AL> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Albania</name> + </AL> + <AM> + <currency>AMD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Armenia</name> + </AM> + <AN> + <currency>ANG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Netherlands Antilles</name> + </AN> + <AO> + <currency>AOA</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Angola</name> + </AO> + <AR> + <currency>ARS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Argentina</name> + </AR> + <AS> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <name>American Samoa</name> + </AS> + <AT> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Austria</name> + </AT> + <AU> + <currency>AUD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Australia</name> + </AU> + <AW> + <currency>AWG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Aruba</name> + </AW> + <AZ> + <currency>AZM</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Azerbaijan</name> + </AZ> + <BA> + <currency>BAM</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Bosnia and Herzegovina</name> + </BA> + <BB> + <currency>BBD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Barbados</name> + </BB> + <BD> + <currency>BDT</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Bangladesh</name> + </BD> + <BE> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Belgium</name> + </BE> + <BF> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Burkina Faso</name> + </BF> + <BG> + <currency>BGN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Bulgaria</name> + </BG> + <BH> + <currency>BHD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Bahrain</name> + </BH> + <BI> + <currency>BIF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Burundi</name> + </BI> + <BJ> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Benin</name> + </BJ> + <BM> + <currency>BMD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Bermuda</name> + </BM> + <BN> + <currency>BND</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Brunei</name> + </BN> + <BO> + <currency>BOB</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Bolivia</name> + </BO> + <BR> + <currency>BRL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Brazil</name> + </BR> + <BS> + <currency>BSD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Bahamas</name> + </BS> + <BT> + <currency>BTN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Bhutan</name> + </BT> + <BW> + <currency>BWP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Botswana</name> + </BW> + <BY> + <currency>BYR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Belarus</name> + </BY> + <BZ> + <currency>BZD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Belize</name> + </BZ> + <CA> + <currency>CAD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Canada</name> + </CA> + <CD> + <currency>CDF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Congo, The Democratic Republic of</name> + </CD> + <CF> + <currency>XAF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Central African Republic</name> + </CF> + <CG> + <currency>XAF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Congo</name> + </CG> + <CH> + <currency>CHF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Switzerland</name> + </CH> + <CI> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Cote d'Ivoire</name> + </CI> + <CK> + <currency>NZD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Cook Islands</name> + </CK> + <CL> + <currency>CLP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Chile</name> + </CL> + <CM> + <currency>XAF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Cameroon</name> + </CM> + <CN> + <currency>CNY</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>China, People's Republic</name> + </CN> + <CO> + <currency>COP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Colombia</name> + </CO> + <CR> + <currency>CRC</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Costa Rica</name> + </CR> + <CU> + <currency>CUP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Cuba</name> + </CU> + <CV> + <currency>CVE</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Cape Verde</name> + </CV> + <CY> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Cyprus</name> + </CY> + <CZ> + <currency>CZK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Czech Republic, The</name> + </CZ> + <DE> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Germany</name> + </DE> + <DJ> + <currency>DJF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Djibouti</name> + </DJ> + <DK> + <currency>DKK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Denmark</name> + </DK> + <DM> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Dominica</name> + </DM> + <DO> + <currency>DOP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Dominican Rep.</name> + </DO> + <DZ> + <currency>DZD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Algeria</name> + </DZ> + <EC> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Ecuador</name> + </EC> + <EE> + <currency>EEK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Estonia</name> + </EE> + <EG> + <currency>EGP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Egypt</name> + </EG> + <ER> + <currency>ERN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Eritrea</name> + </ER> + <ES> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Spain</name> + </ES> + <ET> + <currency>ETB</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Ethiopia</name> + </ET> + <FI> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Finland</name> + </FI> + <FJ> + <currency>FJD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Fiji</name> + </FJ> + <FK> + <currency>FKP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Falkland Islands</name> + </FK> + <FM> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <name>MICRONESIA, FEDERATED STATES OF</name> + </FM> + <FO> + <currency>DKK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Faroe Islands</name> + </FO> + <FR> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>France</name> + </FR> + <GA> + <currency>XAF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Gabon</name> + </GA> + <GB> + <currency>GBP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>United Kingdom</name> + </GB> + <GD> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Grenada</name> + </GD> + <GE> + <currency>GEL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Georgia</name> + </GE> + <GF> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>French Guyana</name> + </GF> + <GG> + <currency>GBP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Guernsey</name> + </GG> + <GH> + <currency>GHS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Ghana</name> + </GH> + <GI> + <currency>GIP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Gibraltar</name> + </GI> + <GL> + <currency>DKK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Greenland</name> + </GL> + <GM> + <currency>GMD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Gambia</name> + </GM> + <GN> + <currency>GNF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Guinea Republic</name> + </GN> + <GP> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Guadeloupe</name> + </GP> + <GQ> + <currency>XAF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Guinea-Equatorial</name> + </GQ> + <GR> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Greece</name> + </GR> + <GT> + <currency>GTQ</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Guatemala</name> + </GT> + <GU> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <region>AM</region> + <name>Guam</name> + </GU> + <GW> + <currency>GWP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Guinea-Bissau</name> + </GW> + <GY> + <currency>GYD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Guyana (British)</name> + </GY> + <HK> + <currency>HKD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Hong Kong</name> + </HK> + <HN> + <currency>HNL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Honduras</name> + </HN> + <HR> + <currency>HRK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Croatia</name> + </HR> + <HT> + <currency>HTG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Haiti</name> + </HT> + <HU> + <currency>HUF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Hungary</name> + </HU> + <IC> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Canary Islands, The</name> + </IC> + <ID> + <currency>IDR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Indonesia</name> + </ID> + <IE> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Ireland, Republic Of</name> + </IE> + <IL> + <currency>ILS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Israel</name> + </IL> + <IN> + <currency>INR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>India</name> + </IN> + <IQ> + <currency>IQD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Iraq</name> + </IQ> + <IR> + <currency>IRR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Iran (Islamic Republic of)</name> + </IR> + <IS> + <currency>ISK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Iceland</name> + </IS> + <IT> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Italy</name> + </IT> + <JE> + <currency>GBP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Jersey</name> + </JE> + <JM> + <currency>JMD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Jamaica</name> + </JM> + <JO> + <currency>JOD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Jordan</name> + </JO> + <JP> + <currency>JPY</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Japan</name> + </JP> + <KE> + <currency>KES</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Kenya</name> + </KE> + <KG> + <currency>KGS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Kyrgyzstan</name> + </KG> + <KH> + <currency>KHR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Cambodia</name> + </KH> + <KI> + <currency>AUD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Kiribati</name> + </KI> + <KM> + <currency>KMF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Comoros</name> + </KM> + <KN> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>St. Kitts</name> + </KN> + <KP> + <currency>KPW</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Korea, The D.P.R of</name> + </KP> + <KR> + <currency>KRW</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Korea, Republic Of</name> + </KR> + <KV> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Kosovo</name> + </KV> + <KW> + <currency>KWD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Kuwait</name> + </KW> + <KY> + <currency>KYD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Cayman Islands</name> + </KY> + <KZ> + <currency>KZT</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Kazakhstan</name> + </KZ> + <LA> + <currency>LAK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Lao People's Democratic Republic</name> + </LA> + <LB> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Lebanon</name> + </LB> + <LC> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>St. Lucia</name> + </LC> + <LI> + <currency>CHF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Liechtenstein</name> + </LI> + <LK> + <currency>LKR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Sri Lanka</name> + </LK> + <LR> + <currency>LRD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Liberia</name> + </LR> + <LS> + <currency>LSL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Lesotho</name> + </LS> + <LT> + <currency>LTL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Lithuania</name> + </LT> + <LU> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Luxembourg</name> + </LU> + <LV> + <currency>LVL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Latvia</name> + </LV> + <LY> + <currency>LYD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Libya</name> + </LY> + <MA> + <currency>MAD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Morocco</name> + </MA> + <MC> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Monaco</name> + </MC> + <MD> + <currency>MDL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Moldova, Republic Of</name> + </MD> + <ME> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Montenegro, Republic of</name> + </ME> + <MG> + <currency>MGA</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Madagascar</name> + </MG> + <MH> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <name>Marshall Islands</name> + </MH> + <MK> + <currency>MKD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Macedonia, Rep. of (FYROM)</name> + </MK> + <ML> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Mali</name> + </ML> + <MM> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Myanmar</name> + </MM> + <MN> + <currency>MNT</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Mongolia</name> + </MN> + <MO> + <currency>MOP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Macau</name> + </MO> + <MP> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <name>Saipan</name> + </MP> + <MQ> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Martinique</name> + </MQ> + <MR> + <currency>MRO</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Mauritania</name> + </MR> + <MS> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Montserrat</name> + </MS> + <MT> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Malta</name> + </MT> + <MU> + <currency>MUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Mauritius</name> + </MU> + <MV> + <currency>MVR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Maldives</name> + </MV> + <MW> + <currency>MWK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Malawi</name> + </MW> + <MX> + <currency>MXN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Mexico</name> + </MX> + <MY> + <currency>MYR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Malaysia</name> + </MY> + <MZ> + <currency>MZN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Mozambique</name> + </MZ> + <NA> + <currency>ZAR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Namibia</name> + </NA> + <NC> + <currency>XPF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>New Caledonia</name> + </NC> + <NE> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Niger</name> + </NE> + <NG> + <currency>NGN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Nigeria</name> + </NG> + <NI> + <currency>NIO</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Nicaragua</name> + </NI> + <NL> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Netherlands, The</name> + </NL> + <NO> + <currency>NOK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Norway</name> + </NO> + <NP> + <currency>NPR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Nepal</name> + </NP> + <NR> + <currency>AUD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Nauru, Republic Of</name> + </NR> + <NU> + <currency>NZD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Niue</name> + </NU> + <NZ> + <currency>NZD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>New Zealand</name> + </NZ> + <OM> + <currency>OMR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Oman</name> + </OM> + <PA> + <currency>PAB</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Panama</name> + </PA> + <PE> + <currency>PEN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Peru</name> + </PE> + <PF> + <currency>XPF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Tahiti</name> + </PF> + <PG> + <currency>PGK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Papua New Guinea</name> + </PG> + <PH> + <currency>PHP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Philippines, The</name> + </PH> + <PK> + <currency>PKR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Pakistan</name> + </PK> + <PL> + <currency>PLN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Poland</name> + </PL> + <PR> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <region>AM</region> + <name>Puerto Rico</name> + </PR> + <PT> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Portugal</name> + </PT> + <PW> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Palau</name> + </PW> + <PY> + <currency>PYG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Paraguay</name> + </PY> + <QA> + <currency>QAR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Qatar</name> + </QA> + <RE> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Reunion, Island Of</name> + </RE> + <RO> + <currency>RON</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Romania</name> + </RO> + <RS> + <currency>RSD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Serbia, Republic of</name> + </RS> + <RU> + <currency>RUB</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Russian Federation, The</name> + </RU> + <RW> + <currency>RWF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Rwanda</name> + </RW> + <SA> + <currency>SAR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Saudi Arabia</name> + </SA> + <SB> + <currency>SBD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Solomon Islands</name> + </SB> + <SC> + <currency>SCR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Seychelles</name> + </SC> + <SD> + <currency>SDG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Sudan</name> + </SD> + <SE> + <currency>SEK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Sweden</name> + </SE> + <SG> + <currency>SGD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Singapore</name> + </SG> + <SI> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Slovenia</name> + </SI> + <SK> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Slovakia</name> + </SK> + <SL> + <currency>SLL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Sierra Leone</name> + </SL> + <SM> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>San Marino</name> + </SM> + <SN> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Senegal</name> + </SN> + <SO> + <currency>SOS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Somalia</name> + </SO> + <SR> + <currency>SRD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Suriname</name> + </SR> + <ST> + <currency>STD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Sao Tome and Principe</name> + </ST> + <SV> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>El Salvador</name> + </SV> + <SY> + <currency>SYP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Syria</name> + </SY> + <SZ> + <currency>SZL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Swaziland</name> + </SZ> + <TC> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Turks and Caicos Islands</name> + </TC> + <TD> + <currency>XAF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Chad</name> + </TD> + <TG> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Togo</name> + </TG> + <TH> + <currency>THB</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Thailand</name> + </TH> + <TJ> + <currency>TJS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Tajikistan</name> + </TJ> + <TL> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>East Timor</name> + </TL> + <TN> + <currency>TND</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Tunisia</name> + </TN> + <TO> + <currency>TOP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Tonga</name> + </TO> + <TR> + <currency>TRY</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Turkey</name> + </TR> + <TT> + <currency>TTD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Trinidad and Tobago</name> + </TT> + <TV> + <currency>AUD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Tuvalu</name> + </TV> + <TW> + <currency>TWD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Taiwan</name> + </TW> + <TZ> + <currency>TZS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Tanzania</name> + </TZ> + <UA> + <currency>UAH</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Ukraine</name> + </UA> + <UG> + <currency>UGX</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Uganda</name> + </UG> + <US> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <region>AM</region> + <name>United States Of America</name> + </US> + <UY> + <currency>UYU</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Uruguay</name> + </UY> + <UZ> + <currency>UZS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Uzbekistan</name> + </UZ> + <VC> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>St. Vincent</name> + </VC> + <VE> + <currency>VEF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Venezuela</name> + </VE> + <VG> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Virgin Islands (British)</name> + </VG> + <VI> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <name>Virgin Islands (US)</name> + </VI> + <VN> + <currency>VND</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Vietnam</name> + </VN> + <VU> + <currency>VUV</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Vanuatu</name> + </VU> + <WS> + <currency>WST</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Samoa</name> + </WS> + <XB> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Bonaire</name> + </XB> + <XC> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Curacao</name> + </XC> + <XE> + <currency>ANG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>St. Eustatius</name> + </XE> + <XM> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>St. Maarten</name> + </XM> + <XN> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Nevis</name> + </XN> + <XS> + <currency>SIS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Somaliland, Rep of (North Somalia)</name> + </XS> + <XY> + <currency>ANG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>St. Barthelemy</name> + </XY> + <YE> + <currency>YER</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Yemen, Republic of</name> + </YE> + <YT> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Mayotte</name> + </YT> + <ZA> + <currency>ZAR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>South Africa</name> + </ZA> + <ZM> + <currency>ZMK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Zambia</name> + </ZM> + <ZW> + <currency>ZWD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Zimbabwe</name> + </ZW> +</countries> diff --git a/app/code/core/Mage/Usa/etc/system.xml b/app/code/core/Mage/Usa/etc/system.xml index 665f5484f75..f68cf10c97f 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) */ --> @@ -30,7 +30,7 @@ <carriers> <groups> <dhl translate="label" module="Mage_Usa"> - <label>DHL</label> + <label>DHL (Deprecated)</label> <frontend_type>text</frontend_type> <sort_order>130</sort_order> <show_in_default>1</show_in_default> @@ -215,7 +215,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> - 0</sort_order> + </sort_order> <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> @@ -1146,8 +1146,287 @@ 0</sort_order> </fields> </usps> + <dhlint translate="label" module="Mage_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>Mage_Adminhtml_Model_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> + </title> + <id translate="label"> + <label>Access ID</label> + <frontend_type>obscure</frontend_type> + <backend_model>Mage_Adminhtml_Model_System_Config_Backend_Encrypted</backend_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> + </id> + <password translate="label"> + <label>Password</label> + <frontend_type>obscure</frontend_type> + <backend_model>Mage_Adminhtml_Model_System_Config_Backend_Encrypted</backend_model> + <sort_order>60</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </password> + <account translate="label"> + <label>Account Number</label> + <frontend_type>text</frontend_type> + <sort_order>70</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </account> + <content_type translate="label"> + <label>Content Type</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Contenttype</source_model> + <sort_order>90</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </content_type> + <handling_type translate="label"> + <label>Calculate Handling Fee</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Shipping_Model_Source_HandlingType</source_model> + <sort_order>100</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </handling_type> + <handling_action translate="label comment"> + <label>Handling Applied</label> + <comment>"Per Order" allows single handling fee for entire order. "Per Package" allows individual handling fee for each package.</comment> + <frontend_type>select</frontend_type> + <source_model>Mage_Shipping_Model_Source_HandlingAction</source_model> + <sort_order>110</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </handling_action> + <handling_fee translate="label"> + <label>Handling Fee</label> + <frontend_type>text</frontend_type> + <sort_order>120</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </handling_fee> + <divide_order_weight translate="label comment"> + <label>Divide Order Weight</label> + <comment>Allows breaking total order weight into smaller pieces if it exeeds 70 kg to ensure accurate calculation of shipping charges.</comment> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>130</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </divide_order_weight> + <unit_of_measure translate="label"> + <label>Weight Unit</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Unitofmeasure</source_model> + <frontend_model>Mage_Usa_Block_Adminhtml_Dhl_Unitofmeasure</frontend_model> + <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> + </unit_of_measure> + <size translate="label"> + <label>Size</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Size</source_model> + <sort_order>150</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </size> + <height translate="label"> + <label>Height</label> + <frontend_type>text</frontend_type> + <sort_order>151</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><size>1</size></depends> + </height> + <depth translate="label"> + <label>Depth</label> + <frontend_type>text</frontend_type> + <sort_order>152</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><size>1</size></depends> + </depth> + <width translate="label"> + <label>Width</label> + <frontend_type>text</frontend_type> + <sort_order>153</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><size>1</size></depends> + </width> + <doc_methods translate="label"> + <label>Allowed Methods</label> + <frontend_type>multiselect</frontend_type> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Doc</source_model> + <sort_order>170</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><content_type>D</content_type></depends> + </doc_methods> + <nondoc_methods translate="label"> + <label>Allowed Methods</label> + <frontend_type>multiselect</frontend_type> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Nondoc</source_model> + <sort_order>170</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><content_type>N</content_type></depends> + </nondoc_methods> + <ready_time> + <label>Ready time</label> + <comment>Package ready time after order submission (in hours)</comment> + <frontend_type>text</frontend_type> + <sort_order>180</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </ready_time> + <specificerrmsg translate="label"> + <label>Displayed Error Message</label> + <frontend_type>textarea</frontend_type> + <sort_order>800</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </specificerrmsg> + <!-- + If the free_shipping_enable flag enable, the system will check free_shipping_subtotal to give free shipping + otherwise will use shopping cart price rule behaviour + --> + <free_method_doc translate="label"> + <label>Free Method</label> + <frontend_type>select</frontend_type> + <frontend_class>free-method</frontend_class> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Freedoc</source_model> + <sort_order>1200</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><content_type>D</content_type></depends> + </free_method_doc> + <free_method_nondoc translate="label"> + <label>Free Method</label> + <frontend_type>select</frontend_type> + <frontend_class>free-method</frontend_class> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Freenondoc</source_model> + <sort_order>1200</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><content_type>N</content_type></depends> + </free_method_nondoc> + <free_shipping_enable translate="label"> + <label>Free Shipping with Minimum Order Amount</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Enabledisable</source_model> + <sort_order>1210</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </free_shipping_enable> + <free_shipping_subtotal translate="label"> + <label>Minimum Order Amount for Free Shipping</label> + <frontend_type>text</frontend_type> + <sort_order>1220</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </free_shipping_subtotal> + <sallowspecific translate="label"> + <label>Ship to Applicable Countries</label> + <frontend_type>select</frontend_type> + <sort_order>1900</sort_order> + <frontend_class>shipping-applicable-country</frontend_class> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Shipping_Allspecificcountries</source_model> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </sallowspecific> + <specificcountry translate="label"> + <label>Ship to Specific Countries</label> + <frontend_type>multiselect</frontend_type> + <sort_order>1910</sort_order> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Country</source_model> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <can_be_empty>1</can_be_empty> + </specificcountry> + <showmethod translate="label"> + <label>Show Method if Not Applicable</label> + <frontend_type>select</frontend_type> + <sort_order>1940</sort_order> + <frontend_class>shipping-skip-hide</frontend_class> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </showmethod> + <sort_order translate="label"> + <label>Sort Order</label> + <frontend_type>text</frontend_type> + <sort_order>2000</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </sort_order> + <debug translate="label"> + <label>Debug</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>1950</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </debug> + </fields> + </dhlint> </groups> </carriers> </sections> </config> - 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 24fbca59caa..a6724261fbb 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/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 7098a2df122..1cb6e15e743 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/Usa/view/adminhtml/dhl/logo.jpg b/app/code/core/Mage/Usa/view/adminhtml/dhl/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4f80976c6a2c636339812f9bb552e4b406d63d32 GIT binary patch literal 9166 zcmdUT1yoe+zV{wLkWv9@knWNhQd$_5p=2mYMWm%$Bn0Um8VTtRX%Imv=?0~xC8Rs= zz<AF4p7*=oJ@=lozIE5PXRl}PHUIkkb3M<#_<r#NxCMJ4`v3reK)@s954acyq=D<0 zm{^$Cu47?gVPjv%!Mlx*hl`6xPDpg~HZ=v!9cl_HDq2Qv7Fv2v1}Z96K{n32ynK9o zG%UhmLSRvD2p{-T2?!e-8xI$c3?H8iOh-ir{vTf#p8<mFfFmdm9YhbH5rEJMKo`vb zB>)1@(2;2WxUONMV_<>MkVNP$0JsK1$Hcvcg^q!Se#rttL&vy=NkB|^TUj-tpM;KA z3a+M)h)kU!qF1p=!(ssQ-M9S!c@ss-`236XCbV=5sfGfn9%<swHjqltK$u9H5CH%} zM+4ztTtmk|zv8&WgFyf%B)UyZ$EzHX+J8-DW)m!>Z-bzJ^MT?1^Dm4LTd#{T01wHI zMu1KLNC2y4%(60H5wS6{OymRv!Q`if`rWA#I~(Ua6mv7i$;up_HdF4#fnx@g2m!9( zbM=zNzTO4%8x|Bl=m(fvU81Kf5=mM;IG)&<7;jhj34~bV)4w#1mme4UM`j9{@4evo zN^5PDfs~FBsxkf+feQ1K=da?jPaqZz4svj-4h^wMFB1iso_2#UaHemp=voX=ta%0L zN<ugrZ)NPs=9#pwg9WFvds<JBW>~JegK8q$vdjOKD>ZGzU`0hu_A__vm69t2=?T_7 zg_&VDhlGsP2fq5PP;eQEXY&6$ie9}lRg>Myx>s)^aeTMmoOh2cFXIO(>?&AzmvQTd zd0SFw1rQlf%6J@6il&_}be;yu@l?=7)piEhR1nW+B+WlB&&uKnPBtqq_vH!6x08r2 z5H5!tX*IojP<`D#;6t(@^qujw4}Wq)6ULY^lul32(bXHLyduz}tYCB3E&ieGL?qmb z-!b6FfDt3_*LW4_M@9nAaNjRorpWgyTZ@U1d{cv_y&L4i<sW8_gRTPbWEgIZoB5w` z(YzcR8}bY9l<7#+M8FYNQTuPQ@@b}rQa7u@!gU$`gfr?zU0ipRPo|abMgnZMq2vXG zo&h4_UnAc_B>JsVb5V_mlE?g7*`HiU8Tu8KmN-l6Dmp2?qM9*f_KV^-Hd1YcC(!LM za8Xs`JpKNE3hX!hFng^oH`u{nll+d~JfEl5H-TAwwhIvz`8vB?Z#Hr{a1^GcdNy^G zQN(eAK@{k35p#9{z~3i?L0*;!6t4YI<HVg0b=hTJq$Wng>^3tF+nIWd*iTVmqi!MA zDeN#0sb6p+^{Z81;KTi|s*CZm9@rJsSb$o+KYAt9wCP@DjHrZi!^2|ryum?g%y!!9 ziKk_!Y*V5RV%k!6DJ5>OttqlauO-m4;`l!bod2`(Rqx3O^xzu&DfZQv5dx5|tbe5= z)4JLd;$C)bKxD~N_K68B47Pu{H=bi|ylFf5bR?715n?Wh_C-DW-0cFGGSGRcbb4|D z)U{SO=3D?Z7l7Sq{)bcK1d{nE31CQqHkYgA3&voo3ttg15&z!uFT}5gzd^1aB|3Q2 z*ngVi=}TG^J}j3lRg1UP3E$}-n)8cF?-XkyMaxSPn%tQXG)+;$1xx#!n>)tuZk90$ zJzdQA<a~{jXFuoEYi-S*I~X!8*4P@0Nn2q0cowG`?d#{fY(>G>2Ux!qQ0S0({dXzX z6Oy>0%(A?Uedci6AUcic>0{|ECCcuE)#yQ%ki~9?jsXA!j=$#Bp%#mi;h(Q@;)2r- zmKZ29;Q67^+AYSe3u9M43>hM@pu62=KF4JnXoS_OwJ`D-1DaZp6@k%>`H-ozJ>%!E z^QOfoU&X!@PHA-WhPrxd*X5W$)oEwQdZ0mm0cgs+_UWHuGZ-#Z<dV}0fhkWJ8MhjV z(#T<O`MgPWW4u*Kg8B9e$9ntY9d%eL6RG%&+nCaBwo=yx@J73=UtdCGtT(*#CBMzQ zP$_5GB2RdOfqi{R$n34I;`sgUyEJ*Ir`yP3&e-u%nbaUd{<N~&w*L`s`dM>`*5LgB zka-YY_B>7P+f*5+JCSR2J&87!)!9_axn>Z4)+71m+k9_73T>6JvYN^|+RQzBN(%_Y z3;@_Cywc4JCr*Rs!;uHYXJ$V)_6XV;3`||Cu2CTb1Y$+zvkF3P3Yz4Bl@E~3D0?2Y ze3Y`aLqZX}Z(5=gwRMuqO~0hPLx3O2SLqE8Mnpv~8aK;GCycT84`)q`#zV~mN(V0h zx&TTVO#ziE*Y6(~4Dy*f95-BV+b<WZG7B^9=~bk#@RIW0`UX&b1~^GJ0bC3Kw6f<` zJ{VT#n;=!#k_?0EEZ%dt5k5%|;?tn)JV?@u?BAv%cwypF231Cc)mzsuvmC2rFM53K z((<KtQ`hXSvVIc1Cu}S*`2_%sIfsz7jk-xjB)Gq=@%&KrsR-+=IKe%nJV)PZSR<zR z)vcC$0i<{w#C@YAx&Xv4fDPUvUNebxkBJL_eZm8f1PHkM0MISujknIx8-7jkn}(RT zu|jY|ou=D%&~A46j>Oy|lP?Qwvo%*gV4#jSPoT;yQ$*}hcD=<{t4Su7z2uabH<XR{ z>g$$bW=PO~YAO+FQ6fnDN|Tw(1sT~C35NHUM60l_uN?0rYrlPRql|ZkDpoUYGZdyD z_{&!Mr(t|(VM{zATt>&Z#NL0|fgnMyld1L*y_SE`Ck>mp!cq1+CSR1ogHo*Pf3X}B zA;a;x91pfkwlv>*&8xXEBGg^}*%K};Wa7e6iDTT!Ir8`8ddIuGLxngl*6KNL<bKZm z#j--R;}h&T#L+E7m1UB#AZTg{!oUmq64;YgbnFxqMbA1KrNix>w{SgBz>pL-CC?wk z^PA|0$#F06<MI^G(rmM^kE;X;UAGKwQdk<fu4;G^V~5fOP&tzdE49;24nFfXyXUsx z+H6$R!$7*5$tuglD1+ee4+{4;{-ze3IAQF*cfYpa#p0aEK>>uR43h!zR9()5qqnN$ z<3sM;A-z0Bo!GG00JcS#i@%lypH{cJEVvoE7((-LgRyitJNDU|A1%hp8g3$uJ|AQz zs)TgToS1N*2h><v*Bq}a15Ag!nnP;SikrW=T7BI)rQ<Yqww_ZBNn*R>sXGum4b}<$ zX6kM6x5G{ey0w@F$Zb9^%gL`#n)&VWm7M(P6F>f2XivR~lc2i08#jK7Ly+1Ujgg_q z@gzJYD_CLQ$ac2=Eq<wu=rTa2gKQhBOM=9RISq>FuBe^3mB%w>Xbd)Sib!{Zs>+)k zlGB+ZFc%`IVudEu!wzHHEQYD$x~?UX;4kAGz%?RX>?a*#^6NfumuyW+-Y<An8+;m% zFCz9!?c-CO>d<)d*T!cK1ZN^Gcjei;)kiA0tVc3gHz533J7VcQzk!;5euf-WO>tV* zWOUC=tQT+pA0gNhxQq|{GOsyro|W#(!}P3=J;q93zwjv364!dbx(_c{drQ~WI&j;G z%?vJ&&~gs8XSE^sCaCUWVJatX86RUCQRgpc51xpImwqTTk~f+!IQ0bXj!*yq{oij~ zbDCK5ebP<#`(s}h#?E|B@h<?-;q*REh~r|>Q<IfSFR|2wp+}a&)ZDIttSf4#(4PA| zloix^ONV)cm7xylW_{f<%p^JUOVuy>sTUk0Nd3nq)!aeX=bv>-WPUs>PJQFeH$5=f zw6v>d;Fz9|Y;Izykg?EWyHmBBHk8_V#h+=LEiCgI06%hcT;W_>OcJ|)!stz_Z_L+5 zrrGWCTMu48drX>Y)~JwgKkK?6RcIPaPBuRHNl4+a#*bTNU)_GHCeG$;D>P?wH8DmI zy5g+s&aypvc1R&RQvqc&$ND^=grARZTNEfJ!Pyl}XNVY3O59D+zhShR?=oDw5+bKL zl}W=EH=eILnXjbdCluK>c8_h5E{$hE<+^5-%T)1zivQ))6X41>0f0c4kNWBs7?C!a z6B>G1ho^qis7*N38H0jT=zej!^jnUb|F|!&L+>V`qT_pF?V~@Fq%C)cCTH}GDMvJ$ ze+X3^e}2?i3ZYzLZ?M!L8+fJoMCjK^=3$~lV@iBz(4+K+>8<+~Br1XD>ApH<635(M z6mtd}IVo_X@1-kUFEQcP{>em02vdjqSNE(I^XinxM5ulxpde3$OAvNLT^MVE78&!S z9hYz64^~e-tsS_TxO?hvN2+UcpuU>NUtPw}_OR#qCwy+}r8@#1?3XVKbuU#W{$Vd1 zxQVZTgl}e2GK15E+M+%F?M5+nC%??Sf@zZ#C4Q5Qr>9}*bvBHATje#~B)9=|*&&%d zCM6n_63poWBo3l|vUbOhV3s1~DP3}5*8>=3WMrVtGWW$R)GZ@GO6&{wiXAfSqpN+f z>q^}t8s<wv79w{;E&wJ<Q!a{JGZ~Y39EAJ!rBhXL#ha+pij?>cf=0V1XJoc(D3eAw z*uasUHSRMNxB9%QGOwqQPX1pLfp+PMY+BRbQv}WHh2<*x+h$W><DMhnLBXA}fewjj zd4+;(jo`rkh-x>U!%##N0xl~{z!*47zerxu%Iu*KLV8p%Hb*3p)f#j<LS9DxhM=7% zZ?R7!IdYA=Uq-h)kFA9QJ1V0$K$vvmDeouC6uYtJFqcS8=8rYON1_dDD$PTx!MqD~ zdMjq^>SWtfJPv=WjNj)l4NskZ{YK);x_RP^I+IbMvO@d=|1ZV#cM)WTy}gw3L!Adx zfA6RD0OX%UP`~TycTlIB;D|ysOP!dxQu*AkH<_5$&Y&jtxNOp02F9gC=QBem8HR^M zb<M<_UL=MjL8nnyFE5ZUoxPuKBwAMcw7XrOlY1mGQq;(8-Xgym^S*06yBeC#|9Ct{ zjf*g=CjPzyLEHKR6^;1)tq`3DBP;ov*HwI}BAhVaZLufboe!$!n-2IVQ{e6B<+v#Q z7skbn1||46g}^G<((Mj>sKYnv7Uy{()Ua3`+Objno@ZZVJt|dD^f7d{&dk|B(yjnF z;j|(%!8i1zJm5ArS<(_H#2dP=Zx*WP>Z?F7rD00ojFNBo+eW`BAv5hE-uEfBxI8Te zlQv4Pj9GyywWpp^sOgAXa(y@J$O3MvusxRh+xGJ-hWl%vOu<gGOG4^T_WZiBsk}ST z(?{mC2oK1u{fxY5(hg1&r9}0f9c7lSe5E#@&loRr+9QQ1Zof=nmj7X*QwGXgxp{zo zwPLA&%r)EJa=hx1r?c(C%+HaSz`I(h<<XJ<GnYkP{|i4bVyll`FyBbZ`Pr=2`|Qi| zWA+Y_K=cb>Qt(Cw=#r4oqX@Ed<c!wcIf#>kX12th={<M677*HxSgg+uZn!Tt^lL$a z&Kz_*dPm}!zzJ(car_C7RcUJ{{sU7k@R+uRXn?GajQB{wTQ&{y35^M;OWf`?j){pp zr<xj_^<t6=_2e4dH?$FLV_*-Q2fpZPLp19*ve2RR^!uJ8<xjXU4}-?grJ-I6arhdK zJ*vsB)_ZX`9TMa2uOgk|*1yxEMicHE%20?1ozoh$VJwgP*+&Oa^qnxmnWwFB={o9a zZNnKRwo3lIhEoC6UMdkm+j@wIRBLr2K83o3x@m@J<@c(rWVgu~u2*_1%_wg5dD<z7 zzgPg-)?}xEZ9QxL5;Tz2UxG~Ya&#=em#)lr1^b~*p=ovGm_ZIeLlo($ce!Yl|HK>A z7bNyNfa@6dq%T1zCDDa@xCJ?co2w^sR$8b7o8hK|d|X(rmZa=T=WXx>O`HM;no<iw zf-Vzff;AC8DCjv(jXsIxf)Pax9rDqs_(olJ!kXs1z0SpR*a7RrJJ+)enJnTEV-}#s z=qiSozax2-#M=LHK@d~)Xl4%!3gz6*8Z+5|kvt92_E-33JRI+UH!v%dAGr5%ZQK9k zx)M-uoX!|;MSA=?+IX0pvD3L>aQ?3qj{b?QURy&;<#lDAB7?bu+93uRs(n5Jmvx`; z-yz)F6P-{KU{B&m6nJdTQ8ZUwOl<SFQ+ThpJfq!OpP;3tJImdO!ZOJd_Mr=)x8bDA zJcwx6d95yM$WK95By^T*ZjLgf&q?3v_Ci_~SSbGUn7dxSuL7+JC=kFn7o>c@-Z(`z zVd?!5*EviobLT6M+WIRUYE=OH)KXAt(x;BMdJ@Z#WV6ro^;YLFWZ=ijdq8Q<ruN1f z*Gx$3Pmz);UvIgkP`%vbSS&RF%>!i%4<*Y-@l@1yPky)hUJgKXh%#b;l6^mLG#8s^ zocU!~5=d#Cv#0*9-Gq|G$BgZz`lKSpeIxI$08RMnoflT(m#rNh11wu8V83OrpsV)E zdFOe8Bv8PD;apT?A4X1^S16?n*&aZfwIv_Jle}y?hhH&Atr6rrzH<TOI(lSsH11LE zjvLD7A$r&ub6IEMQIjq1p~@U}>?A?8<~L7|bEz}Rb^C9Lo!xfE#&Ijn9GY;cZlN6- z9(8&jq-6E%d$eh8U!2OeLhCrU9sP8xkT|s>HNtp&e@`d2hZ<oZ`1l7SMJ3-?w$(%v z#Kemjb?p#@6?cy~Z|ZsG=y_Bz?vUd&j?cI9@rJL%_LEHC${!ln<9;UWD^wFmrx|Y% z)UiAX-hLDuCKWv^t~5rC$rwv!V~cMh5{;N#@aWl^dkw}S>=)=i7te1^@FVOes6P0j z530bN>SqUI`;uG$6&f?JceNKlEZJC&)|ere*DH-mnEdvm07fI@?Yf)3lGF&JapW;o zl{@D~J1^zQF>A>mks-ACWhfv+wHvTFmvTotfN{%oj(4?=o5aF?<N{b4e)Ws#oi4$h z^A1j|u(PZ_ay=MKyUs~(9O@Jw9usD^JV48A%C!F-+|l8{_%29^+#4y1TWjt<mGg_v zYu(@HHi+RD*t4;ljm=62DQ0*n=50nhM4u(cCCfbA9^=Iz!8>=#O@f!LpufNOFu@lu zTSiiu_8+s~{0g5ZS@=~>+5b=F>5J+;iYw?@S3Otx;mEN;-vj+2suKuVmASArZCQ&s zT8n*DT8I)2B02V}PSo=BmOxSCoMw^KIDEPL0nm;IrL%X8Z7O^}&hyqN`mY9RjeUZN zbZv(@A2p`FrpeWAnKkDr5tz0cm4rM6zv3L7u+T3$!gQj1VqPzOgBbV68ElG7mB)LJ z!+CqJj<RcCZ|n|BT6a?G2*pM?O7Gp7$MrXd3TJ%oA4<Thd{&(W<JV&R0)CdE$mCZV z@q|!H^ijO8rtlYCnNnx}OM`k<-Y&`QCeF!00#|sXP*$5zhI~=rNDF^V8JBAPuYr<I z(t_=ZKusvpxm|5?35H{t=5(94VwV|~`pb{}Wyg-Vz?CNUF}8VSLjLW>2alE@a|;XS z-;&=jD3#c=mXI6CFwfUTovas~4830Jz~{gDQ4ecP$uM1!Hp?VgZsJs=NTRcJJiDjN z_EGv5N3`~G;&v(0T4*!lxI2+-yT$jP3I`L>jQ%nWie)jjln5%rxZspouyRDsF2Pfm zlxJ@&Z?9_2u#0fRbFwdh@UF8uueFBohJ#?L<M35J!T5&F)LSiF(^1kwDXvPRYA+Ss z?EP3WbBg5NanL5b44s8As4ZsF(Ak97Nxn~e(LD5vai6)9TVM{+`5p2d+T$T1uB>$; z@rLS`nAW{;GmDH|RtCsC(*$#&-A|U$vRy~pJln&lG|jUC;jUdhZQL+PzjH}alWPrd zS1wp1jjHCIM#-9E?XWg&x0ph>xq3%GbJRo>KlE)u?hQkP>;fsT$F;Lw$!_x%dzH)| z<=?jqyI(DiOS8#F>Q=?lO|CWz#GQasQ?uF^WNjMhJC%iPSdR{iW-0AVD{b50cM={W zf)VXX_37GyiwcWQ>qMW*UQ`F^Z0)P*iwS5`k|?)NaG58wSaoZp#7+8_hQQNgO*_h) z__<6qDYPNgAsRb6GBQsYct63C3=3Ka@QYr!41C)VvLLuuMJ4{cPp8GLX|a10)9k}! zffm{P+(0i^r2<TrFVs@HA+lrLhI-#sJ^);$5i|ZUzOulV&`g{j9^6^p<sW1+Z!Af9 zt!?y^60?4Pd(^C)!UVK3vIKV%*Q{$`)F_{OSPdqMk*pou%0%D_2G1$SyesCYv4YIf z<zs$OC|6H%2<#dm^SiaJ-|V1c<i@}wku-)mtQn>C?tv<WJ_YRqu<A0la?;|%L)cl0 zM0i<rVA)%lCn};^3ff;I1Z+7azdI*=A|)J>>HWsFoyf^$H84G~A$nApgZOEeAZQ?r z-AphUCG)PBYP(F=Pqp&bmpm>7W%_#-k*0Nsbb2ro`?`U+8x4e-Jdj!d!e;27Yf-+< z#15w4x&5@9!i~wYB?uH;J6J?0i_gBpH+fuFG$H05aW+$VOf)Jz)8pBr1+Mf0jh3yh z6o=>wCp<9+cZUcP5=Dla9@**$cV`y0=8Th=I$+%%CggY<omme}n#gwIKOoh|?Y`0T zHCy?)jGK7>V!!QhjFTY^`Q)g}1bd3fW0Uy_=dCB5h4*IRV-yg63Xgd$K9A!Y0}^$} z`Q|ZqmhBe@l{KmP^jTD*b69sSi8hrfX9<@d?i}u|C>7fo{*qospf8GUk??H<Av~IZ zfW+(8zGHWV{QH&wHu3&l#_lF2>SiM&CsG>z18jMA(l5u+b*`@(!mS{q#vODwX@w%( zPTlkW>8uLv+Y%#rxh_!h?X|Z^NCE#eoga?RrhBFp9!e#T_LsWe7v-W#(05m4+MYRc ze5W>j)Vyv&@#2nbBF%E$B<eRpks;M%O}g7;);UkHR@669yp2~ATTZ%pSF`MjjCW<# zmkMR*E{gY)73Pi@;(remxqn+*aOk$UG+j1ovWJvsAP};|%}^WcRLI1V<XQ1~<IEAw zxI@}5_6^a@EV~@pq<KU`P}ghy(pN3hVn5Irq|ig!M0*|jlIDz$v3=WDNnaoMQnD22 z?o0uq!@H+9=hs&!PR=~zUM7EV>UI7t2FhPPq-mcVM1FgJ#*E@7Loonm$L?6$PWHVG z-~XbGqCVx#Y0@NQV;>ErWd>!<6SFw`hX;$3{J&)-?Cz-8^Nr+90EKxu#iNASaHA~J z-8E7}H$Ji2$jmy@wsN{nV0oYEJ9v<GHBt}$Xd6D0EPLl&Y4vA}tQdMO%k0{uDF*lq zLbq&9gs0*OBJwd?1;x9;q=&l$+ioN0Q0KTN#@Gvh9%%>El=IA{1}lC&-A$*rQh9P0 z=T7wVlK5>SUKQtw2zRxgAEP!Fc@Gpme79dF`oNMLcXYDBCB8R?Gj{=u`vb2`QboQj zx)vqrK3<(1Kld(;X?n32RPWlX0Q;Jx_0nl^Xv!h$#%@W*)VtjjGGP9(q#%0NfetuN zowEG<nO8)_L&T}EX7khoEqq~_hc0@^4+&A@WO)i)hmTi!tA0h931X9y>&fWoxOt-Y zO9Ldpj@Y-t{P@ClEaUHv$^~Z$%mNxEMP25s8|qRorgy5FE5Pla<fUtfb1kc9bbpZ; z86no@ssYE9CyAU=i>|pev&3Lr;csVthGf&Dr;C&JgJ#B=H*$u`--j@#i$fry^<rMI z_~&zQ)ol89%}2`QY<tXmNvCyAo;PV^iCPkGLMD+axJkHwim(oS$Nm|<6HoyeP>j!g z;l-B_R^G1TiV?!y0?nwk`ihv%$lnq#{bYQ$F$-V~$ZQ!SJ%8xzBj*!T>E>t1^^Y~m zfXep@-oI5nf2;Waw>A1NSc$l=z=}Lo1P9JRmH;AY1uDiE<Y#uc2cr6QsQcc<=zjq6 CFRf(& literal 0 HcmV?d00001 diff --git a/app/code/core/Mage/Usa/view/adminhtml/dhl/unitofmeasure.phtml b/app/code/core/Mage/Usa/view/adminhtml/dhl/unitofmeasure.phtml new file mode 100644 index 00000000000..e32ac281bd2 --- /dev/null +++ b/app/code/core/Mage/Usa/view/adminhtml/dhl/unitofmeasure.phtml @@ -0,0 +1,53 @@ +<?php +/** + * 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_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +/** + * @var $this Mage_Usa_Block_Adminhtml_Dhl_Unitofmeasure + */ +?> +<script type="text/javascript"> + //<![CDATA[ + function changeDimensions() + { + var dimensionUnit = '(<?php echo $this->getInch(); ?>)'; + var dhlintUnitOfMeasureNote = '<?php echo $this->getDivideOrderWeightNoteLbp(); ?>'; + if ($("carriers_dhlint_unit_of_measure").value == "K") { + dimensionUnit = '(<?php echo $this->getCm(); ?>)'; + dhlintUnitOfMeasureNote = '<?php echo $this->getDivideOrderWeightNoteKg(); ?>'; + } + $$('[for="carriers_dhlint_height"]')[0].innerHTML = '<?php echo $this->getHeight(); ?> ' + dimensionUnit; + $$('[for="carriers_dhlint_depth"]')[0].innerHTML = '<?php echo $this->getDepth(); ?> ' + dimensionUnit; + $$('[for="carriers_dhlint_width"]')[0].innerHTML = '<?php echo $this->getWidth(); ?> ' + dimensionUnit; + + $('carriers_dhlint_divide_order_weight').next().down().innerHTML = dhlintUnitOfMeasureNote; + } + document.observe("dom:loaded", function() { + $("carriers_dhlint_unit_of_measure").observe("change", changeDimensions); + changeDimensions(); + }); + //]]> +</script> 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 a83d7b2484c..967d49d247b 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 08e2dc7a15e..a4559043cc6 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 9e29af583c2..d334636a43e 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) */ 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 c58d79da585..54185c68fd0 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 87719766cc9..7d5d01a4374 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/Observer.php b/app/code/core/Mage/Weee/Model/Observer.php index 90a0bfe028a..c3f7d09a3fc 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) */ @@ -200,15 +200,18 @@ class Mage_Weee_Model_Observer extends Mage_Core_Model_Abstract if (!$_product) { return $this; } - if (!Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, array(0, 1, 4))) { - return $this; - } + $amount = Mage::helper('Mage_Weee_Helper_Data')->getAmount($_product); $origAmount = Mage::helper('Mage_Weee_Helper_Data')->getOriginalAmount($_product); $options['oldPlusDisposition'] = $origAmount; $options['plusDisposition'] = $amount; + // Exclude Weee amount from excluding tax amount + if (!$weeeHelper->typeOfDisplay($_product, array(0, 1, 4))) { + $options['exclDisposition'] = true; + } + $response->setAdditionalOptions($options); return $this; @@ -222,7 +225,9 @@ class Mage_Weee_Model_Observer extends Mage_Core_Model_Abstract */ public function updateBundleProductOptions(Varien_Event_Observer $observer) { - if (!Mage::helper('Mage_Weee_Helper_Data')->isEnabled()) { + /* @var $weeeHelper Mage_Weee_Helper_Data */ + $weeeHelper = Mage::helper('Mage_Weee_Helper_Data'); + if (!$weeeHelper->isEnabled()) { return $this; } @@ -231,20 +236,25 @@ class Mage_Weee_Model_Observer extends Mage_Core_Model_Abstract $options = $response->getAdditionalOptions(); $_product = Mage::registry('current_product'); - if (!Mage::helper('Mage_Weee_Helper_Data')->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('Mage_Weee_Helper_Data')->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); return $this; } } - 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 c6e86f91c1f..81bd2d4833a 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 d736d91468e..15738964c17 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 d438284a8e5..ea2f6b35d7e 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 78456a7d230..4e9ca0a8f59 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) */ @@ -163,18 +163,17 @@ class Mage_Weee_Model_Tax extends Mage_Core_Model_Abstract $taxAmount = $amount = 0; $amount = $value; - /** - * We can't use FPT imcluding/excluding tax - */ -// if ($calculateTax && Mage::helper('Mage_Weee_Helper_Data')->isTaxable($store)) { -// $defaultPercent = Mage::getModel('Mage_Tax_Model_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('Mage_Weee_Helper_Data')->isTaxable($store)) { + $defaultPercent = Mage::getModel('Mage_Tax_Model_Calculation') + ->getRate($defaultRateRequest + ->setProductClassId($product->getTaxClassId())); + $currentPercent = $product->getTaxPercent(); + if (Mage::helper('Mage_Tax_Helper_Data')->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('Mage_Catalog_Helper_Data')->__($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 68a681be724..87f7574a275 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 9f7e07a5464..00124bcc827 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 bd99fbea00b..272a11074d7 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 f9737c33199..70fac9d4601 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 476440bc5d8..29be61b6ef4 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) */ --> diff --git a/app/code/core/Mage/Weee/etc/fieldset.xml b/app/code/core/Mage/Weee/etc/fieldset.xml index 07ffd225d3b..70abfb0784d 100644 --- a/app/code/core/Mage/Weee/etc/fieldset.xml +++ b/app/code/core/Mage/Weee/etc/fieldset.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/etc/system.xml b/app/code/core/Mage/Weee/etc/system.xml index 0316bd947bc..c8f53007e1d 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 78ae551b65c..a244d6c26ef 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/view/adminhtml/renderer/tax.phtml b/app/code/core/Mage/Weee/view/adminhtml/renderer/tax.phtml index b66a3891abf..70e777c05da 100644 --- a/app/code/core/Mage/Weee/view/adminhtml/renderer/tax.phtml +++ b/app/code/core/Mage/Weee/view/adminhtml/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 @@ </td> <td class="last"> <input type="hidden" name="<?php echo $_htmlName ?>[__index__][delete]" class="delete" disabled="no-template" value="" id="#{prefix}_weee_tax_row___index___delete" /> - <button title="Delete WEEE Tax" class="scalable delete icon-btn delete-product-option" onclick="weeeTaxControl.deleteItem('<?php echo $_htmlId ?>', event);return false"><span>Delete</span></button> + <button title="Delete WEEE Tax" class="scalable delete icon-btn delete-product-option" onclick="weeeTaxControl.deleteItem('<?php echo $_htmlId ?>', event);return false"><span><span><span>Delete</span></span></span></button> </td> </tr> </thead> diff --git a/app/code/core/Mage/Weee/view/frontend/layout.xml b/app/code/core/Mage/Weee/view/frontend/layout.xml index 66670252f09..f2421dbe3d2 100644 --- a/app/code/core/Mage/Weee/view/frontend/layout.xml +++ b/app/code/core/Mage/Weee/view/frontend/layout.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/code/core/Mage/Weee/view/frontend/tax_toggle.js b/app/code/core/Mage/Weee/view/frontend/tax_toggle.js index 8de29e41ba0..55646c4eeae 100644 --- a/app/code/core/Mage/Weee/view/frontend/tax_toggle.js +++ b/app/code/core/Mage/Weee/view/frontend/tax_toggle.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/Block/Adminhtml/Widget.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget.php index cfd6883374d..a38f760aafa 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 @@ class Mage_Widget_Block_Adminhtml_Widget extends Mage_Adminhtml_Block_Widget_For $this->_blockGroup = 'Mage_Widget'; $this->_controller = 'adminhtml'; $this->_mode = 'widget'; - $this->_headerText = 'Widget Insertion'; + $this->_headerText = $this->helper('Mage_Widget_Helper_Data')->__('Widget Insertion'); $this->removeButton('reset'); $this->removeButton('back'); @@ -49,7 +49,8 @@ class Mage_Widget_Block_Adminhtml_Widget extends Mage_Adminhtml_Block_Widget_For $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 1468f81924b..7a07bdaa1d6 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) */ @@ -180,13 +180,26 @@ class Mage_Widget_Block_Adminhtml_Widget_Chooser extends Mage_Adminhtml_Block_Te <label class="widget-option-label" id="' . $chooserId . 'label">' . ($this->getLabel() ? $this->getLabel() : Mage::helper('Mage_Widget_Helper_Data')->__('Not Selected')) . '</label> <div id="' . $chooserId . 'advice-container" class="hidden"></div> - <script type="text/javascript"> - ' . $chooserId . ' = new WysiwygWidget.chooser("' . $chooserId . '", "' . $this->getSourceUrl() . '", ' - . $configJson . '); - if ($("'.$chooserId.'value")) { - $("'.$chooserId.'value").advaiceContainer = "'.$chooserId.'advice-container"; - } - </script> + <script type="text/javascript">//<![CDATA[ + (function() { + var fun_'. $chooserId .' = function() { + window.' . $chooserId . ' = new WysiwygWidget.chooser( + "' . $chooserId . '", + "' . $this->getSourceUrl() . '", + ' . $configJson . ' + ); + }; + if (document.loaded) { //allow load over ajax + $("'.$chooserId.'value").advaiceContainer = "'.$chooserId.'advice-container"; + fun_'. $chooserId .'.call(); + } else { + document.observe("dom:loaded", function () { + $("'.$chooserId.'value").advaiceContainer = "'.$chooserId.'advice-container"; + fun_'. $chooserId .'.call(); + }); + } + })(); + //]]></script> '; } } 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 454bafbc076..1ff5053134b 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 21f41fc392b..9f1abd41ec1 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 2d2966b9deb..951092b6ea4 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 40ae3e4df70..d51e456c01f 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 @@ class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Block */ public function addAllowedBlock($block) { - $this->_allowedBlocks[] = $type; + $this->_allowedBlocks[] = $block; return $this; } @@ -92,7 +92,7 @@ class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Block 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 @@ class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Block $selectBlock = $this->getLayout()->createBlock('Mage_Core_Block_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 3b04b326171..d28fe5d92d2 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 1067b6597be..ee6ed0b3730 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 dad03472334..272c81afd4d 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 37ede861335..23cbd24608a 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) */ 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 6ffd0393d02..5776a2b03b7 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 0631ec0e134..bb8446c9f3c 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 a42357df1d5..c6cf1d79313 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 2a637615006..a99365770ae 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 7b024e65f9c..84833cb76ef 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 3bd05446d44..b24e4e03e84 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 e53e5cb1733..caa8ce6375c 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 b1e121a2512..923988b5dd2 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/Observer.php b/app/code/core/Mage/Widget/Model/Observer.php index 16aaf7f31fc..087cde685ce 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 30021bf73dc..bdc15b844a9 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 fe5eaf25454..7349b13685f 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 2309187b1ab..a7645e5a71e 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) */ @@ -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/Model/Template/Filter.php b/app/code/core/Mage/Widget/Model/Template/Filter.php index 4793ea368e9..7cfb6a8989a 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 23adb8394ed..6c9a7dee1ce 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 0bbcccbbebc..eba3297e9ca 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 772cfa84b21..2ae670d969a 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) */ @@ -318,7 +318,7 @@ class Mage_Widget_Model_Widget_Instance extends Mage_Core_Model_Abstract } else if (is_null($this->getData('widget_parameters'))) { return array(); } - return $this->getData('widget_parameters'); + return (is_array($this->getData('widget_parameters'))) ? $this->getData('widget_parameters') : 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 3f3a0e04eee..b1aea553f47 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) */ @@ -62,7 +62,7 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con /** * 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() { @@ -127,6 +127,17 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con $this->renderLayout(); } + /** + * Set body to response + * + * @param string $body + */ + private function setBody($body) + { + Mage::getSingleton('Mage_Core_Model_Translate_Inline')->processResponseBody($body); + $this->getResponse()->setBody($body); + } + /** * Validate action * @@ -143,7 +154,7 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con $response->setError(true); $response->setMessage($this->getLayout()->getMessagesBlock()->getGroupedHtml()); } - $this->getResponse()->setBody($response->toJson()); + $this->setBody($response->toJson()); } /** @@ -221,7 +232,7 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con ->setId(Mage::helper('Mage_Core_Helper_Data')->uniqHash('categories')) ->setIsAnchorOnly($isAnchorOnly) ->setSelectedCategories(explode(',', $selected)); - $this->getResponse()->setBody($chooser->toHtml()); + $this->setBody($chooser->toHtml()); } /** @@ -241,7 +252,7 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con /* @var $serializer Mage_Adminhtml_Block_Widget_Grid_Serializer */ $serializer = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Grid_Serializer'); $serializer->initSerializerBlock($chooser, 'getSelectedProducts', 'selected_products', 'selected_products'); - $this->getResponse()->setBody($chooser->toHtml().$serializer->toHtml()); + $this->setBody($chooser->toHtml().$serializer->toHtml()); } /** @@ -262,7 +273,7 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con ->setLayoutHandle($layout) ->setSelected($selected) ->setAllowedBlocks($widgetInstance->getWidgetSupportedBlocks()); - $this->getResponse()->setBody($blocksChooser->toHtml()); + $this->setBody($blocksChooser->toHtml()); } /** @@ -279,7 +290,7 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con ->createBlock('Mage_Widget_Block_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 04c392afbb2..7923344246b 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 0e3930d3746..fec21459c7d 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 ff6aa6ead27..71efcaa0a55 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/translater.xml b/app/code/core/Mage/Widget/etc/translater.xml new file mode 100644 index 00000000000..ca1dc019f97 --- /dev/null +++ b/app/code/core/Mage/Widget/etc/translater.xml @@ -0,0 +1,34 @@ +<?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_Widget + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<translater> + <!-- widget.js --> + <widget-ui-insert translate="message" module="Mage_Widget"> + <message>Insert Widget...</message> + </widget-ui-insert> + <!-- end widget.js --> +</translater> 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 5868c78bc56..82a4ab8859a 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/view/adminhtml/instance/edit/layout.phtml b/app/code/core/Mage/Widget/view/adminhtml/instance/edit/layout.phtml index 8d9f7512ba0..93c2f29eda3 100644 --- a/app/code/core/Mage/Widget/view/adminhtml/instance/edit/layout.phtml +++ b/app/code/core/Mage/Widget/view/adminhtml/instance/edit/layout.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) */ ?> @@ -41,7 +41,7 @@ var pageGroupTemplate = '<div class="options-box page_group_container" id="page_ '<div class="option-title">'+ '<?php echo $this->getRemoveLayoutButtonHtml() ?>'+ '<label for="widget_instance[{{id}}][page_group]">Display On <span class="required">*</span></label>'+ - '<?php echo $this->getDisplayOnSelectHtml() ?>'+ + '<?php echo $this->getDisplayOnSelectHtml(); ?>'+ '</div>'+ <?php foreach ($this->getDisplayOnContainers() as $container): ?> '<div class="no-display <?php echo $container['code'] ?> group_container" id="<?php echo $container['name'] ?>_{{id}}">'+ @@ -87,7 +87,7 @@ var pageGroupTemplate = '<div class="options-box page_group_container" id="page_ '<input type="hidden" class="product_type_id" name="widget_instance[{{id}}][<?php echo $container['name'] ?>][product_type_id]" value="<?php echo $container['product_type_id'] ?>" />'+ '<p>' + '<input type="text" class="input-text entities" name="widget_instance[{{id}}][<?php echo $container['name'] ?>][entities]" value="{{<?php echo $container['name'] ?>_entities}}" readonly="readonly" /> ' + - '<a class="widget-option-chooser" href="javascript:void(0)" onclick="WidgetInstance.displayEntityChooser(\'<?php echo $container['code'] ?>\', \'<?php echo $container['name'] ?>_ids_{{id}}\')" title="<?php echo $this->helper('Mage_Core_Helper_Data')->jsQuoteEscape(Mage::helper('Mage_Widget_Helper_Data')->__('Open Chooser')); ?>">' + + '<a class="widget-option-chooser" href="javascript:void(0)" onclick="WidgetInstance.displayEntityChooser(\'<?php echo $container['code'] ?>\', \'<?php echo $container['name'] ?>_ids_{{id}}\')" title="<?php echo $this->helper('Mage_Core_Helper_Data')->jsQuoteEscape(Mage::helper('Mage_Widget_Helper_Data')->__('Open Chooser')) ?>">' + '<img src="<?php echo Mage::getDesign()->getSkinUrl('images/rule_chooser_trigger.gif') ?>" class="v-middle" alt="<?php echo $this->helper('Mage_Core_Helper_Data')->jsQuoteEscape(Mage::helper('Mage_Widget_Helper_Data')->__('Open Chooser')); ?>" />' + '</a> ' + '<a href="javascript:void(0)" onclick="WidgetInstance.hideEntityChooser(\'<?php echo $container['name'] ?>_ids_{{id}}\')" title="<?php echo $this->helper('Mage_Core_Helper_Data')->jsQuoteEscape(Mage::helper('Mage_Widget_Helper_Data')->__('Apply')); ?>">' + @@ -175,6 +175,8 @@ var WidgetInstance = { templatePattern : /(^|.|\r|\n)({{(\w+)}})/, count : 0, activePageGroups : $H({}), + selectedItems : {}, + addPageGroup : function(data) { if (this.pageGroupTemplate && (pageGroupContainer = $(this.pageGroupContainerId))) { if (!data.page_id) { @@ -183,6 +185,14 @@ var WidgetInstance = { data.entities = ''; } data.id = this.count++; + 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(data.group + '_ids_' + data.id, selected_entities[i]); + } + } + } pageGroupTemplateObj = new Template(this.pageGroupTemplate, this.templatePattern); Element.insert(pageGroupContainer, {'top':pageGroupTemplateObj.evaluate(data)}); if (data.group) { @@ -196,7 +206,7 @@ var WidgetInstance = { if (data.group == 'pages') { layoutSelect = pageGroup.down('select#layout_handle'); if (layoutSelect) { - for (var i=0; i < layoutSelect.options.length; i++) { + for (var i = 0; i < layoutSelect.options.length; i++) { if (layoutSelect.options[i].value == data.layout_handle) { layoutSelect.options[i].selected = true; break; @@ -206,7 +216,7 @@ var WidgetInstance = { } if ($(this.pageGroupContainerId+'_'+data.id)) { selectGroupElm = $(this.pageGroupContainerId+'_'+data.id).down('select.page_group_select'); - for (var i=0; i < selectGroupElm.options.length; i++) { + for (var i = 0; i < selectGroupElm.options.length; i++) { if (selectGroupElm.options[i].value == data.group) { selectGroupElm.options[i].selected = true; break; @@ -234,6 +244,19 @@ var WidgetInstance = { container.remove(); } }, + addProductItemToSelection: function(groupId, item) { + if (undefined == this.selectedItems[groupId]) { + this.selectedItems[groupId] = $H({}); + } + if (!isNaN(parseInt(item))) { + this.selectedItems[groupId].set(item, 1); + } + }, + removeProductItemFromSelection: function(groupId, item) { + if (undefined !== this.selectedItems[groupId]) { + this.selectedItems[groupId].unset(item); + } + }, showBlockContainer : function(container) { container = $(container); if (container) { @@ -334,16 +357,17 @@ var WidgetInstance = { } }, checkProduct : function(event) { - chooser = event.target.up('div.chooser') - ids = []; - chooser.select('input[type="checkbox"].entities').each(function(elm){ - if (elm.checked) { - ids.push(elm.value); - } - }); - entitiesElm = chooser.up('div.chooser_container').down('input[type="text"].entities'); + var elm = event.memo.element, + container = event.target.up('div.chooser').up('div.chooser_container'), + selectionId = container.id, + entitiesElm = container.down('input[type="text"].entities'); + if (elm.checked) { + this.addProductItemToSelection(selectionId, elm.value); + } else { + this.removeProductItemFromSelection(selectionId, elm.value); + } if (entitiesElm) { - entitiesElm.value = ids.join(','); + entitiesElm.value = this.selectedItems[selectionId].keys().join(','); } }, checkCategory : function(event) { diff --git a/app/code/core/Mage/Widget/view/adminhtml/instance/js.phtml b/app/code/core/Mage/Widget/view/adminhtml/instance/js.phtml index a314f3519db..642d258720f 100644 --- a/app/code/core/Mage/Widget/view/adminhtml/instance/js.phtml +++ b/app/code/core/Mage/Widget/view/adminhtml/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/code/core/Mage/Widget/view/adminhtml/layout.xml b/app/code/core/Mage/Widget/view/adminhtml/layout.xml index 9fc637c5a8e..ad67cc27b4c 100644 --- a/app/code/core/Mage/Widget/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Widget/view/adminhtml/layout.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/code/core/Mage/Widget/view/frontend/layout.xml b/app/code/core/Mage/Widget/view/frontend/layout.xml index 66d68045712..b6e38fd8e10 100644 --- a/app/code/core/Mage/Widget/view/frontend/layout.xml +++ b/app/code/core/Mage/Widget/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @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/view/frontend/widgets.css b/app/code/core/Mage/Widget/view/frontend/widgets.css index e697a4e58ee..0c1316d2603 100644 --- a/app/code/core/Mage/Widget/view/frontend/widgets.css +++ b/app/code/core/Mage/Widget/view/frontend/widgets.css @@ -19,7 +19,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/code/core/Mage/Wishlist/Block/Abstract.php b/app/code/core/Mage/Wishlist/Block/Abstract.php index 4822ce6237e..b9d07e19b9b 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) */ diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php b/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php index 2a323d8eabb..879f2814149 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) */ diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php b/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php index ae2801a0e34..be59aa097d2 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) */ diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist.php index 398371ab1f3..7d86e26d1f9 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) */ 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 0e07231d418..358ef1c01b0 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) */ diff --git a/app/code/core/Mage/Wishlist/Block/Item/Configure.php b/app/code/core/Mage/Wishlist/Block/Item/Configure.php index 2771395014c..f204d2cd1ce 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 5fb443a614a..bd78b4663b6 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) */ 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 0d0cd9ff967..922d80b90e1 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 2cd6bc60f5f..6d79ab38d9b 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 ed93cab71d7..3df7dd114ef 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 fc4c5879123..b67f0af2fbb 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 0425d4879df..7d7484b26b6 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) */ diff --git a/app/code/core/Mage/Wishlist/Helper/Data.php b/app/code/core/Mage/Wishlist/Helper/Data.php index b8add4544d0..9242ed0bf36 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) */ diff --git a/app/code/core/Mage/Wishlist/Model/Config.php b/app/code/core/Mage/Wishlist/Model/Config.php index 5cb5852c5c1..e5900b01e14 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 386173335e1..485240fbb1a 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 def9b6c29cb..574ecad38d2 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) */ @@ -109,6 +109,18 @@ class Mage_Wishlist_Model_Item extends Mage_Core_Model_Abstract $this->_init('Mage_Wishlist_Model_Resource_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 * @@ -703,4 +715,4 @@ class Mage_Wishlist_Model_Item extends Mage_Core_Model_Abstract $this->setOptions($options->getOptionsByItem($this)); return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Wishlist/Model/Item/Option.php b/app/code/core/Mage/Wishlist/Model/Item/Option.php index b618988168d..595f7311e89 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/Observer.php b/app/code/core/Mage/Wishlist/Model/Observer.php index ab84546cd0c..c0553510f8a 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 e65a41482dc..d99c806ad53 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 a76f284aeb0..00df05275b4 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) */ 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 d43a80f67fe..4a831fb9adc 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 ea934a33091..2539e26870b 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/Wishlist.php b/app/code/core/Mage/Wishlist/Model/Resource/Wishlist.php index a0bf5a529da..2c00d53f48d 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) */ 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 c5c4f3a7f3e..f480a663629 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) */ diff --git a/app/code/core/Mage/Wishlist/Model/Session.php b/app/code/core/Mage/Wishlist/Model/Session.php index 0e8f11bef7e..1087e78aa09 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 d51edbed1e0..001674e7659 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) */ diff --git a/app/code/core/Mage/Wishlist/controllers/IndexController.php b/app/code/core/Mage/Wishlist/controllers/IndexController.php index 653fcce9578..5d7218c306e 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) */ @@ -193,9 +193,7 @@ class Mage_Wishlist_IndexController extends Mage_Wishlist_Controller_Abstract Mage::helper('Mage_Wishlist_Helper_Data')->calculate(); - $message = $this->__('%1$s has been added to your wishlist. Click <a href="%2$s">here</a> to continue shopping', - $product->getName(), Mage::helper('Mage_Core_Helper_Data')->escapeUrl($referer) - ); + $message = $this->__('%1$s has been added to your wishlist. Click <a href="%2$s">here</a> to continue shopping', $product->getName(), Mage::helper('Mage_Core_Helper_Data')->escapeUrl($referer)); $session->addSuccess($message); } catch (Mage_Core_Exception $e) { diff --git a/app/code/core/Mage/Wishlist/controllers/SharedController.php b/app/code/core/Mage/Wishlist/controllers/SharedController.php index 47584a74da9..edc10be7f27 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) */ diff --git a/app/code/core/Mage/Wishlist/etc/adminhtml.xml b/app/code/core/Mage/Wishlist/etc/adminhtml.xml index 4680adf04f2..357419f25b7 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 503870f0a2f..43262e7cab5 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 50b71d97e40..19ab364e4c6 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/etc/view.xml b/app/code/core/Mage/Wishlist/etc/view.xml index 0f625535658..d5739b58682 100644 --- a/app/code/core/Mage/Wishlist/etc/view.xml +++ b/app/code/core/Mage/Wishlist/etc/view.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 de2e689d27d..42fd33a5f27 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/view/frontend/email/items.phtml b/app/code/core/Mage/Wishlist/view/frontend/email/items.phtml index 435d33624dd..e1f36fd9327 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/email/items.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/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/code/core/Mage/Wishlist/view/frontend/email/rss.phtml b/app/code/core/Mage/Wishlist/view/frontend/email/rss.phtml index 40f3a1bb0c9..4e634735bfd 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/email/rss.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/email/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/code/core/Mage/Wishlist/view/frontend/item/configure/addto.phtml b/app/code/core/Mage/Wishlist/view/frontend/item/configure/addto.phtml index f62068e0c78..e6315249195 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/item/configure/addto.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/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) */ ?> diff --git a/app/code/core/Mage/Wishlist/view/frontend/layout.xml b/app/code/core/Mage/Wishlist/view/frontend/layout.xml index 1d11fe122ec..989c927c202 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/layout.xml +++ b/app/code/core/Mage/Wishlist/view/frontend/layout.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/code/core/Mage/Wishlist/view/frontend/options_list.phtml b/app/code/core/Mage/Wishlist/view/frontend/options_list.phtml index 18856d56e85..c484565b528 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/options_list.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/options_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_Wishlist_Block_Customer_Wishlist_Item_Options */ diff --git a/app/code/core/Mage/Wishlist/view/frontend/render/item/price.phtml b/app/code/core/Mage/Wishlist/view/frontend/render/item/price.phtml index cd91043ce67..06e7e9b7dcf 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/render/item/price.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/render/item/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) */ /* @var $this Mage_Wishlist_Block_Customer_Wishlist_Render_Item_Price */ diff --git a/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_item.phtml b/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_item.phtml index c4e0b7c0514..d61bdefc8cb 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_item.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/render/item/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/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_rss.phtml b/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_rss.phtml index 1b2a37776f2..f6e2838326e 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_rss.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/render/item/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/code/core/Mage/Wishlist/view/frontend/shared.phtml b/app/code/core/Mage/Wishlist/view/frontend/shared.phtml index 8b905ad6288..1cd048bd1bd 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/shared.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/shared.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_Wishlist */ diff --git a/app/code/core/Mage/Wishlist/view/frontend/sharing.phtml b/app/code/core/Mage/Wishlist/view/frontend/sharing.phtml index 29f72889e2e..333de2010b8 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/sharing.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/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) */ ?> diff --git a/app/code/core/Mage/Wishlist/view/frontend/sidebar.phtml b/app/code/core/Mage/Wishlist/view/frontend/sidebar.phtml index 5eff0770b15..e2f3f6b32eb 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/sidebar.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/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 */ diff --git a/app/code/core/Mage/Wishlist/view/frontend/view.phtml b/app/code/core/Mage/Wishlist/view/frontend/view.phtml index e0fe31f495e..4c89ddbb4aa 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/view.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/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) */ /* @var $this Mage_Wishlist_Block_Customer_Wishlist */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/History.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/History.php index bbb719a2974..a1522934bf6 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 e9765503c54..de8d2260a02 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 b3ece22a318..8f164b2c0ab 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 ec81fe9fba9..e2696f1c091 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 31b57232c3e..01010d4f7d7 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 6c1af9ac6ea..2318d01c851 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 94d3a475716..765c1ccef76 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 c105ea70438..4e66b32d255 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 ba2404019b8..25b98327523 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 5045b69c57f..ff110010fc3 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 5838bfe8194..e0adfde59c1 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 3f6efa5dd65..f9d42194983 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 dbb3c521ce4..7363fea6b04 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 f32953eb67d..ea7b43423e7 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 1911811edff..15ee00547ce 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 be2831fb802..e52bd729f3b 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 e204b4b8cec..b43c2d8498b 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 3157ecd99b0..bb743274b36 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 55ddfba566d..e155bbaf82b 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 b1b0ebb81c7..972733b98e3 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 39f7718f26e..94f5536e680 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 589b371e567..b34407245f9 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 31a172854f6..eca82073a94 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 078f5261da2..9e02ab392d4 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 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Addrow . '" value="'.$this->getEscapedValue() . '" ' . $this->serialize($this->getHtmlAttributes()) - . ' ><span>' + . ' ><span><span><span>' . $this->getEscapedValue() - . '</span></button>' + . '</span></span></span></button>' . $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 b4e7472c548..1bedd5149dc 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 75143b51d84..432cdc01042 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 cf421029ed9..0e4e4e15b7b 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 ab86d400b11..148f26ae4ba 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 55bcd454c2c..387d118db6c 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 4f4b464833c..0bf904b1dc3 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 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Page list($label, $element) = $this->getElements(); return $element->toHtml() . '</td><td class="label" style="width: 5em">' - . '<button class=" scalable save onclick_button" value="−"><span>' + . '<button class="scalable save onclick_button" value="−"><span><span><span>' . Mage::helper('Mage_XmlConnect_Helper_Data')->__('Delete') - . '</span></button>'; + . '</span></span></span></button>'; } } 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 29d4ceae673..a4af5231ade 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 aad6844dec7..40901de65d1 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 b0fc01f65a8..f89e92ae009 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 516ae1377ec..8764eb13979 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 feb73832ba7..c786558dfd2 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 feda288c594..2b4fd85bfe3 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 ca128df55a5..a47d9fa97b4 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 6a002bef8fd..ece95470338 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 c68925f62d6..324b717b767 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 e9ae209f379..3d426273b09 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 796ada4d0b7..1a99d008a47 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 edaefabc954..88ce204c4f3 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 b7725239ce0..0cd27832792 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 864ede27909..22e87602d1a 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 0fa378b3f72..abf8c39ee22 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 bbb0d7d9e02..a9b0e60054f 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 0ab9e70206c..57a0d077b2e 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 e931b16fc80..8a2051a1903 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 642bb7f25d2..ecfaef1b180 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 4c550dc62c3..d7e64838d19 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 b094db007e9..622ba3b850b 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 d0e8ca4396e..5f38dbda857 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 29639ebcad3..d327133c999 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 7e28ee3e6ae..b646151319f 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 c097e2881c1..726ce287d3f 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 622603e8094..4e0974a2412 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 7e276a6eab1..1a171780c69 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 ba984a626df..98f6ca0c2db 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 a99f8e85d49..3940eb474b1 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 f26cc93edfd..054cc663c7d 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 bb47be885bb..be448d7b66c 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 e2f3fce37b5..d51810f6e72 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 26b9aaa5af4..5167a89c9f1 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 51b7d068e8a..d52ecd73476 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 5de14c3a731..104174315d7 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) */ @@ -62,7 +62,7 @@ class Mage_XmlConnect_Block_Cart extends Mage_Checkout_Block_Cart_Abstract $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( @@ -192,27 +192,27 @@ class Mage_XmlConnect_Block_Cart extends Mage_Checkout_Block_Cart_Abstract /** * 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 7f24a28af5a..0ede156381e 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) */ @@ -55,7 +55,7 @@ class Mage_XmlConnect_Block_Cart_Crosssell extends Mage_Checkout_Block_Cart_Cros /** @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('Mage_Catalog_Helper_Image')->init($product, 'thumbnail') ->resize(Mage::helper('Mage_XmlConnect_Helper_Image')->getImageSizeForContent('product_small')); @@ -70,12 +70,13 @@ class Mage_XmlConnect_Block_Cart_Crosssell extends Mage_Checkout_Block_Cart_Cros /** * 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 { @@ -96,4 +97,4 @@ class Mage_XmlConnect_Block_Cart_Crosssell extends Mage_Checkout_Block_Cart_Cros } return $crossSellXmlObj->asNiceXml(); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Info.php b/app/code/core/Mage/XmlConnect/Block/Cart/Info.php index bd9b26600f0..2f8089ee98c 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 c2b08b50279..b7d8e7bdefc 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) */ @@ -94,7 +94,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_ $exclPrice = $_item->getRowTotal(); } $exclPrice = $this->_formatPrice($exclPrice); - $subtotalXmlObj->addAttribute('excluding_tax', $subtotalXmlObj->xmlentities($exclPrice)); + $subtotalXmlObj->addAttribute('excluding_tax', $subtotalXmlObj->escapeXml($exclPrice)); } if ($taxHelper->displayCartPriceInclTax() || $taxHelper->displayCartBothPrices()) { @@ -109,7 +109,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_ } $inclPrice = $this->_formatPrice($inclPrice); - $subtotalXmlObj->addAttribute('including_tax', $subtotalXmlObj->xmlentities($inclPrice)); + $subtotalXmlObj->addAttribute('including_tax', $subtotalXmlObj->escapeXml($inclPrice)); } if ($weeeHelper->getApplied($_item)) { @@ -154,7 +154,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_ } $exclPrice = $this->_formatPrice($exclPrice); - $priceXmlObj->addAttribute('excluding_tax', $priceXmlObj->xmlentities($exclPrice)); + $priceXmlObj->addAttribute('excluding_tax', $priceXmlObj->escapeXml($exclPrice)); } if ($this->helper('Mage_Tax_Helper_Data')->displayCartPriceInclTax() @@ -171,7 +171,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_ } $inclPrice = $this->_formatPrice($inclPrice); - $priceXmlObj->addAttribute('including_tax', $priceXmlObj->xmlentities($inclPrice)); + $priceXmlObj->addAttribute('including_tax', $priceXmlObj->escapeXml($inclPrice)); } if (Mage::helper('Mage_Weee_Helper_Data')->getApplied($_item)) { @@ -244,10 +244,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_ } $totalExcl = $this->_formatPrice($totalExcl); - $priceXmlObj->addAttribute( - 'total_excluding_tax', - $priceXmlObj->xmlentities($totalExcl) - ); + $priceXmlObj->addAttribute('total_excluding_tax', $priceXmlObj->escapeXml($totalExcl)); } if ($typeOfDisplay2 && $_item->getWeeeTaxAppliedAmount()) { @@ -258,7 +255,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_ } $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/Item/Renderer/Configurable.php b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Configurable.php index 109d55da6de..cbb4d713be6 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 49e539e4c62..9d4a0870fce 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 59561df5b87..b2be761c90f 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 4ae4debe28e..8075daa127e 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 60c408b6179..16f70fd6e2e 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 4803a82aa77..0640cd87ece 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 0453a5f78fa..76995d4a71d 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) */ @@ -112,7 +112,7 @@ class Mage_XmlConnect_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Totals $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('Mage_XmlConnect_Helper_Data')->formatPriceForXml($cardCode['a']); $formattedValue = $this->getQuote()->getStore()->formatPrice($value, false); @@ -149,7 +149,7 @@ class Mage_XmlConnect_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Totals { $value = Mage::helper('Mage_XmlConnect_Helper_Data')->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 0ee1a1953da..8147086631d 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) */ @@ -67,7 +67,7 @@ class Mage_XmlConnect_Block_Catalog extends Mage_Core_Block_Template $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 30c9e88c120..3f40326ae90 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) */ @@ -78,7 +78,7 @@ class Mage_XmlConnect_Block_Catalog_Category extends Mage_XmlConnect_Block_Catal $item = Mage::getModel('Mage_Catalog_Model_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 7ecc09b293f..535f46bb862 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) */ @@ -50,7 +50,7 @@ class Mage_XmlConnect_Block_Catalog_Category_Info extends Mage_XmlConnect_Block_ */ $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 908dde3513d..436929f5d6c 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) */ @@ -51,14 +51,14 @@ class Mage_XmlConnect_Block_Catalog_Filters extends Mage_XmlConnect_Block_Catalo 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 0bf4810baa0..b403c22197d 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) */ @@ -46,9 +46,9 @@ class Mage_XmlConnect_Block_Catalog_Product extends Mage_XmlConnect_Block_Catalo $item = Mage::getModel('Mage_XmlConnect_Model_Simplexml_Element', '<' . $itemNodeName . '></' . $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('Mage_XmlConnect_Helper_Data')->htmlize($item->xmlentities($product->getDescription())); $item->addChild('description', $description); $item->addChild('link', $product->getProductUrl()); @@ -81,7 +81,8 @@ class Mage_XmlConnect_Block_Catalog_Product extends Mage_XmlConnect_Block_Catalo /** * 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()); @@ -159,4 +160,4 @@ class Mage_XmlConnect_Block_Catalog_Product extends Mage_XmlConnect_Block_Catalo return $productXmlObj->asNiceXml(); } -} +} \ No newline at end of file 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 0993b8d7cc6..24d1e633e5c 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 33cf9303b6a..f8196ca3c90 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 6e0e95660ac..638d599b174 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 40187b0e424..601e018e4c8 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) */ @@ -87,7 +87,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options extends Mage_XmlConnect_Bloc } $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 @@ class Mage_XmlConnect_Block_Catalog_Product_Options extends Mage_XmlConnect_Bloc 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('Mage_XmlConnect_Helper_Data')->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 5d437e4af1a..1149de2040b 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) */ @@ -80,7 +80,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Bundle extends Mage_XmlConne } $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 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Bundle extends Mage_XmlConne $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 652a614256d..7918147166b 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) */ @@ -131,13 +131,13 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Configurable extends Mage_Xm $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 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Configurable extends Mage_Xm $_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/Giftcard.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Giftcard.php index 0760b5cd4d8..bf77b737a57 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 0418908d718..4c4e154ddca 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) */ @@ -68,7 +68,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Grouped extends Mage_XmlConn $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/Options/Simple.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php index a4e1d42e0e1..a30022fb199 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 8c6b189cd6e..dedeb1f8536 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 47b47b9f0ea..0ab89777346 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 20f02386cc5..c6dc64a717f 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) */ @@ -104,7 +104,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $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 21a0878264e..3a1c2666506 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) */ @@ -102,7 +102,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B 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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B 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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B 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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B 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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B 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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B 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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B 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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B 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 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B 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/Price/Giftcard.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php index 8ab6419f6b7..bbdb69bb430 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 efcfe55ccdc..b7f1c281999 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 a1a28fb4aef..9a876d6c956 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) */ @@ -52,9 +52,9 @@ class Mage_XmlConnect_Block_Catalog_Product_Review extends Mage_XmlConnect_Block 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('Mage_XmlConnect_Helper_Data')->getDeviceType(); 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 e9189f76d42..666e957e97b 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 67e371c5930..a4f621da9b9 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) */ @@ -96,7 +96,7 @@ class Mage_XmlConnect_Block_Catalog_Search extends Mage_XmlConnect_Block_Catalog 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 @@ class Mage_XmlConnect_Block_Catalog_Search extends Mage_XmlConnect_Block_Catalog } $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 31b8f5ceb92..d46156adb77 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) */ @@ -58,7 +58,7 @@ class Mage_XmlConnect_Block_Catalog_Search_Suggest extends Mage_CatalogSearch_Bl $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 baec11a4352..a69a8cf4858 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) */ @@ -55,7 +55,7 @@ class Mage_XmlConnect_Block_Checkout_Address_Billing extends Mage_Checkout_Block } $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/Form.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php index 20ec75f1d3b..2beec2ad5e6 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 8e6c40a1e0e..f6b9d66968a 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) */ @@ -54,7 +54,7 @@ class Mage_XmlConnect_Block_Checkout_Address_Shipping extends Mage_Checkout_Bloc $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 84f6a37fb8b..6521d738856 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) */ @@ -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('Mage_XmlConnect_Model_Simplexml_Element', '<agreements></agreements>'); 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.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review.php index 87002da20ca..b1136a63732 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 77d8d5552aa..07801f06ef1 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) */ @@ -60,7 +60,7 @@ class Mage_XmlConnect_Block_Checkout_Order_Review_Info extends Mage_Checkout_Blo $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('Mage_XmlConnect_Helper_Image')->getImageSizeForContent('product_small') @@ -174,16 +174,15 @@ class Mage_XmlConnect_Block_Checkout_Order_Review_Info extends Mage_Checkout_Blo /** * 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/Authorizenet.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Authorizenet.php index 26d49c717f9..ced918a75b9 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 be19e88360a..d7bc8fa01af 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 0bdd7caeb4c..0cc603bf92f 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 5cc6f656f69..5769e517bab 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 5b49907254e..e0a006bd767 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 3cc288f1ab9..d7022533192 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 82a9ec85eb3..680d6230b21 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 807ef7d0694..2017fa0b267 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 1979debbd7e..f9d783d8dc0 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 ea2eec0dbb0..f20cb7cc97b 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 d0f6362706e..bd9b9557987 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 dd5080b97f9..c059afb4044 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 3b885046dc1..f721725c9eb 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 d614df0d699..1626d14502f 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 e3b652f5013..8bc7dfb4bc9 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 2c2a2eb51cd..710b094276a 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) */ @@ -289,7 +289,7 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_List extends Mage_Payment_Bl $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/Payment/Method/Paypal/Direct.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Direct.php index 1acace7b332..d3ccc54585c 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 ad219ffc962..b6d4b523044 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 7c4da4521f6..67ebc568fb3 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/Purchaseorder.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Purchaseorder.php index 200c36c5e98..a6a761e444f 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 48a6f63a03a..1aa392fd891 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 e1444ae4ce4..0cffb2dfb56 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) */ @@ -49,16 +49,16 @@ class Mage_XmlConnect_Block_Checkout_Shipping_Method_Available $_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('Mage_Tax_Helper_Data')->getShippingPrice( $_rate->getPrice(), diff --git a/app/code/core/Mage/XmlConnect/Block/Cms/Page.php b/app/code/core/Mage/XmlConnect/Block/Cms/Page.php index be878e71340..dabd59c7e29 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 100f691920e..983cac0e0d1 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 6fc1f1f6673..1010c5da400 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) */ @@ -250,12 +250,12 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad 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 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad 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 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad ); $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 6f62ef0c4df..d4492b64dd6 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) */ @@ -82,10 +82,8 @@ class Mage_XmlConnect_Block_Customer_Address_List extends Mage_Core_Block_Templa * @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 @@ class Mage_XmlConnect_Block_Customer_Address_List extends Mage_Core_Block_Templa 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 331397c30ad..164f4ee46e0 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) */ @@ -46,32 +46,32 @@ class Mage_XmlConnect_Block_Customer_Form extends Mage_Core_Block_Template $xmlModel = Mage::getModel('Mage_XmlConnect_Model_Simplexml_Element', '<node></node>'); //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 = ' - <field name="change_password" type="checkbox" label="' . $xmlModel->xmlentities($this->__('Change Password')) . '"/> + <field name="change_password" type="checkbox" label="' . $xmlModel->escapeXml($this->__('Change Password')) . '"/> </fieldset> <fieldset> - <field name="current_password" type="password" label="' . $xmlModel->xmlentities($this->__('Current Password')) . '"/> - <field name="password" type="password" label="' . $xmlModel->xmlentities($this->__('New Password')) . '"/> - <field name="confirmation" type="password" label="' . $xmlModel->xmlentities($this->__('Confirm New Password')) . '"> + <field name="current_password" type="password" label="' . $xmlModel->escapeXml($this->__('Current Password')) . '"/> + <field name="password" type="password" label="' . $xmlModel->escapeXml($this->__('New Password')) . '"/> + <field name="confirmation" type="password" label="' . $xmlModel->escapeXml($this->__('Confirm New Password')) . '"> <validators> - <validator type="confirmation" message="' . $xmlModel->xmlentities($this->__('Regular and confirmation passwords must be equal')) . '">password</validator> + <validator type="confirmation" message="' . $xmlModel->escapeXml($this->__('Regular and confirmation passwords must be equal')) . '">password</validator> </validators> </field> </fieldset>'; } else { $passwordManageXml = ' - <field name="password" type="password" label="' . $xmlModel->xmlentities($this->__('Password')) . '" required="true"/> - <field name="confirmation" type="password" label="' . $xmlModel->xmlentities($this->__('Confirm Password')) . '" required="true"> + <field name="password" type="password" label="' . $xmlModel->escapeXml($this->__('Password')) . '" required="true"/> + <field name="confirmation" type="password" label="' . $xmlModel->escapeXml($this->__('Confirm Password')) . '" required="true"> <validators> - <validator type="confirmation" message="' . $xmlModel->xmlentities($this->__('Regular and confirmation passwords must be equal')) . '">password</validator> + <validator type="confirmation" message="' . $xmlModel->escapeXml($this->__('Regular and confirmation passwords must be equal')) . '">password</validator> </validators> </field> </fieldset>'; @@ -80,11 +80,11 @@ class Mage_XmlConnect_Block_Customer_Form extends Mage_Core_Block_Template $xml = <<<EOT <form name="account_form" method="post"> <fieldset> - <field name="firstname" type="text" label="{$xmlModel->xmlentities($this->__('First Name'))}" required="true" value="$firstname" /> - <field name="lastname" type="text" label="{$xmlModel->xmlentities($this->__('Last Name'))}" required="true" value="$lastname" /> - <field name="email" type="text" label="{$xmlModel->xmlentities($this->__('Email'))}" required="true" value="$email"> + <field name="firstname" type="text" label="{$xmlModel->escapeXml($this->__('First Name'))}" required="true" value="$firstname" /> + <field name="lastname" type="text" label="{$xmlModel->escapeXml($this->__('Last Name'))}" required="true" value="$lastname" /> + <field name="email" type="text" label="{$xmlModel->escapeXml($this->__('Email'))}" required="true" value="$email"> <validators> - <validator type="email" message="{$xmlModel->xmlentities($this->__('Wrong email format'))}"/> + <validator type="email" message="{$xmlModel->escapeXml($this->__('Wrong email format'))}"/> </validators> </field> $passwordManageXml diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/GiftcardCheck.php b/app/code/core/Mage/XmlConnect/Block/Customer/GiftcardCheck.php index dd46184c0e4..12a467aaecc 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 21b23f6591c..f7067620988 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 01c67a1d5de..263b85982b1 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 f92d2721a4f..0a09e8a50bd 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 be8193579d3..d863d910b4f 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/Grouped.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Grouped.php index 80024e3b471..0cc93f53bc4 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 795509c56c6..3c6f03ac86a 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 7077c96dcf8..5564d0d71f4 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) */ @@ -67,7 +67,7 @@ class Mage_XmlConnect_Block_Customer_Order_List extends Mage_Core_Block_Template $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/Order/Totals.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals.php index f3333e7114d..557ce24094c 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/Tax.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Tax.php index bacca8d2337..70fbf92b4ba 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 733de723ea9..aaa280671e8 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) */ @@ -46,10 +46,8 @@ class Mage_XmlConnect_Block_Customer_Storecredit extends Mage_Core_Block_Templat $accountBalance = $this->getLayout() ->addBlock('Enterprise_CustomerBalance_Block_Account_Balance', 'account_balance'); - $customerBalanceHelper = Mage::helper('Enterprise_CustomerBalance_Helper_Data'); - $xmlModel->addCustomChild('balance', null, array( - 'label' => $customerBalanceHelper->__('Your current balance is:'), + 'label' => $this->__('Your current balance is:'), 'value' => $accountBalance->getBalance(), 'formatted_value' => Mage::helper('Mage_Core_Helper_Data')->currency($accountBalance->getBalance(), true, false) )); @@ -59,11 +57,11 @@ class Mage_XmlConnect_Block_Customer_Storecredit extends Mage_Core_Block_Templat 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) { @@ -88,4 +86,4 @@ class Mage_XmlConnect_Block_Customer_Storecredit extends Mage_Core_Block_Templat return $xmlModel->asNiceXml(); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/XmlConnect/Block/Home.php b/app/code/core/Mage/XmlConnect/Block/Home.php index 9335d0f1c4f..f03ca66742c 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) */ @@ -69,7 +69,7 @@ class Mage_XmlConnect_Block_Home extends Mage_XmlConnect_Block_Catalog /** @var $item Mage_Catalog_Model_Category */ $item = Mage::getModel('Mage_Catalog_Model_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('Mage_XmlConnect_Helper_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 e31130b338e..00c7fbd7140 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) */ @@ -55,7 +55,7 @@ class Mage_XmlConnect_Block_Review_Form extends Mage_Core_Block_Template $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 94bf474c182..f293f14413e 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) */ @@ -70,13 +70,14 @@ class Mage_XmlConnect_Block_Wishlist extends Mage_Wishlist_Block_Customer_Wishli $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 @@ class Mage_XmlConnect_Block_Wishlist extends Mage_Wishlist_Block_Customer_Wishli $file = Mage::helper('Mage_XmlConnect_Helper_Data')->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/Controller/Action.php b/app/code/core/Mage/XmlConnect/Controller/Action.php index 9bba39debce..1e38636849f 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 e4fa964c089..4ad8845b490 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 5799712ada0..33b32d16359 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 ea40a65c31b..ca3dd410957 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) */ @@ -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 7c8983e075d..c555e0abfa0 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) */ @@ -62,7 +62,7 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract $typesOfDisplay = $renderer->getTypesOfDisplay(); if ($isIncludeTax) { $nodeName = 'including_tax'; - $nodeLabel = $renderer->__('Incl. Tax'); + $nodeLabel = Mage::helper('Mage_Tax_Helper_Data')->__('Incl. Tax'); $inclPrice = $renderer->helper('Mage_Checkout_Helper_Data')->getPriceInclTax($item); $inclSubtotal = $renderer->helper('Mage_Checkout_Helper_Data')->getSubtotalInclTax($item); @@ -77,7 +77,7 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract $weeeParams['include'] = $inclPrice; } else { $nodeName = 'excluding_tax'; - $nodeLabel = $renderer->__('Excl. Tax'); + $nodeLabel = Mage::helper('Mage_Tax_Helper_Data')->__('Excl. Tax'); if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_14]) { $price = $item->getPrice() + $renderer->getWeeeTaxAppliedAmount() @@ -221,19 +221,19 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract ) { $qty = 1 * $item->getQtyOrdered(); if ($qty > 0) { - $quantityXml->addCustomChild('value', $qty, array('label' => $renderer->__('Ordered'))); + $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Ordered'))); } $qty = 1 * $item->getQtyShipped(); if ($qty > 0) { - $quantityXml->addCustomChild('value', $qty, array('label' => $renderer->__('Shipped'))); + $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Shipped'))); } $qty = 1 * $item->getQtyCanceled(); if ($qty > 0) { - $quantityXml->addCustomChild('value', $qty, array('label' => $renderer->__('Canceled'))); + $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Canceled'))); } $qty = 1 * $item->getQtyRefunded(); if ($qty > 0) { - $quantityXml->addCustomChild('value', $qty, array('label' => $renderer->__('Refunded'))); + $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Refunded'))); } } diff --git a/app/code/core/Mage/XmlConnect/Helper/Data.php b/app/code/core/Mage/XmlConnect/Helper/Data.php index 805c6620894..43b25799690 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) */ @@ -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 * @@ -425,7 +430,6 @@ class Mage_XmlConnect_Helper_Data extends Mage_Core_Helper_Abstract { $w3cUrl = 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'; return <<<EOT -<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "$w3cUrl"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> @@ -612,13 +616,13 @@ EOT; } try { - $appCode = $queue->getAppCode(); + $applicationId = Mage::getModel('Mage_XmlConnect_Model_Template')->load($queue->getTemplateId())->getApplicationId(); /** @var $app Mage_XmlConnect_Model_Application */ - $app = Mage::getModel('Mage_XmlConnect_Model_Application')->loadByCode($appCode); + $app = Mage::getModel('Mage_XmlConnect_Model_Application')->load($applicationId); if (!$app->getId()) { Mage::throwException( - Mage::helper('Mage_XmlConnect_Helper_Data')->__('Can\'t load application with code "%s"', $appCode) + Mage::helper('Mage_XmlConnect_Helper_Data')->__('Can\'t load application with id "%s"', $applicationId) ); } @@ -627,8 +631,6 @@ EOT; return; } - $userpwd = $app->getUserpwd(); - $sendType = $queue->getData('type'); switch ($sendType) { case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL: @@ -643,29 +645,21 @@ EOT; 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); @@ -676,12 +670,23 @@ EOT; /** * 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/Helper/Image.php b/app/code/core/Mage/XmlConnect/Helper/Image.php index 049b61f35ba..070d5a8e936 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 05a72371788..9458b472485 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 29827d45e37..a744e5d8a85 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/Theme.php b/app/code/core/Mage/XmlConnect/Helper/Theme.php index 63855dbae37..61cf16e9276 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) */ 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 a8ebefe46b6..b92be073efc 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 8802f1f30c4..a4f7a7452fe 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 61677907c3a..0b9e7dff75b 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 d54cd9a7998..220133eaed4 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 f4b47d32c5f..7b99a5fc004 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 6154d18b2d4..2aa05b250b6 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 94b4c97b95a..54143db9c58 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/Observer.php b/app/code/core/Mage/XmlConnect/Model/Observer.php index edd3882ed5d..e1f3dd5c683 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) */ @@ -112,8 +112,7 @@ class Mage_XmlConnect_Model_Observer foreach ($collection as $message) { if ($message->getId()) { Mage::helper('Mage_XmlConnect_Helper_Data')->sendBroadcastMessage($message); - $message->save(); } } } -} +} \ No newline at end of file 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 30ff9fab3ee..9088db2f0c0 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 fc131055fbf..5193aa2bda0 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 3697ee83bed..beaf1e457ce 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 02ce8c2ead2..ef4cc78dde4 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 386339e7b23..4d130118f73 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 b331cffee24..f2d54c93b0f 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 275b65b639a..29adb132442 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 dd0a124a601..a87c55d2a5f 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 9a946e12e55..ecb427aad0d 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 9518b9d22bc..a1aa5eed28b 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 eabdf1efc53..acd83b42a70 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 73fc0740cff..76a2f261723 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 46fd005de2f..c81b2066291 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 d362abf839a..98933031af4 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 0d821787938..99ccc99686b 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 99f73c25f1a..375a6fb43a4 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 fb7d929e9a4..ff8902b2c83 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 fc6e369e4f2..8a88027cc18 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 da3046042f1..f12c1c70f96 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 be70461365c..3b7209ed6c2 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 38fd7259054..132cd9817ef 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 68a50a1d484..f26503c2f65 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 d6670cb6384..acd309be248 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 67aea94c7ac..884e07ad829 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) */ @@ -60,18 +60,55 @@ class Mage_XmlConnect_Model_Simplexml_Element extends Varien_Simplexml_Element 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('Mage_Core_Helper_Data')->stripTags($item, $allowedTags); + } + $result[] = $this->xmlentities($item); + } + } else { + if (is_null($data)) { + $data = $this; + } + $data = (string)$data; + + if ($stripTags) { + $data = Mage::helper('Mage_Core_Helper_Data')->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('Mage_Core_Helper_Data')->stripTags($value); + } $value = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $value); return $value; } diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form.php index 8e58472a9e1..1fcc360ca79 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 84f7cb2fca9..819e5765372 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) */ @@ -182,7 +182,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Abstract extends Varien_Object public function getElements() { if (empty($this->_elements)) { - $this->_elements = Mage::getModel('Mage_XmlConnect_Model_Simplexml_Form_Element_Collection'); + $this->_elements = Mage::getModel('Mage_XmlConnect_Model_Simplexml_Form_Element_Collection', $this); } return $this->_elements; } 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 2aed90b3343..c7be7c237a9 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 62bf94a76bd..ee8fc1605c1 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 0694dd4d9ad..1ea98bb64fa 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 69e54c017fd..86ecc27e7f9 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 921364960ff..27797d28439 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 382b75fdcc9..6b00f4b2efb 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 aa6fa3c0e04..865f50d00b9 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 286b8ef8f4a..d58c73f06b2 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 ca7570af629..3203054ec19 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 3936345f9cc..4128f130d72 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 7349989dca9..2dbc66dad8f 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 c71fd3795a9..cf5bdbe481c 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 7eda8e14d2e..ac5c798b3f5 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 c664e9c4e0e..38d96a3c736 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 92e1b3c9dae..b342fe9cce8 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 5449685a94a..9faec81d938 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 c592fc28ed4..de63badd5c8 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) */ @@ -71,22 +71,21 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_Validator_Abstract */ protected function _setDefaultValidatorTypeMessages() { - $helper = Mage::helper('Mage_XmlConnect_Helper_Data'); $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('Mage_XmlConnect_Helper_Data')->__('Text length does not satisfy specified min text range.'), + 'max_length' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Text length does not satisfy specified max text range.'), + 'alphanumeric' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('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('Mage_XmlConnect_Helper_Data')->__('Please enter a valid email address. For example johndoe@domain.com.'), + 'required' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('This is a required field.'), + 'required_select' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Please select an option.'), + 'numeric' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.'), + 'alpha' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Please use letters only (a-z or A-Z) in this field.'), + 'url' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Please enter a valid URL. Protocol is required (http://, https:// or ftp://)'), + 'date' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Please enter a valid date.'), + 'max_file_size' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('\'%s\' exceeds the allowed file size: %d (bytes)', $this->getFieldLabel(), $this->getValue()), + 'file_extensions' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('\'%s\' is not a valid file extension. Allowed extensions: %s', $this->getFieldLabel(), $this->getValue()), + 'max_image_width' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('\'%s\' width exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue()), + 'max_image_height' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('\'%s\' height exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue()) ); return $this; } 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 bd47829a6f2..0eee1fcf729 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 fbb8232ff93..9bd968fbd59 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 bd11e9e7241..017f1c89072 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 c855922f8bc..54d22bf259d 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 5b3df9be47e..eac013491f1 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) */ @@ -317,25 +317,29 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll protected function _processPostRequest() { try { + /** @var $app Mage_XmlConnect_Model_Application */ $app = Mage::helper('Mage_XmlConnect_Helper_Data')->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 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll } if (isset($template)) { - $appCode = $template->getAppCode(); + $applicationId = $template->getApplicationId(); } else { - $appCode = Mage::getModel('Mage_XmlConnect_Model_Template')->load($message->getTemplateId())->getAppCode(); + $applicationId = Mage::getModel('Mage_XmlConnect_Model_Template')->load($message->getTemplateId())->getApplicationId(); } /** @var $app Mage_XmlConnect_Model_Application */ - $app = Mage::getModel('Mage_XmlConnect_Model_Application')->loadByCode($appCode); + $app = Mage::getModel('Mage_XmlConnect_Model_Application')->load($applicationId); if(!$app->isNotificationsActive()) { $this->_getSession()->addError( diff --git a/app/code/core/Mage/XmlConnect/controllers/CartController.php b/app/code/core/Mage/XmlConnect/controllers/CartController.php index 8231e99f98b..ea9ac81dc55 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 ce777ba1638..99cac50163f 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) */ @@ -295,14 +295,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio $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 3a36dee0234..8547d9ba40d 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) */ @@ -333,8 +333,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti 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(); @@ -344,8 +343,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti $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/CmsController.php b/app/code/core/Mage/XmlConnect/controllers/CmsController.php index 0ea582df1ed..e9618778b3b 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 a8af5651f8c..2495bdd5304 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 9b7f939e5e1..6ae3b82aaf1 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) */ @@ -367,7 +367,6 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti 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/IndexController.php b/app/code/core/Mage/XmlConnect/controllers/IndexController.php index f4c8c2281b6..b5c90257cb5 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 edf2469cddc..e10fdeac172 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 f985c33567d..0444e45eb52 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 1b98b041f46..b8eb39d6af9 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) */ @@ -60,9 +60,7 @@ class Mage_XmlConnect_PbridgeController extends Mage_Core_Controller_Front_Actio 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/controllers/ReviewController.php b/app/code/core/Mage/XmlConnect/controllers/ReviewController.php index 1f15cfc062d..cef3132ed12 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 5c51f3c6f60..91d04a3f9a8 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 8eb579cc59a..2ae741a4205 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 87a1460f140..7d2712e0099 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) */ --> @@ -29,7 +29,7 @@ <modules> <Mage_XmlConnect> <version>1.6.0.0</version> - <innerVersion>22.0</innerVersion> + <innerVersion>22.1</innerVersion> </Mage_XmlConnect> </modules> <global> @@ -359,6 +359,7 @@ </screen_size> <xmlconnect> <mobile_application> + <curl_ssl_verifypeer>1</curl_ssl_verifypeer> <magentocommerce_url>www.magentocommerce.com/products/index.php/mobile/activate/index/key/</magentocommerce_url> <activation_key_url>http://www.magentocommerce.com/product/mobile</activation_key_url> <resubmission_key_url>http://www.magentocommerce.com/product/mobile#resubmission</resubmission_key_url> diff --git a/app/code/core/Mage/XmlConnect/etc/system.xml b/app/code/core/Mage/XmlConnect/etc/system.xml index cc5cae9e3d3..5958369b948 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 d8c449bd7d7..74c9f48c814 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 91bc7204182..bd6f134a372 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 d7f42d4f6c1..fdfe64bc47c 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 29c9a52ad27..afc7e3dc0d9 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 71e571ad926..186d6f79a14 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 f9f41045f60..20b0f3b0ac0 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/view/adminhtml/css/boxes.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/boxes.css index 009b40ae030..9b2da1ef36f 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/boxes.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/boxes.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/view/adminhtml/css/dropdown.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/dropdown.css index f5d294c84f1..7332ae2807e 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/dropdown.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/dropdown.css @@ -19,7 +19,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) */ .dropdown { float:left; width:200px; border:1px solid #ccc; position:relative; } diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-android.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-android.css index f7ad7b3e079..ae84a060b17 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-android.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-android.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/view/adminhtml/css/mobile-catalog.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-catalog.css index 93b74201968..d9392c8c419 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-catalog.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-catalog.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/view/adminhtml/css/mobile-home.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-home.css index fc2fcf355ce..b3a9170a11e 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-home.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-home.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/view/adminhtml/css/mobile-ipad-catalog.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-catalog.css index b9c60964786..1548ec01ceb 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-catalog.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-catalog.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/view/adminhtml/css/mobile-ipad-home.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-home.css index 2c5dbad9fdc..edcea0430c5 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-home.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-home.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento 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/view/adminhtml/css/styles.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/styles.css index eed238eae9c..e0006753725 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/styles.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/styles.css @@ -19,7 +19,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) */ .wrapper { min-width:1150px !important; } diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design.phtml index 4b51138652a..f8de94e6cef 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_android.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_android.phtml index de09851d3ef..96dfd17ae19 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_android.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_hor_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_hor_ipad.phtml index e62d30825b0..ac57e9f5fe3 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_hor_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_ipad.phtml index edfa4d520b0..5839adb6843 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_iphone.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_iphone.phtml index f64ad2f02ac..9509d952dbb 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_iphone.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_android.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_android.phtml index a7cced5ed61..fbf816c234b 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_android.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_hor_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_hor_ipad.phtml index 8c68c6ad887..2d405e69793 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_hor_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_ipad.phtml index 83ef2fb6fa1..15c0e6a2446 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_iphone.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_iphone.phtml index e70dd83d5e9..ccd918156da 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_iphone.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/productinfo_iphone.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/productinfo_iphone.phtml index 2dc6bbc94fc..6ebf1ac8897 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/productinfo_iphone.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_android.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_android.phtml index 752bfc6c50e..6630dc34c62 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_android.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_ipad.phtml index 4007dc2ae5a..6bc2cebee2c 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_iphone.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_iphone.phtml index 6b74b21aa94..f9ad024843e 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_iphone.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_android.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_android.phtml index 1fdd5c9a967..086d86d9f3e 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_android.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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 @@ <div id="XmlconnectThemePreview"></div> <div class="mm-box-blue a-center" style="width:285px;"> - <button type="button" class="scalable" onclick="updatePreview()"><span><?php echo $this->__('Update Preview');?></span></button> + <button type="button" class="scalable" onclick="updatePreview()"><span><span><span><?php echo $this->__('Update Preview');?></span></span></span></button> <p><br />To preview the newly uploaded images, please save your application first.</p> </div> <div class="mm-pager"> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_ipad.phtml index 29415067ec2..99303986d77 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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 @@ <div id="XmlconnectThemePreview" class="ipad-portrait"></div> <div id="ipad-tab-orientation" class="mm-box-blue a-center ipad-tab-portrait"> - <button type="button" class="scalable" onclick="updatePreview()"><span><?php echo $this->__('Update Preview');?></span></button> - <button type="button" class="scalable" onclick="changeOrientation()"><span><?php echo $this->__('Change Orientation');?></span></button> + <button type="button" class="scalable" onclick="updatePreview()"><span><span><span><?php echo $this->__('Update Preview');?></span></span></span></button> + <button type="button" class="scalable" onclick="changeOrientation()"><span><span><span><?php echo $this->__('Change Orientation');?></span></span></span></button> <p><br />To preview the newly uploaded images, please save your application first.</p> </div> <div class="mm-pager" style="padding-left:60px;"> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_iphone.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_iphone.phtml index aa8c1976db6..c5a7281591d 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_iphone.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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 @@ <div id="XmlconnectThemePreview"></div> <div class="mm-box-blue a-center" style="width:285px;"> - <button type="button" class="scalable" onclick="updatePreview()"><span><?php echo $this->__('Update Preview');?></span></button> + <button type="button" class="scalable" onclick="updatePreview()"><span><span><span><?php echo $this->__('Update Preview');?></span></span></span></button> <p><br />To preview the newly uploaded images, please save your application first.</p> </div> <div class="mm-pager"> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/addrow.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/addrow.phtml index 5235ede1881..b25da331c74 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/addrow.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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 '<button id="'+id+'" class=" scalable save onclick_button" value="−">' - +'<span><?php echo $this->__('Delete'); ?></span></button>'; + return '<button id="'+id+'" class="scalable save onclick_button" value="−">' + +'<span><span><span><?php echo $this->__('Delete'); ?></span></span></span></button>'; } /** diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_android.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_android.phtml index ed2bda19d4a..ef5be042baf 100755 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_android.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_ipad.phtml index 08c83c6f986..37ed6123cf5 100755 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_iphone.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_iphone.phtml index bef6d431e2c..1a66487dbf5 100755 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_iphone.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/androidmarket.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/androidmarket.phtml index 5e5544a90ad..08ace20ee42 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/androidmarket.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/istore.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/istore.phtml index c5001357944..a6d3360d076 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/istore.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/form/element/themes.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/themes.phtml index d8c872bbad3..f51ab6e632a 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/themes.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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() { <div class="form-buttons" style="float:right"> <button type="button" class="scalable" id="save_theme" onclick="saveTheme();"> - <span><?php echo $this->__('Save Theme'); ?></span> + <span><span><span><?php echo $this->__('Save Theme'); ?></span></span></span> </button> <button type="button" class="scalable" id="save_as_theme_init"> - <span><?php echo $this->__('Save As'); ?></span> + <span><span><span><?php echo $this->__('Save As'); ?></span></span></span> </button> </div> @@ -516,10 +516,10 @@ function deleteTheme() { <input id="input_save_as" type="text" class="input-text" name="input_save_as" autocomplete="off" value="" /> <div class="validation-advice" id="advice-required-theme-name" style="display:none;"><?php echo $this->__('Theme label can\'t be empty'); ?></div> <button type="button" class="scalable save" id="save_as_theme"> - <span><?php echo $this->__('Save'); ?></span> + <span><span><span><?php echo $this->__('Save'); ?></span></span></span> </button> <button type="button" class="scalable" id="save_as_theme_cancel"> - <span><?php echo $this->__('Cancel'); ?></span> + <span><span><span><?php echo $this->__('Cancel'); ?></span></span></span> </button> </div> </div> @@ -601,11 +601,11 @@ $id2observe = array(); <div class="reset-theme"> <button id="reset_theme" type="button" class="scalable"> - <span><?php echo $this->__('Reset theme to default'); ?></span> + <span><span><span><?php echo $this->__('Reset theme to default'); ?></span></span></span> </button> <button id="delete_theme" type="button" class="scalable delete"> - <span><?php echo $this->__('Delete theme'); ?></span> + <span><span><span><?php echo $this->__('Delete theme'); ?></span></span></span> </button> <div id="reset_note" style="display:none;"><?php echo $this->__('Only default theme can be reset'); ?></div> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-catalog.css b/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-catalog.css index f3a499853ae..e1ab1fc4b99 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-catalog.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-catalog.css @@ -19,7 +19,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) */ body { margin: 0; padding: 0 } diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-home.css b/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-home.css index 00c25521e35..60c8ea9698a 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-home.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-home.css @@ -19,7 +19,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) */ body { margin: 0; padding: 0 } diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/layout.xml b/app/code/core/Mage/XmlConnect/view/adminhtml/layout.xml index e744dd6fd0d..a40ee8c3ec5 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/layout.xml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/layout.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/code/core/Mage/XmlConnect/view/adminhtml/mobile/notification_helper.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/mobile/notification_helper.phtml index ff65bbe1515..10852de298a 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/mobile/notification_helper.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/submission/app_icons_preview.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/submission/app_icons_preview.phtml index 4b87ce3c33d..a4b3cca9770 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/submission/app_icons_preview.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/submission/container.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/submission/container.phtml index 86980133bb1..dc8a3dcb146 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/submission/container.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/adminhtml/template/preview.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/template/preview.phtml index 66930b8fe97..3564334a102 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/template/preview.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/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/code/core/Mage/XmlConnect/view/frontend/layout.xml b/app/code/core/Mage/XmlConnect/view/frontend/layout.xml index 9ee5bfdfe2f..9b7b0128440 100644 --- a/app/code/core/Mage/XmlConnect/view/frontend/layout.xml +++ b/app/code/core/Mage/XmlConnect/view/frontend/layout.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/code/core/Mage/XmlConnect/view/frontend/pbridge/result.phtml b/app/code/core/Mage/XmlConnect/view/frontend/pbridge/result.phtml index ccb79a85327..7d1c317a49a 100755 --- a/app/code/core/Mage/XmlConnect/view/frontend/pbridge/result.phtml +++ b/app/code/core/Mage/XmlConnect/view/frontend/pbridge/result.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/code/core/Zend/Date.php b/app/code/core/Zend/Date.php new file mode 100644 index 00000000000..1992f51bdb0 --- /dev/null +++ b/app/code/core/Zend/Date.php @@ -0,0 +1,5008 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * 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@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Date + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: Date.php 22713 2010-07-29 11:41:56Z thomas $ + */ + +/** + * Include needed Date classes + */ +#require_once 'Zend/Date/DateObject.php'; +#require_once 'Zend/Locale.php'; +#require_once 'Zend/Locale/Format.php'; +#require_once 'Zend/Locale/Math.php'; + +/** + * This class replaces default Zend_Date because of problem described in Jira ticket MAGE-4872 + * The only difference between current class and original one is overwritten implementation of mktime method + * + * @category Zend + * @package Zend_Date + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Date extends Zend_Date_DateObject +{ + private $_locale = null; + + // Fractional second variables + private $_fractional = 0; + private $_precision = 3; + + private static $_options = array( + 'format_type' => '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/local.xml b/app/design/adminhtml/default/default/local.xml index 91889db1350..9a8889f9f5e 100644 --- a/app/design/adminhtml/default/default/local.xml +++ b/app/design/adminhtml/default/default/local.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/skin/default/below_ie7.css b/app/design/adminhtml/default/default/skin/default/below_ie7.css index 1ce5d15b22f..537a1cf8fc5 100644 --- a/app/design/adminhtml/default/default/skin/default/below_ie7.css +++ b/app/design/adminhtml/default/default/skin/default/below_ie7.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* Set min-width */ diff --git a/app/design/adminhtml/default/default/skin/default/boxes.css b/app/design/adminhtml/default/default/skin/default/boxes.css index 681cb8f2631..dbaac45d1bb 100644 --- a/app/design/adminhtml/default/default/skin/default/boxes.css +++ b/app/design/adminhtml/default/default/skin/default/boxes.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -90,9 +90,9 @@ position:fixed; top:45%; left:50%; - width:120px; - margin-left:-60px; - padding:15px 60px; + width:150px; + margin-left:-105px; + padding:15px 30px; background:#fff4e9; border:2px solid #f1af73; color:#d85909; @@ -134,6 +134,9 @@ .grid th { white-space:nowrap; } .grid td.editable input.input-text { width:50px !important; margin-left:4px !important; } .grid td input.input-text { width:86%; } +.grid td input.input-text-export-filter { width:272px; } +.grid td input.input-text-range { width:104px; } +.grid td input.input-text-range-date { width:87px; } .grid td input.input-inactive { background:#eee; } .grid table td { border-width:0 1px 1px 0; border-color:#dadfe0; border-style:solid; } .grid table.border td { background:#fff !important; } @@ -205,7 +208,9 @@ table.actions td { vertical-align:top; } .grid tr.filter .range select { float:right; width:56px !important; margin-top:0; } .grid tr.filter .range .label { display:block; width:36px; float:left; padding-left:2px; } .grid tr.filter .date img { width:15px; height:15px; cursor:pointer; vertical-align:middle; } -.grid .head-massaction select { width:50px !important; } +.grid .head-massaction select { width:auto !important; max-width:90px; } +.grid select.select-export-filter, +.grid select.multiselect-export-filter { width:278px; } /* Grid Footer */ .grid table tfoot tr { background:#D7E5EF; } @@ -270,7 +275,7 @@ ul.tabs a.changed { font-style:italic; } ul.tabs-horiz { margin:0 0 18px 0; background:url(images/horiz_tabs_ul_bg.gif) repeat-x 0 100% #f8f8f8; padding:8px 0 0 5px; } ul.tabs-horiz li { float:left; margin:0 4px; } ul.tabs-horiz li a { display:block; background:#e2e2e2; border:1px solid #ccc; padding:2px 10px; color:#333 !important; text-decoration:none !important; } -ul.tabs-horiz li a.notloaded { color:#999 !important; } +ul.tabs-horiz li a.notloaded { /* not used for now */ } ul.tabs-horiz li a.active { border-bottom:1px solid #fff; background:#fff; } @@ -335,6 +340,7 @@ table.form-edit { width:100%; } label.inline { float:none !important; width:auto !important; } .nested-content .entry-edit { margin-left:2em; } .nested-content .entry-edit .entry-edit { margin-left:0; } +#coupon_container .entry-edit { min-width:310px; } /* Form Elements */ input.input-text,textarea,select { border-width:1px; border-style:solid; border-color:#aaa #c8c8c8 #c8c8c8 #aaa; background:#fff; font:12px arial, helvetica, sans-serif; } @@ -352,7 +358,10 @@ select.multiselect option { padding:3px 4px; border-bottom:1px solid #ddd; .field-100 { background-color:#fff; border-width:1px; border-style:solid; border-color:#aaa #c8c8c8 #c8c8c8 #aaa; padding:2px; } .field-100 textarea, .field-100 input.input-text { float:left; width:100% !important; border:0 !important; padding:0 !important; } - +@media screen and (-webkit-min-device-pixel-ratio:0) { + select option:disabled, + select:disabled option { color:#c9c9c9!important;color:#cacaca!important; text-shadow:2px 2px 2px #000; } +} /* Form List */ /* Table for default form data */ .form-list { width:auto; border:0 !important; } @@ -369,6 +378,7 @@ select.multiselect option { padding:3px 4px; border-bottom:1px solid #ddd; .form-list td.value textarea { width:274px; } .form-list td.value textarea { height:15em; } .form-list td.value select { width:280px; } +.form-list td.value select.select-date { width:87px; } .form-list td.note { background:url(images/note_cell_bg.gif) 6px 10px no-repeat !important; padding-left:18px; } .form-list td.scope-label { padding-left:5px; color:#6f8992; font-size:.9em; } .form-list p.note { margin:0; padding:0 0 0 13px; background:url(images/note_bg.gif) 1px 6px no-repeat; font-size:11px; } @@ -403,7 +413,7 @@ span.delete-file { padding:0; } /* Form Button */ .content-buttons.form-buttons, -.content-header .form-buttons { text-align:right; margin-bottom:0; white-space:nowrap; } +.content-header .form-buttons { text-align:right; margin-bottom:0; } .content-header .content-buttons-placeholder { display:inline !important; } .content-header .form-buttons { float:right; } .content-header td.form-buttons { float:none; } @@ -414,6 +424,7 @@ button, button:hover { background:#f77c16 url(images/btn_over_bg.gif) repeat-x 0 0; } button:active { background:#f77c16 url(images/btn_on_bg.gif) repeat-x 0 0; } button span { line-height:1.35em; background-repeat:no-repeat; background-position:0 50%; } +button span span { background:none !important; padding:0 !important; margin:0 !important; display:inline !important; } button.delete, button.save, button.add { padding-left:6px; } @@ -424,12 +435,18 @@ button.add span, button.back span, button.add-image span, button.add-widget span { padding-left:20px; } +/* Google Chrome specific fix for empty buttons */ +button.add span:after, +button.delete span:after { display:inline-block; clear:both; content:"."; font-size:0; line-height:0; height:0; overflow:hidden; } button.back { border-color:#ccc #aaa #aaa #ccc; background-color:#fff; background-image:url(images/btn_back_bg.gif); color:#555; } button.back span { background-image:url(images/icon_btn_back.gif); } +button.fail, button.cancel, button.delete { border-color:#d24403 #a92000 #a92000 #d24403; background-image:url(images/cancel_btn_bg.gif); background-color:#fcaf81; color:#fff; } +button.fail:hover, button.cancel:hover, button.delete:hover { background-image:url(images/cancel_btn_over_bg.gif); } +button.fail:active, button.cancel:active, button.delete:active { background-image:url(images/cancel_btn_active_bg.gif); background-color:#e0612f; } button.cancel span, @@ -442,6 +459,9 @@ button.add-widget span { background-image:url(images/btn_add-widget_icon2.gif); button.add-variable span { background-image:url(images/btn_add-variable_icon.gif); padding-left:26px; } button.go span { background-image:url(images/btn_go.gif); padding-left:16px; } button.btn-chooser { display:block; margin:0 0 10px; } +button.success { background-image:url(images/btn_gr_bg.gif); border-color:#46745E; } +button.success:hover { background:url(images/btn_gr_over.gif) #6cac46; } +button.success:active { background:url(images/btn_gr_on.gif) repeat-x 0 0 #3fa05e; } button.disabled, button.disabled:hover, @@ -461,6 +481,7 @@ button.icon-btn span { text-indent:-999em; display:block; width:16px; padding:0; .side-col .switcher select { width:100%; } /*.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; } /* SPACE @@ -693,7 +714,24 @@ div.autocomplete ul li { padding:.5em .7em; min-height:32px; cursor:pointer; tex .login-container .legal { margin:0; background:url(images/login_box_legal_bg.gif) no-repeat; padding:8px 8px 5px 8px; font-size:.95em; } .login-form .validation-advice { margin:3px 0 0 0; } .login-form .forgot-link { margin:0 17px 0 0; text-align:right; } - +.login-form .captcha { padding:10px 0 0; } +.login-form .captcha-image { border:1px solid #aaa; margin:1.5em 0 0; position:relative; } +.login-form .captcha-image img { vertical-align:bottom; } +.login-form .captcha-reload { cursor:pointer; position: absolute; top:2px; right:2px; } +.login-form .captcha-reload.refreshing { animation:rotate 1.5s infinite linear; -webkit-animation:rotate 1.5s infinite linear; -moz-animation:rotate 1.5s infinite linear; } + +@-webkit-keyframes rotate { + 0% { -webkit-transform:rotate(0); } + 0% { -webkit-transform:rotate(360deg); } +} +@-moz-keyframes rotate { + 0% { -moz-transform:rotate(0); } + 0% { -moz-transform:rotate(360deg); } +} +@keyframes rotate { + 0% { transform:rotate(0); } + 0% { transform:rotate(360deg); } +} /* DASHBOARD @@ -758,9 +796,10 @@ ul.item-options li { padding-left:.7em; } .entry-edit .order-address td.label label { width:100px; } .entry-edit .order-address input.input-text, -.entry-edit .order-address .textarea { width:95% !important; } -.entry-edit .order-address .select { width:96.5%; } -.order-search-items .entry-edit .grid { height:610px; overflow:auto; } +.entry-edit .order-address .textarea { width:95% !important; } +.entry-edit .order-address .select { width:96.5%; } +.entry-edit .order-address .validate-vat { text-align:right; padding:10px 0 0; width:96%; } +.order-search-items .entry-edit .grid { height:610px; overflow:auto; } .order-search-items .entry-edit .grid table { width:99.9%; } /* .create-order-totals { background:url(images/bg_create_order_totals.gif) repeat-y 50% 0 !important; } */ @@ -959,6 +998,7 @@ ul.tabs a.paypal-section:hover { background:url(images/tabs_span_bg.gif) repeat- .x-tree-node { margin:0 !important; } .x-tree-node .leaf .x-tree-node-icon { background-image:url(images/fam_leaf.png); } .x-tree-node .system-leaf .x-tree-node-icon { background-image:url(images/fam_application_form_delete.png); } +.x-tree-node-ct { overflow:hidden; } /* Product - Websites */ .webiste-groups { padding:10px 20px; } @@ -1392,6 +1432,19 @@ ul.super-product-attributes { padding-left:15px; } #catalog-wysiwyg-editor .magento_message { padding:0 7px; } #catalog-wysiwyg-editor .magento_buttons { padding-left:7px; padding-right:7px; } +/* Backups */ +.backup-dialog { background-color:#6f8992; background:rgba(111, 137, 146, 0.5); cursor:default; left:50%; margin:0 0 0 -271px; position:fixed; top:50%; width:470px; padding:8px; z-index:400; -moz-box-shadow:0 0 100px #ccc; -webkit-box-shadow:0 0 100px #ccc; box-shadow:0 0 100px #ccc; } +.backup-dialog .entry-edit { border:1px solid #6f8992; } +.backup-dialog .content { background:#fff; border-bottom:1px solid #ccc; max-height:400px; overflow:auto; } +.backup-dialog .question {margin-top: 15px;} +.backup-dialog .buttons-set { border-top:1px solid #ddd; background:#eee; margin:0; overflow:hidden; padding:7px 10px 8px; width:448px; } +.backup-dialog .buttons-set button { margin:0 0 0 5px; } +.backup-dialog #ftp-credentials-container {margin-top: 25px;} +.backup-dialog .password-box-container {margin-top: 15px;} +.backup-dialog #ftp-credentials-container fieldset {margin-bottom: 0;} +.backup-dialog input[type=text], .backup-dialog input[type=password] {width: 180px} +.backup-dialog .exclude-media-checkbox-container {margin-top: 15px;} +.backup-dialog td.maintenance-checkbox-container {margin-top: 0; padding-top: 4px;} /*****************************************/ /******** ALIGNMENTS AND CLEARS **********/ diff --git a/app/design/adminhtml/default/default/skin/default/custom.css b/app/design/adminhtml/default/default/skin/default/custom.css index dc3d9ddb53a..3bb862c9849 100644 --- a/app/design/adminhtml/default/default/skin/default/custom.css +++ b/app/design/adminhtml/default/default/skin/default/custom.css @@ -17,6 +17,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/skin/default/ie7.css b/app/design/adminhtml/default/default/skin/default/ie7.css index 027bba30381..215456a47b4 100644 --- a/app/design/adminhtml/default/default/skin/default/ie7.css +++ b/app/design/adminhtml/default/default/skin/default/ie7.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/skin/default/iestyles.css b/app/design/adminhtml/default/default/skin/default/iestyles.css index 0e1d5d6fdf6..f530b2a7c24 100644 --- a/app/design/adminhtml/default/default/skin/default/iestyles.css +++ b/app/design/adminhtml/default/default/skin/default/iestyles.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* Clearing */ @@ -93,7 +93,7 @@ button, .form-button { width:auto; margin-left:5px; overflow:visible; button.icon-btn { width:31px; } .nested-content .content-header { position:relative; zoom:1; } -dl.accordion dt a, +dl.accordion dt a, div.collapseable a { width:100%; } .product-image-gallery .grid tbody td { padding: 4px !important; } .massaction .entry-edit fieldset{ float: right;} @@ -108,4 +108,6 @@ div.collapseable a { width:100%; } .grid-severity-critical, .grid-severity-major, -.grid-severity-minor { margin:3px 0; } \ No newline at end of file +.grid-severity-minor { margin:3px 0; } +button.add span, +button.delete span { display:inline-block; height:16px;} diff --git a/app/design/adminhtml/default/default/skin/default/images/btn_gr_bg.gif b/app/design/adminhtml/default/default/skin/default/images/btn_gr_bg.gif new file mode 100644 index 0000000000000000000000000000000000000000..d91a78b537f489ee43baeef28397625dace4b425 GIT binary patch literal 148 zcmZ?wbhEHbWMmLwIKseSGczh+cah_=MB6zr_6y?Nw`F_p%(I>r;k&EAd3B1@%H)te zrFQdUUDl;}?8ph+UF@(V!EH;X>&6TQ;(+2$7O+Ac5DBuAfmQIqCzg(fA``EubTJ5? LVPJ6QV6X-NlQ<+x literal 0 HcmV?d00001 diff --git a/app/design/adminhtml/default/default/skin/default/images/btn_gr_on.gif b/app/design/adminhtml/default/default/skin/default/images/btn_gr_on.gif new file mode 100644 index 0000000000000000000000000000000000000000..b9f7bdeedbf052964092bed39af7ceca9ed05e05 GIT binary patch literal 137 zcmZ?wbhEHbWMp7tIKseS))i>KAkJz^xN)<u?c5l{8cznQ0>z&!VDof9B*;z%R<;B~ K1}4E425SIopbOOi literal 0 HcmV?d00001 diff --git a/app/design/adminhtml/default/default/skin/default/images/btn_gr_over.gif b/app/design/adminhtml/default/default/skin/default/images/btn_gr_over.gif new file mode 100644 index 0000000000000000000000000000000000000000..73afeb6200c4dd4752393730b631114da01382a0 GIT binary patch literal 147 zcmZ?wbhEHbWMmL#IKse?ailHwK&{iN<jGf8G@hFkzOQ2HwN<U>=XPIOlys=kduN`@ zy0rewOWihSR-c*bzCAntcz59L;__3I7>EOkKUu&EbwDJ@P6k$i1%?JE94&-cR2&60 L{Wo(cGFSruG2ket literal 0 HcmV?d00001 diff --git a/app/design/adminhtml/default/default/skin/default/images/i_question-mark.png b/app/design/adminhtml/default/default/skin/default/images/i_question-mark.png new file mode 100644 index 0000000000000000000000000000000000000000..889bf696e2fdac4c51300a90ef6a5dec6b09d7cd GIT binary patch literal 1654 zcmbVNX;2eq7>;Nefie-O2UhDEN6{9tN6uY{n6QZiIYTU=YKJ9Rk`<B-n}r0bGXj=! zm6^^!1w|-gtqP)c>eQo31x2B#SXvLJDhdUqOlhT7t&ViVVf(}BkM7LwcRkPhKJW3( z7RSe~_4Qup&ExTWwUM}v8|S#+*`C~Y$=Eo-4S}rMz$VgZtdn3!p3+38l7QAqm`NQ; zm~t{Z$S@vnW*Vh8u!fju%t%{>gc~DtS?wH~#|sO0*$HDh$pWdQnX)Maqo-N~0A*4L zk|Z%uj6H(1P?5O|nV1`^H|C}rQIjBiH4x^)I0IIaB><N-!{)$T3c-Y3jGMc+K>;uU zVbc|YNl}KFcp!piNI)WlLX40U2BcykEQU}q8Vn#141q8LLb4DT!Xz>bf`O?=z<Fa# zX_yYzO!?wg3W0@X?HC9;olc=sB%~QL2%{(pLI{W;Asiyakz->CSBTBAY}x`&I*bfu zXDQkSxGfT?bQY@+a7rgbu-ao{UK+MJrV_=a40I885Eeq9)#{FG0_|XR<UcZAiFW97 z>?Eio9ds6B<m!>OY?{pF?!O(mft(sFj-j}s5E(da%(9X;R*NeH+=<XcnJ@%ZB1)AQ zk*dUy8irw|TqRZ^(g=wP70aY@&9seIaiww&p_YopkVXQ-YFH_g$?yodCPFF4VML5i zbG0@HOW2I$v|ozzJH-|KCl`xgNP?vqJxym!cR;*_W@(3owgVA~5+MvEQ8p9pbhyhi z87)pSR5oeSFtinz$S+2{!auA+QCulSG?K}<RU)O7(=U~aL`qcY);`HK{hyqHoEXsE z9RF&T=`F4U-P4z?&n;eF9@56$7>2tVnO(bWJf6osEw0qNdiN%7h<qbq!Hcw-o9j1> zMZJIBXHTQBqOU|ndKS+*#9y8_w;uSTyMW)jF3#Uik-_&={7@PX5cB7JIBQAQ#rbXD zrIM=#eY3M~G1qS`cA5vfqRkcW>h3%z`fA3vjLU|eU3n}z+1xKbySQ>o=!v^g1IfG4 z4qXGa5QoDKJt#Z;sOi`k@F{Gwf6*9JYdNu%KHj=BmapG`@Z>II@;qeIWubL&=acQ9 z96fvH_R!YmHkpNL3C{o{+q3a=t%XI8!Ug)63kUQ8BTs|w9wEKzTAm&jZyH7VPM;bW zFQL9qtgf3ytUK3T#wU_nKQ2`Lv^f~plmsrb%}Bou4O^>QPdXb5J4ea`y6@fX+*9@- z#n5`ch9BzZCA%_zX<Mpl-}$n^;f$&Uiv#X#y|JgNw<N5gDI|8zjq+{gtm8@fMeU}Q zJEQWD_My{N?>#K2uk!q0UcSD!tCQZFERVhf`eb@k!aqXYM~C@&-R&KCd%x3>66k9# z>GA7LIC3U1FG}3xJ;VOhfdmQBQhc>)03KO$KPbQpv(_99PpT~7RrcqKN~@w%<c0CN z-JO074_7NKp(`(Le(Pb6zn}N$nx5HZk4JOh6F$1R9-UEM?7*N&@b;>r;-zsL^G|mT zk3CWAckC@N|LM)HZ)+&e4a+z@vwr(_{{^@AA0v&KA=?^vEc!XqV{_T%`Zyo`oA#Rt zyjtU$qWtUq;n0)chia?EuU*O_`vMH#`~~?8cb1Mn-PTl&)t#wRGJ=n;6(SXbpQpaq z!T(h~V>udh^%}b{nbNwt!@U}xpU)WxuKBGT-8A#wx5wHKR;*YHckR=SNUHmO`Em*P zpza;R*JItmi^_bQ&rV%h(Y#TIsvE%8VgI<E(ts;i?IJY#LUD`7>pX)rH2JfR^hfSL NfmR)hH>*<e{{{pKcaH!7 literal 0 HcmV?d00001 diff --git a/app/design/adminhtml/default/default/skin/default/menu.css b/app/design/adminhtml/default/default/skin/default/menu.css index 50b409ef10a..4eb3b0b2eb4 100644 --- a/app/design/adminhtml/default/default/skin/default/menu.css +++ b/app/design/adminhtml/default/default/skin/default/menu.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/skin/default/print.css b/app/design/adminhtml/default/default/skin/default/print.css index 22f8f7c1abc..4186d110f7e 100644 --- a/app/design/adminhtml/default/default/skin/default/print.css +++ b/app/design/adminhtml/default/default/skin/default/print.css @@ -19,7 +19,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/skin/default/reset.css b/app/design/adminhtml/default/default/skin/default/reset.css index af1d4be00b8..853d1e75731 100644 --- a/app/design/adminhtml/default/default/skin/default/reset.css +++ b/app/design/adminhtml/default/default/skin/default/reset.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/theme.xml b/app/design/adminhtml/default/default/theme.xml index 45b319d3a8b..349c67c5c2e 100644 --- a/app/design/adminhtml/default/default/theme.xml +++ b/app/design/adminhtml/default/default/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/local.xml b/app/design/frontend/default/default/local.xml index a5104e5d541..d18da112207 100644 --- a/app/design/frontend/default/default/local.xml +++ b/app/design/frontend/default/default/local.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/default/skin/blank/css/print.css b/app/design/frontend/default/default/skin/blank/css/print.css index e482327e084..d13dfa76aa9 100644 --- a/app/design/frontend/default/default/skin/blank/css/print.css +++ b/app/design/frontend/default/default/skin/blank/css/print.css @@ -19,7 +19,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/skin/blank/css/styles-ie.css b/app/design/frontend/default/default/skin/blank/css/styles-ie.css index d6df618c519..4f98d99c62e 100644 --- a/app/design/frontend/default/default/skin/blank/css/styles-ie.css +++ b/app/design/frontend/default/default/skin/blank/css/styles-ie.css @@ -19,7 +19,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/skin/blank/css/styles.css b/app/design/frontend/default/default/skin/blank/css/styles.css index 4d1858ef270..f9aceacee1c 100644 --- a/app/design/frontend/default/default/skin/blank/css/styles.css +++ b/app/design/frontend/default/default/skin/blank/css/styles.css @@ -19,7 +19,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) */ @@ -373,7 +373,7 @@ tr.summary-details-excluded { font-style:italic; } .std ul.disc { list-style:disc outside; padding-left:18px; margin:0 0 10px; } .std dl dt { font-weight:bold; } .std dl dd { margin:0 0 10px; } -/*.std ul, +.std ul, .std ol, .std dl, .std p, @@ -393,7 +393,7 @@ tr.summary-details-excluded { font-style:italic; } .std b, .std strong { font-weight:bold; } .std i, -.std em { font-style:italic; }*/ +.std em { font-style:italic; } /* Misc */ .links li { display:inline; } @@ -1061,6 +1061,27 @@ tr.summary-details-excluded { font-style:italic; } .account-create {} /* Account Login/Create Pages ============================================================ */ +/* Captcha */ +.captcha-note {} +.captcha-image { float:left; position:relative; } +.captcha-img { border:1px solid #ccc; } +.registered-users .captcha-image {} +#checkout-step-login .captcha-image {} +.captcha-reload { position:absolute; top:2px; right:2px;} +.captcha-reload.refreshing { animation:rotate 1.5s infinite linear; -webkit-animation:rotate 1.5s infinite linear; -moz-animation:rotate 1.5s infinite linear; } + +@-webkit-keyframes rotate { + 0% { -webkit-transform:rotate(0); } + 0% { -webkit-transform:rotate(-360deg); } +} +@-moz-keyframes rotate { + 0% { -moz-transform:rotate(0); } + 0% { -moz-transform:rotate(-360deg); } +} +@keyframes rotate { + 0% { transform:rotate(0); } + 0% { transform:rotate(-360deg); } +} /* Remember Me Popup ===================================================================== */ .window-overlay { background:rgba(0, 0, 0, 0.35); position:absolute; top:0; left:0; height:100%; width:100%; z-index:990; } diff --git a/app/design/frontend/default/default/skin/blue/css/styles-ie.css b/app/design/frontend/default/default/skin/blue/css/styles-ie.css index 94cb13e5a43..a2fe506af82 100644 --- a/app/design/frontend/default/default/skin/blue/css/styles-ie.css +++ b/app/design/frontend/default/default/skin/blue/css/styles-ie.css @@ -19,7 +19,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/default/skin/blue/css/styles.css b/app/design/frontend/default/default/skin/blue/css/styles.css index 5df120b046a..1297140c97e 100644 --- a/app/design/frontend/default/default/skin/blue/css/styles.css +++ b/app/design/frontend/default/default/skin/blue/css/styles.css @@ -19,7 +19,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) */ @@ -406,7 +406,7 @@ tr.summary-details-excluded { font-style:italic; } .std ul.disc { list-style:disc outside; padding-left:18px; margin:0 0 10px; } .std dl dt { font-weight:bold; } .std dl dd { margin:0 0 10px; } -/*.std ul, +std ul, .std ol, .std dl, .std p, @@ -426,7 +426,7 @@ tr.summary-details-excluded { font-style:italic; } .std b, .std strong { font-weight:bold; } .std i, -.std em { font-style:italic; }*/ +.std em { font-style:italic; } /* Misc */ .links li { display:inline; } @@ -1407,7 +1407,7 @@ tr.summary-details-excluded { font-style:italic; } /* Account Login/Create Pages ============================================================ */ -.account-login .content { min-height:240px; padding:14px 21px; background:#faf7ee url(../images/bkg_login-box.gif) 0 0 repeat-x; border:1px solid #bbb6a5; border-bottom:0; } +.account-login .content { min-height:345px; padding:14px 21px; background:#faf7ee url(../images/bkg_login-box.gif) 0 0 repeat-x; border:1px solid #bbb6a5; border-bottom:0; } .account-login .content h2 { font-weight:bold; font-size:13px; margin:0 0 14px; padding:0 0 5px 23px; border-bottom:1px solid #ddd; background-position:0 1px; background-repeat:no-repeat; text-transform:uppercase; color:#e76200; } .account-login .new-users h2 { background-image:url(../images/i_page1.gif)} .account-login .registered-users h2 { background-image:url(../images/i_page2.gif); } @@ -1416,6 +1416,26 @@ tr.summary-details-excluded { font-style:italic; } .account-create {} /* Account Login/Create Pages ============================================================ */ +/* Captcha */ +.captcha-note { clear:left; padding-top:5px; } +.captcha-image { float:left; display:inline; margin:0; position:relative; width:258px; } +.captcha-image .captcha-img { border:1px solid #b6b6b6; vertical-align:bottom; width:100%; } +.registered-users .captcha-image { margin:0; } +.captcha-reload { cursor:pointer; position:absolute; top:2px; right:2px;} +.captcha-reload.refreshing { animation:rotate 1.5s infinite linear; -webkit-animation:rotate 1.5s infinite linear; -moz-animation:rotate 1.5s infinite linear; } + +@-webkit-keyframes rotate { + 0% { -webkit-transform:rotate(0); } + 0% { -webkit-transform:rotate(-360deg); } +} +@-moz-keyframes rotate { + 0% { -moz-transform:rotate(0); } + 0% { -moz-transform:rotate(-360deg); } +} +@keyframes rotate { + 0% { transform:rotate(0); } + 0% { transform:rotate(-360deg); } +} /* Remember Me Popup ===================================================================== */ .window-overlay {background:rgba(0, 0, 0, 0.35); position:absolute; top:0; left:0; height:100%; width:100%; z-index:990; } diff --git a/app/design/frontend/default/default/skin/default/css/print.css b/app/design/frontend/default/default/skin/default/css/print.css index cb7f55d533e..7ce27af5973 100644 --- a/app/design/frontend/default/default/skin/default/css/print.css +++ b/app/design/frontend/default/default/skin/default/css/print.css @@ -19,7 +19,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/default/skin/default/css/styles-ie.css b/app/design/frontend/default/default/skin/default/css/styles-ie.css index cf56a043df0..efb88a1d122 100644 --- a/app/design/frontend/default/default/skin/default/css/styles-ie.css +++ b/app/design/frontend/default/default/skin/default/css/styles-ie.css @@ -19,7 +19,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/default/skin/default/css/styles.css b/app/design/frontend/default/default/skin/default/css/styles.css index aa4cc247ace..94cc5a16f7d 100644 --- a/app/design/frontend/default/default/skin/default/css/styles.css +++ b/app/design/frontend/default/default/skin/default/css/styles.css @@ -19,7 +19,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) */ @@ -435,7 +435,7 @@ tr.summary-details-excluded { font-style:italic; } .std ul.disc { list-style:disc outside; padding-left:18px; margin:0 0 10px; } .std dl dt { font-weight:bold; } .std dl dd { margin:0 0 10px; } -/*.std ul, +.std ul, .std ol, .std dl, .std p, @@ -455,7 +455,7 @@ tr.summary-details-excluded { font-style:italic; } .std b, .std strong { font-weight:bold; } .std i, -.std em { font-style:italic; }*/ +.std em { font-style:italic; } /* Misc */ .links li { display:inline; } @@ -1445,15 +1445,34 @@ tr.summary-details-excluded { font-style:italic; } /* Account Login/Create Pages ============================================================ */ -.account-login .content { min-height:240px; padding:14px 21px; background:#faf7ee url(../images/bkg_login-box.gif) 0 0 repeat-x; border:1px solid #bbb6a5; border-bottom:0; } +.account-login .content { min-height:345px; padding:14px 21px; background:#faf7ee url(../images/bkg_login-box.gif) 0 0 repeat-x; border:1px solid #bbb6a5; border-bottom:0; } .account-login .content h2 { font-weight:bold; font-size:13px; margin:0 0 14px; padding:0 0 5px 23px; border-bottom:1px solid #ddd; background-position:0 1px; background-repeat:no-repeat; text-transform:uppercase; color:#e76200; } .account-login .new-users h2 { background-image:url(../images/i_page1.gif)} .account-login .registered-users h2 { background-image:url(../images/i_page2.gif); } .account-login .buttons-set { border:1px solid #bbb6a5; border-top:0; margin:0; padding:8px 13px; background:#dee5e8 url(../images/bkg_buttons-set1.gif) 0 0 repeat-x; } .account-create {} -/* Account Login/Create Pages ============================================================ */ +/* Captcha ================================================================================ */ +.captcha-note { clear:left; padding-top:5px; } +.captcha-image { float:left; display:inline; margin:0; position:relative; width:258px; } +.captcha-image .captcha-img { border:1px solid #b6b6b6; vertical-align:bottom; width:100%; } +.registered-users .captcha-image { margin:0;} +.captcha-reload { cursor:pointer; position:absolute; top:2px; right:2px;} +.captcha-reload.refreshing { animation:rotate 1.5s infinite linear; -webkit-animation:rotate 1.5s infinite linear; -moz-animation:rotate 1.5s infinite linear; } + +@-webkit-keyframes rotate { + 0% { -webkit-transform:rotate(0); } + 0% { -webkit-transform:rotate(-360deg); } +} +@-moz-keyframes rotate { + 0% { -moz-transform:rotate(0); } + 0% { -moz-transform:rotate(-360deg); } +} +@keyframes rotate { + 0% { transform:rotate(0); } + 0% { transform:rotate(-360deg); } +} /* Remember Me Popup ===================================================================== */ .window-overlay { background:rgba(0, 0, 0, 0.35); position:absolute; top:0; left:0; height:100%; width:100%; z-index:990; } diff --git a/app/design/frontend/default/default/theme.xml b/app/design/frontend/default/default/theme.xml index 45b319d3a8b..349c67c5c2e 100644 --- a/app/design/frontend/default/default/theme.xml +++ b/app/design/frontend/default/default/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/Mage_Bundle/sales/order/items/renderer.phtml b/app/design/frontend/default/iphone/Mage_Bundle/sales/order/items/renderer.phtml index c18e2444e5f..b71b5b2f6d9 100644 --- a/app/design/frontend/default/iphone/Mage_Bundle/sales/order/items/renderer.phtml +++ b/app/design/frontend/default/iphone/Mage_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/default/iphone/Mage_Catalog/layer/view.phtml b/app/design/frontend/default/iphone/Mage_Catalog/layer/view.phtml index ecf077e4e3e..9bf8a22920b 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/layer/view.phtml +++ b/app/design/frontend/default/iphone/Mage_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) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/layout.xml b/app/design/frontend/default/iphone/Mage_Catalog/layout.xml index 7ca1cf82725..cd75bba4169 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Catalog/layout.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/Mage_Catalog/navigation/top.phtml b/app/design/frontend/default/iphone/Mage_Catalog/navigation/top.phtml index 01595f708da..de8d3510af1 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/navigation/top.phtml +++ b/app/design/frontend/default/iphone/Mage_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/default/iphone/Mage_Catalog/product/compare/list.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/compare/list.phtml index 194ce8f44d9..9b3f34f0516 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/compare/list.phtml +++ b/app/design/frontend/default/iphone/Mage_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 */ @@ -30,9 +30,6 @@ $_imageSize = $this->getVar('product_compare_small_image_size', 'Mage_Catalog'); ?> <?php $_total=$this->getItems()->getSize() ?> <?php if($_total): ?> - <div class="compare-back-link"> - <a href="javascript:history.back(1);">Back</a> - </div> <table class="data-table compare-table" id="product_comparison"> <?php $_i=0 ?> <?php foreach($this->getItems() as $_item): ?> @@ -46,14 +43,19 @@ $_imageSize = $this->getVar('product_compare_small_image_size', 'Mage_Catalog'); <?php $_i=0 ?> <?php foreach($this->getItems() as $_item): ?> <?php if($_i++%10==0): ?> - <th> </th> + <th> + <div class="compare-back-link"> + <a href="javascript:history.back(1);">Back</a> + </div> + <a href="#" onclick="removeAll(event, '<?php echo $this->helper('Mage_Catalog_Helper_Product_Compare')->getClearListUrl(); ?>');" class="compare-clear-all">Clear All</a> + </th> <?php endif; ?> <td> <a class="product-image" href="#" onclick="setLocation('<?php echo $this->getProductUrl($_item) ?>', true)" title="<?php echo $this->stripTags($_item->getName(), null, true) ?>"> <img src="<?php echo $this->helper('Mage_Catalog_Helper_Image')->init($_item, 'small_image')->resize($_imageSize); ?>" width="<?php echo $_imageSize ?>" height="<?php echo $_imageSize ?>" alt="<?php echo $this->stripTags($_item->getName(), null, true) ?>" /> </a> <span class="loader" style="display:none;"></span> - <a href="#" class="btn-remove" onclick="removeItem('<?php echo $this->helper('Mage_Catalog_Helper_Product_Compare')->getRemoveUrl($_item) ?>', this);"><img src="<?php echo $this->getSkinUrl('images/btn_trash.png') ?>" height="10" width="10" /></a> + <a href="#" class="btn-remove" onclick="removeItem(event, '<?php echo $this->helper('Mage_Catalog_Helper_Product_Compare')->getRemoveUrl($_item) ?>', this);"><img src="<?php echo $this->getSkinUrl('images/btn_trash.png') ?>" height="10" width="10" /></a> <h2 class="product-name"><a href="#" onclick="setLocation('<?php echo $this->getProductUrl($_item) ?>', true)" title="<?php echo $this->stripTags($_item->getName(), null, true) ?>"><?php echo $this->helper('Mage_Catalog_Helper_Output')->productAttribute($_item, $_item->getName(), 'name') ?></a></h2> <?php echo $this->getReviewsSummaryHtml($_item, 'short') ?> <?php echo $this->getPriceHtml($_item, true, '-compare-list-top') ?> @@ -132,19 +134,79 @@ $_imageSize = $this->getVar('product_compare_small_image_size', 'Mage_Catalog'); </div> <script type="text/javascript"> document.observe("dom:loaded", function() { - $('product_comparison').on('click', 'th', function (e, elem) { - if ( elem.hasClassName('collapsible') ) { - elem.toggleClassName('collapsed'); - } - elem.nextSiblings().each(function (td) { - td.toggleClassName('collapsed'); + (function () { + var compare_table = $('product_comparison'); + + compare_table.on('click', 'th', function (e, elem) { + if ( elem.hasClassName('collapsible') ) { + elem.toggleClassName('collapsed'); + } + elem.nextSiblings().each(function (td) { + td.toggleClassName('collapsed'); + }); }); - }); - $('product_comparison').select('th').each(function(th) { - if ( th.getDimensions().height > 30 && th.down('span') ) { - th.addClassName('collapsible'); + compare_table.select('th').each(function(th) { + if ( th.getDimensions().height > 30 && th.down('span') ) { + th.addClassName('collapsible'); + } + }); + + if ( compare_table.select('.product-shop-row td').length > 1 ) { + + compare_table.select('.product-shop-row td').each(function (td) { + td.insert({ 'top' : new Element('span', { 'class' : 'move-right' }) }); + td.insert({ 'top' : new Element('span', { 'class' : 'move-left' }) }); + }); + compare_table.on('click', '.move-right', function (e, elem) { + var index = elem.up('td').cellIndex + 1; + compare_table.select('tr td:nth-child(' + index + ')').each(function (td) { + if ( td.next() ) { + //td.addClassName('move-right-animation'); + //td.next().addClassName('move-left-animation'); + var clone = td.clone(true); + td.next().setStyle({ 'webkitTransform' : 'translate3d(100%, 0, 0)' }).addClassName('moved-left').insert({ after : clone.setStyle({ 'webkitTransform' : 'translate3d(-100%, 0, 0)' }).addClassName('moved-right') }); + td.remove(); + + setTimeout(function () { + $$('.moved-right').invoke('addClassName', 'move-right-animation-scale'); + $$('.moved-left').invoke('addClassName', 'move-left-animation'); + }, 1); + } + }); + compare_table.addClassName('hide-controls'); + }); + + compare_table.on('webkitTransitionEnd', 'td', function(e, elem) { + elem.writeAttribute('style', ''); + var classArray = elem.classNames().toArray(); + for (var index = 0, len = classArray.size(); index < len; ++index) { + if(classArray[index] !== 'collapsed'){ + elem.removeClassName(classArray[index]); + } + } + compare_table.removeClassName('hide-controls'); + }) + + compare_table.on('click', '.move-left', function (e, elem) { + var index = elem.up('td').cellIndex + 1; + compare_table.select('tr td:nth-child(' + index + ')').each(function (td) { + if ( td.previous() && td.previous().cellIndex !== 0 ) { + var clone = td.clone(true); + td.previous().setStyle({ 'webkitTransform' : 'translate3d(-100%, 0, 0)' }).addClassName('moved-right').insert({ before : clone.setStyle({ 'webkitTransform' : 'translate3d(100%, 0, 0)' }).addClassName('moved-left') }); + td.remove(); + + setTimeout(function () { + $$('.moved-right').invoke('addClassName', 'move-right-animation'); + $$('.moved-left').invoke('addClassName', 'move-left-animation-scale'); + }, 1); + } + }); + compare_table.addClassName('hide-controls'); + }); + } - }); + + }()); }); @@ -164,8 +226,8 @@ $_imageSize = $this->getVar('product_compare_small_image_size', 'Mage_Catalog'); /** * Send remove item request, after that reload windows */ - function removeItem (url, item) - { + function removeItem (e, url, item) { + e.preventDefault(); new Ajax.Request(url, { parameters: {isAjax: 1, method: 'POST'}, onLoading: function() { @@ -176,11 +238,24 @@ $_imageSize = $this->getVar('product_compare_small_image_size', 'Mage_Catalog'); }, onFailure: item.show() }); + } + + function removeAll (e, url) { + e.preventDefault(); + new Ajax.Request(url, { + parameters: {isAjax: 1, method: 'POST'}, + onLoading: function() { + }, + onSuccess: function() { + window.location.href = document.referrer; + } + }); } + </script> <?php else: ?> <script type="text/javascript"> window.location.href = document.referrer; </script> -<?php endif; ?> \ No newline at end of file +<?php endif; ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/compare/sidebar.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/compare/sidebar.phtml index 542b4acdd88..1befcfc2460 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/compare/sidebar.phtml +++ b/app/design/frontend/default/iphone/Mage_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/default/iphone/Mage_Catalog/product/gallery.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/gallery.phtml index 8a6b7d0dffc..2e6adceb1bf 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/gallery.phtml +++ b/app/design/frontend/default/iphone/Mage_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/default/iphone/Mage_Catalog/product/list.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/list.phtml index 62c85456294..d841a112317 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/list.phtml +++ b/app/design/frontend/default/iphone/Mage_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/default/iphone/Mage_Catalog/product/list/toolbar.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/list/toolbar.phtml index f3742d93474..e07735a8b20 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/list/toolbar.phtml +++ b/app/design/frontend/default/iphone/Mage_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/default/iphone/Mage_Catalog/product/list/upsell.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/list/upsell.phtml index 2555c9073ae..9c0df625992 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/list/upsell.phtml +++ b/app/design/frontend/default/iphone/Mage_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/default/iphone/Mage_Catalog/product/price.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/price.phtml index 4ba806ea1da..8c72c060514 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/price.phtml +++ b/app/design/frontend/default/iphone/Mage_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/default/iphone/Mage_Catalog/product/view.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view.phtml index 34fe4d92080..52fe51a1e33 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view.phtml +++ b/app/design/frontend/default/iphone/Mage_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) */ @@ -120,7 +120,7 @@ try { var originalImg = $$('.product-image-wrap .product-image img')[0]; originalImg.up('.product-image-wrap').insert(originalImg.clone().addClassName('cloned')); - setTimeout(function () {$$('.cloned')[0].addClassName('animate');}, 1); + 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)); diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/view/addto.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view/addto.phtml index 53bca847d2a..7a29901d510 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view/addto.phtml +++ b/app/design/frontend/default/iphone/Mage_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) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtocart.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtocart.phtml index 19095baf307..86bb545e5aa 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtocart.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtocart.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/iphone/Mage_Catalog/product/view/addtowishlist.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtowishlist.phtml index afaf9576bd7..2761933d8c0 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtowishlist.phtml +++ b/app/design/frontend/default/iphone/Mage_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) */ diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/view/media.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view/media.phtml index 516eb740efd..8b2a813bdf5 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view/media.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/view/media.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/iphone/Mage_Catalog/product/view/type/grouped.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped.phtml index 221f139bcbe..0c9772677bc 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped.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/iphone/Mage_Catalog/product/view/type/grouped_grid.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped_grid.phtml index c1ae86e9222..361fc7e2adb 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped_grid.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped_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/default/iphone/Mage_CatalogSearch/form.mini.phtml b/app/design/frontend/default/iphone/Mage_CatalogSearch/form.mini.phtml index 3113f0cccbe..7526290880c 100644 --- a/app/design/frontend/default/iphone/Mage_CatalogSearch/form.mini.phtml +++ b/app/design/frontend/default/iphone/Mage_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) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_CatalogSearch/layout.xml b/app/design/frontend/default/iphone/Mage_CatalogSearch/layout.xml index 799f767ca54..6e4a0223922 100644 --- a/app/design/frontend/default/iphone/Mage_CatalogSearch/layout.xml +++ b/app/design/frontend/default/iphone/Mage_CatalogSearch/layout.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/default/iphone/Mage_CatalogSearch/result.phtml b/app/design/frontend/default/iphone/Mage_CatalogSearch/result.phtml index b2993fde838..f8c4c77c9f7 100644 --- a/app/design/frontend/default/iphone/Mage_CatalogSearch/result.phtml +++ b/app/design/frontend/default/iphone/Mage_CatalogSearch/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/iphone/Mage_Checkout/cart.phtml b/app/design/frontend/default/iphone/Mage_Checkout/cart.phtml index 24a5c34d331..8ac6063ab72 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/cart.phtml +++ b/app/design/frontend/default/iphone/Mage_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/Mage_Checkout/cart/item/default.phtml b/app/design/frontend/default/iphone/Mage_Checkout/cart/item/default.phtml index ef00e5e88f5..1a148553a18 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/cart/item/default.phtml +++ b/app/design/frontend/default/iphone/Mage_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) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Checkout/cart/no_items_header.phtml b/app/design/frontend/default/iphone/Mage_Checkout/cart/no_items_header.phtml index 94cd3283462..71fea202f44 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/cart/no_items_header.phtml +++ b/app/design/frontend/default/iphone/Mage_Checkout/cart/no_items_header.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/iphone/Mage_Checkout/cart/sidebar.phtml b/app/design/frontend/default/iphone/Mage_Checkout/cart/sidebar.phtml index 9a41522d110..99c569716b9 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/cart/sidebar.phtml +++ b/app/design/frontend/default/iphone/Mage_Checkout/cart/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/default/iphone/Mage_Checkout/cartheader.phtml b/app/design/frontend/default/iphone/Mage_Checkout/cartheader.phtml index e24bc648f8f..6b0e05aae14 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/cartheader.phtml +++ b/app/design/frontend/default/iphone/Mage_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/Mage_Checkout/layout.xml b/app/design/frontend/default/iphone/Mage_Checkout/layout.xml index 71ceea539f8..2a460daabe7 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Checkout/layout.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/Mage_Checkout/onepage/login.phtml b/app/design/frontend/default/iphone/Mage_Checkout/onepage/login.phtml index 5770289776a..cede25986c2 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/onepage/login.phtml +++ b/app/design/frontend/default/iphone/Mage_Checkout/onepage/login.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) */ ?> @@ -79,6 +79,7 @@ <input type="password" class="input-text required-entry" id="login-password" name="login[password]" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> </fieldset> </form> diff --git a/app/design/frontend/default/iphone/Mage_Cms/layout.xml b/app/design/frontend/default/iphone/Mage_Cms/layout.xml index d2b586fb262..924ccff79ea 100644 --- a/app/design/frontend/default/iphone/Mage_Cms/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Cms/layout.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/default/iphone/Mage_Contacts/layout.xml b/app/design/frontend/default/iphone/Mage_Contacts/layout.xml index 5dadc86e94e..18e811c5137 100644 --- a/app/design/frontend/default/iphone/Mage_Contacts/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Contacts/layout.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/default/iphone/Mage_Customer/form/edit.phtml b/app/design/frontend/default/iphone/Mage_Customer/form/edit.phtml index 91f23f9a835..f33ebbfeb4e 100644 --- a/app/design/frontend/default/iphone/Mage_Customer/form/edit.phtml +++ b/app/design/frontend/default/iphone/Mage_Customer/form/edit.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/iphone/Mage_Customer/form/forgotpassword.phtml b/app/design/frontend/default/iphone/Mage_Customer/form/forgotpassword.phtml index 2868d68ae23..9f143a8a18a 100644 --- a/app/design/frontend/default/iphone/Mage_Customer/form/forgotpassword.phtml +++ b/app/design/frontend/default/iphone/Mage_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/Mage_Customer/form/login.phtml b/app/design/frontend/default/iphone/Mage_Customer/form/login.phtml index f2438b0cd5d..6aa88f55b9f 100644 --- a/app/design/frontend/default/iphone/Mage_Customer/form/login.phtml +++ b/app/design/frontend/default/iphone/Mage_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) */ ?> @@ -46,6 +46,7 @@ <label for="pass"><?php echo $this->__('Enter your password') ?>:</label> <input type="password" class="required-entry validate-password" name="login[password]" id="pass" placeholder="<?php echo $this->__('Password') ?>" /> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> <a href="<?php echo $this->getForgotPasswordUrl() ?>"><?php echo $this->__('Forgot your password?') ?></a> <div class="login-button"> diff --git a/app/design/frontend/default/iphone/Mage_Customer/form/register.phtml b/app/design/frontend/default/iphone/Mage_Customer/form/register.phtml index b71f965edb9..02bea7ac036 100644 --- a/app/design/frontend/default/iphone/Mage_Customer/form/register.phtml +++ b/app/design/frontend/default/iphone/Mage_Customer/form/register.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) */ ?> @@ -160,6 +160,7 @@ <label for="confirmation"><?php echo $this->__('Confirm password') ?>:</label> <input type="password" name="confirmation" id="confirmation" class="required-entry validate-cpassword" placeholder="<?php echo $this->__('Confirm Password') ?>" /> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> <a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><?php echo $this->__('Back') ?></a> <input type="submit" value="<?php echo $this->__('Create') ?>" /> diff --git a/app/design/frontend/default/iphone/Mage_Customer/layout.xml b/app/design/frontend/default/iphone/Mage_Customer/layout.xml index a5d32aed54b..73366b4c43c 100644 --- a/app/design/frontend/default/iphone/Mage_Customer/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Customer/layout.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) */ @@ -263,4 +263,4 @@ Customer account address edit page </reference> </customer_address_form> -</layout> +</layout> \ No newline at end of file diff --git a/app/design/frontend/default/iphone/Mage_Page/1column.phtml b/app/design/frontend/default/iphone/Mage_Page/1column.phtml index 0ff5cce312a..e2e6d84c912 100644 --- a/app/design/frontend/default/iphone/Mage_Page/1column.phtml +++ b/app/design/frontend/default/iphone/Mage_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/Mage_Page/html/footer.phtml b/app/design/frontend/default/iphone/Mage_Page/html/footer.phtml index 9719e392dc9..267a560dbc6 100644 --- a/app/design/frontend/default/iphone/Mage_Page/html/footer.phtml +++ b/app/design/frontend/default/iphone/Mage_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/Mage_Page/html/head.phtml b/app/design/frontend/default/iphone/Mage_Page/html/head.phtml index 93a23f81002..89e3bf1e451 100644 --- a/app/design/frontend/default/iphone/Mage_Page/html/head.phtml +++ b/app/design/frontend/default/iphone/Mage_Page/html/head.phtml @@ -20,13 +20,13 @@ * * @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) */ ?> <title><?php echo $this->getTitle() ?></title> <meta charset="UTF-8"> -<meta name = "viewport" content = "initial-scale = 1, maximum-scale = 1, user-scalable = no"> +<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" /> <meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" /> <meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" /> diff --git a/app/design/frontend/default/iphone/Mage_Page/html/header.phtml b/app/design/frontend/default/iphone/Mage_Page/html/header.phtml index facc5c12d6c..ab52bb9d36c 100644 --- a/app/design/frontend/default/iphone/Mage_Page/html/header.phtml +++ b/app/design/frontend/default/iphone/Mage_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/Mage_Page/html/pager.phtml b/app/design/frontend/default/iphone/Mage_Page/html/pager.phtml index d4a7fd538b4..c355747833f 100644 --- a/app/design/frontend/default/iphone/Mage_Page/html/pager.phtml +++ b/app/design/frontend/default/iphone/Mage_Page/html/pager.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/iphone/Mage_Page/layout.xml b/app/design/frontend/default/iphone/Mage_Page/layout.xml index 04ac5bb1845..2dd4e0dfe5a 100644 --- a/app/design/frontend/default/iphone/Mage_Page/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Page/layout.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/Mage_Page/switch/languages.phtml b/app/design/frontend/default/iphone/Mage_Page/switch/languages.phtml index a4e0ab1a1af..6694bbf1a6c 100644 --- a/app/design/frontend/default/iphone/Mage_Page/switch/languages.phtml +++ b/app/design/frontend/default/iphone/Mage_Page/switch/languages.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/iphone/Mage_Page/switch/stores.phtml b/app/design/frontend/default/iphone/Mage_Page/switch/stores.phtml index 992457716f7..b18573aa23a 100644 --- a/app/design/frontend/default/iphone/Mage_Page/switch/stores.phtml +++ b/app/design/frontend/default/iphone/Mage_Page/switch/stores.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/iphone/Mage_Persistent/checkout/onepage/login.phtml b/app/design/frontend/default/iphone/Mage_Persistent/checkout/onepage/login.phtml index 69f7ac4fc94..a3cf012887b 100644 --- a/app/design/frontend/default/iphone/Mage_Persistent/checkout/onepage/login.phtml +++ b/app/design/frontend/default/iphone/Mage_Persistent/checkout/onepage/login.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) */ ?> @@ -53,6 +53,7 @@ <input type="password" class="input-text required-entry" id="login-password" name="login[password]" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> <?php echo $this->getChildHtml('persistent.remember.me'); ?> </ul> <input name="context" type="hidden" value="checkout" /> diff --git a/app/design/frontend/default/iphone/Mage_Persistent/customer/form/login.phtml b/app/design/frontend/default/iphone/Mage_Persistent/customer/form/login.phtml index 9f98d14c0e7..25ee9b1d37c 100644 --- a/app/design/frontend/default/iphone/Mage_Persistent/customer/form/login.phtml +++ b/app/design/frontend/default/iphone/Mage_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) */ ?> @@ -55,6 +55,7 @@ <label for="pass" class="required"><?php echo $this->__('Password') ?></label> <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" /> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> <?php echo $this->getChildHtml('persistent.remember.me'); ?> </ul> <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?><a href="<?php echo $this->getForgotPasswordUrl() ?>"><?php echo $this->__('Forgot your password?') ?></a> diff --git a/app/design/frontend/default/iphone/Mage_Persistent/customer/form/register.phtml b/app/design/frontend/default/iphone/Mage_Persistent/customer/form/register.phtml index dd7da50d83e..ce0ca885db9 100644 --- a/app/design/frontend/default/iphone/Mage_Persistent/customer/form/register.phtml +++ b/app/design/frontend/default/iphone/Mage_Persistent/customer/form/register.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) */ ?> @@ -164,6 +164,7 @@ <label for="confirmation"><?php echo $this->__('Confirm Password') ?></label> <input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" /> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> <?php echo $this->getChildHtml('persistent.remember.me'); ?> </ul> <input type="submit" value="<?php echo $this->__('Submit') ?>" /> diff --git a/app/design/frontend/default/iphone/Mage_Persistent/layout.xml b/app/design/frontend/default/iphone/Mage_Persistent/layout.xml index 2d7d079a7c6..96732d460b1 100644 --- a/app/design/frontend/default/iphone/Mage_Persistent/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Persistent/layout.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/Mage_Review/layout.xml b/app/design/frontend/default/iphone/Mage_Review/layout.xml index 254c5f6c174..e78c5d71f32 100644 --- a/app/design/frontend/default/iphone/Mage_Review/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Review/layout.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/Mage_Sales/order/history.phtml b/app/design/frontend/default/iphone/Mage_Sales/order/history.phtml index 9ab60555a95..eb38f82e984 100644 --- a/app/design/frontend/default/iphone/Mage_Sales/order/history.phtml +++ b/app/design/frontend/default/iphone/Mage_Sales/order/history.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/Mage_Sales/order/items.phtml b/app/design/frontend/default/iphone/Mage_Sales/order/items.phtml index d4d110eed7c..632b2c1a612 100644 --- a/app/design/frontend/default/iphone/Mage_Sales/order/items.phtml +++ b/app/design/frontend/default/iphone/Mage_Sales/order/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) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Sales/order/recent.phtml b/app/design/frontend/default/iphone/Mage_Sales/order/recent.phtml index f930d3e65ef..36aa40b80b7 100644 --- a/app/design/frontend/default/iphone/Mage_Sales/order/recent.phtml +++ b/app/design/frontend/default/iphone/Mage_Sales/order/recent.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/Mage_Sales/order/totals.phtml b/app/design/frontend/default/iphone/Mage_Sales/order/totals.phtml index 10ad108319f..b4c21123539 100644 --- a/app/design/frontend/default/iphone/Mage_Sales/order/totals.phtml +++ b/app/design/frontend/default/iphone/Mage_Sales/order/totals.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/iphone/Mage_Sendfriend/layout.xml b/app/design/frontend/default/iphone/Mage_Sendfriend/layout.xml index 5042315e4ab..0bd3ca88fef 100644 --- a/app/design/frontend/default/iphone/Mage_Sendfriend/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Sendfriend/layout.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/default/iphone/Mage_Sendfriend/send.phtml b/app/design/frontend/default/iphone/Mage_Sendfriend/send.phtml index 6bd06578319..5d02f145a95 100644 --- a/app/design/frontend/default/iphone/Mage_Sendfriend/send.phtml +++ b/app/design/frontend/default/iphone/Mage_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/default/iphone/Mage_Shipping/tracking/ajax.phtml b/app/design/frontend/default/iphone/Mage_Shipping/tracking/ajax.phtml index 5fded9cea37..fed14d7732d 100644 --- a/app/design/frontend/default/iphone/Mage_Shipping/tracking/ajax.phtml +++ b/app/design/frontend/default/iphone/Mage_Shipping/tracking/ajax.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) */ \ No newline at end of file diff --git a/app/design/frontend/default/iphone/Mage_Shipping/tracking/popup.phtml b/app/design/frontend/default/iphone/Mage_Shipping/tracking/popup.phtml index a136d9a3f4d..892cb69a05d 100644 --- a/app/design/frontend/default/iphone/Mage_Shipping/tracking/popup.phtml +++ b/app/design/frontend/default/iphone/Mage_Shipping/tracking/popup.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/Mage_Tag/layout.xml b/app/design/frontend/default/iphone/Mage_Tag/layout.xml index 868ded54b27..507175ef3f7 100644 --- a/app/design/frontend/default/iphone/Mage_Tag/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Tag/layout.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/Mage_Tag/list.phtml b/app/design/frontend/default/iphone/Mage_Tag/list.phtml index 1292a86ae9c..65f4b758b5d 100644 --- a/app/design/frontend/default/iphone/Mage_Tag/list.phtml +++ b/app/design/frontend/default/iphone/Mage_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/default/iphone/Mage_Wishlist/view.phtml b/app/design/frontend/default/iphone/Mage_Wishlist/view.phtml index ad30bc2066f..b8cbbfc5b5e 100644 --- a/app/design/frontend/default/iphone/Mage_Wishlist/view.phtml +++ b/app/design/frontend/default/iphone/Mage_Wishlist/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) */ /* @var $this Mage_Wishlist_Block_Customer_Wishlist */ diff --git a/app/design/frontend/default/iphone/local.xml b/app/design/frontend/default/iphone/local.xml index 3199c69890e..7f457881f73 100644 --- a/app/design/frontend/default/iphone/local.xml +++ b/app/design/frontend/default/iphone/local.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/skin/default/css/iphone.css b/app/design/frontend/default/iphone/skin/default/css/iphone.css index aad0703eeac..14bd89ffb94 100644 --- a/app/design/frontend/default/iphone/skin/default/css/iphone.css +++ b/app/design/frontend/default/iphone/skin/default/css/iphone.css @@ -19,7 +19,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) */ @@ -46,6 +46,23 @@ h2 { font-size:12px; font-weight:normal; line-height:20px; } legend { display:none; } +.messages .notice-msg, +.messages .success-msg { + background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFE38D), color-stop(100%, #FFD040)); + padding:10px; + color:#222; + font-weight:bold; + text-shadow:0 1px 0 #eee; + -webkit-box-shadow:0 3px 3px #ccc; +} +.messages .success-msg { + background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957)); + border:solid #3D773D; + border-width:1px 0; + color:#fff; + text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25); + margin-bottom:10px; +} /* Header -----------------------------*/ @@ -228,7 +245,7 @@ body > header dt.search > a { background-image:url(../images/i_menu_search.png); background-position:18px 10px; background-repeat:no-repeat; - text-indent:-99000px; + text-indent:-999em; } body > header dt.cart:before, @@ -252,7 +269,7 @@ body > header dt.cart > span:first-child { background-image:url(../images/i_menu_cart.png); background-position:center 10px; background-repeat:no-repeat; - text-indent:-99000px; + text-indent:-999em; } body > header dt.active span:first-child { margin:-1px -6px -7px; @@ -593,7 +610,7 @@ select { border-radius:2px; color:#333; font-size:15px; - padding:3px 20px 3px 7px; + padding:3px 30px 3px 7px; -webkit-appearance:none; -webkit-box-sizing:border-box; } @@ -1009,7 +1026,7 @@ section .category-title { display:none; } display:inline-block; vertical-align:middle; top:-2px; - text-indent:-9999px; + text-indent:-999em; margin-right:2px; } @@ -1124,7 +1141,7 @@ section .category-title { display:none; } position:relative; height:27px; width:27px; - text-indent:-9999px; + text-indent:-999em; -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.15); -webkit-background-clip:padding-box; } @@ -1466,27 +1483,7 @@ section .category-title { display:none; } /* Product Info Box -----------------------------*/ -.catalog-product-view .messages { - margin:0 -10px 0; -} -.catalog-product-view .messages .notice-msg { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFE38D), color-stop(100%, #FFD040)); - padding:10px; - color:#222; - font-weight:bold; - text-shadow:0 1px 0 #eee; -} -.catalog-product-view .messages .success-msg { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957)); - border:solid #3D773D; - border-width:1px 0; - color:#fff; - font-weight:bold; - text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25); - margin-bottom:10px; - padding:10px; - -webkit-box-shadow:0 3px 3px #ccc; -} +.catalog-product-view .messages { margin:0 -10px 0; } .product-view { padding:0 0 0; } .product-shop { padding:8px 0 0; } .product-shop .product-image-and-actions { float:left; margin:0 10px 0 0; } @@ -1506,10 +1503,7 @@ section .category-title { display:none; } 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.animate { -webkit-transform:translate3d(100%,-150px,1px) scale(0) rotate(200deg); z-index:1000; } -@media (orientation: landscape) { - .product-shop .product-image-wrap img.animate { -webkit-transform:translate3d(310px,-150px,1px) scale(0) rotate(200deg); } -} +.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; } @@ -1535,7 +1529,9 @@ section .category-title { display:none; } .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 dotted #555; margin:0 0 10px; padding:0 0 10px; } +.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; } @@ -1559,7 +1555,7 @@ section .category-title { display:none; } .product-shop .product-desc .ratings { overflow:hidden; } .product-shop .product-desc .ratings, .product-shop .product-desc .ratings a { color:#FB6B36; } -.rating-box { width:75px; height:15px; margin:3px 0; } +.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; } @@ -1754,13 +1750,11 @@ section .category-title { display:none; } .compare-back-link { - position:fixed; - top:0; - left:0; - right:0; - padding:5px 5px 5px 20px; + 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)); color:#000; @@ -1774,6 +1768,18 @@ section .category-title { display:none; } 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)); + 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)); @@ -1781,18 +1787,57 @@ section .category-title { display:none; } height:18px; width:18px; position:absolute; - top:10px; - left:11px; + 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; } +.compare-table { border-collapse:collapse; border-spacing:0; table-layout:fixed; -webkit-backface-visibility:hidden; } .compare-table th, -.compare-table td { border:1px solid #ccc; padding:5px 15px; vertical-align:top; } +.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 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)); + 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); +} +.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)); 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:active, .compare-table .collapsible.collapsed .nobr { background:-webkit-gradient(linear, 0 0, 0 100%, from(#ddd), to(#ccc)); } @@ -1828,6 +1873,7 @@ section .category-title { display:none; } -webkit-box-shadow:0 3px 3px 0 #9F9F9F; -webkit-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 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; } @@ -2557,6 +2603,7 @@ section .category-title { display:none; } -webkit-background-clip:padding-box; } .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; } @@ -2594,24 +2641,6 @@ section .category-title { display:none; } .checkout-cart-index .messages { margin:0 -10px 0 !important; } -.checkout-cart-index .messages .notice-msg, -.checkout-cart-index .messages .success-msg, -.my-account .messages .success-msg { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFE38D), color-stop(100%, #FFD040)); - padding:10px; - color:#222; - font-weight:bold; - text-shadow:0 1px 0 #eee; -} -.checkout-cart-index .messages .success-msg, -.my-account .messages .success-msg { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957)); - border:solid #3D773D; - border-width:1px 0; - color:#fff; - text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25); - margin-bottom:10px; -} .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; } @@ -2770,11 +2799,12 @@ section .category-title { display:none; } -----------------------------*/ .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 textarea { width:99%; height:200px; } -.contacts-index-index .fields .field { margin:0 0 8px 0; } .contacts-index-index label { color:#5E5E5E; font-weight:bold; } .contacts-index-index label em { 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; } diff --git a/app/design/frontend/default/iphone/skin/default/images/i_star_black.png b/app/design/frontend/default/iphone/skin/default/images/i_star_black.png new file mode 100644 index 0000000000000000000000000000000000000000..eba185915410f4311e72bd22a25cd5e520f94e44 GIT binary patch literal 3540 zcmaJ^c{r49-yX)2Bo#u5X`*DA#WsvJV@b%qZ;dgSFf+_(><!+?{z?d0DrB-wAs&Q8 z4P`G&Wy_XrlqHG0<9VK*_x<DRyN~0(ujM$;^LJj?b^dYPapso|`3{~q2mk>1j4tX~ zvRVl1RXD)K`kpEOJj7~5$@=zWD}pDPf)2m}E_e{!u^=Nqv=`PAi}nciXJ9n|03aA= zZBMp0H9=wseh~CN1`^~)WU&DN4ecNz8smc{gWR!RIJ_p9+0YCI;XE|KcFLwOQz8oM zjk_2UfVB#_Y>f%=!KitFwY5MRK}eQ>AC`;;1^M~nNys2g@SnO!R)2pQ3I_cNA^T{8 z|1xE7Y7RmX0<a)u2uvOWQ-On2lpt^=n3|HB97q8Mhe6>AP#8iU4nry<kT5vt?+47P z7U1EDwA3^ByB2Gt3HBzFiAX4vLZLt?iV#A87Zk3hrUr#6Kou0^SqOPjFrJJKlE;(I z{8G@vk}v@{A{j@(gZ35C?u0<HCYa^)uO;{q|B=O${@y0mhCzeSL?|2r+h5WzpsDHq z5B2l=2TdYdV*l&+{}d)!2NSVSODu^H7=U3NoadSSQbZ&w0E;FQ0;~xH-(S0E?oA*Q zNZte@2xX-VfrIRDcn<=F^e5ib6lsJfk<oYz)<{ni%u;~ha2`lSg9{3}YH(FJ9IgU~ z>%&!H`Y=^hRb72JTn~XzR`|u$BVYpkuz2z>uE&45YQN>~N5PNCs;q|%z+J<77z7af zKz}Y7iTk}5mXF_g`HSoEdoPIJa-l3U(EWq`pM(B2#Y)e9_n+9Z2LA*fi)W=hfEDXt zx?~mraPXp$-UaKR(ZMVylk^eMm~U}yT+<V?1!98cKu5YXs<&fsK$WiCk)52B)%8w& zKqR#9j;l%&yy@}Ta#tnWG!>Ox??gpf%)*_E<;f2U9+X(bi3xIkY?*CT+X&vP(64p+ zH=piO*>u+)bFb<rC46yrjOpal@Uo-BdAxnrKin{<CvWiW+a$NdJkDKlQPH@X9-Co_ zMppu3aj5co==S<&?Ngc|<j&0QT=lsyLlq=)!Fd3oDV`z=fpiDX_nx*hHGQM1;`Z7K z#Z9MD8a}ciD_`6Kn70;bERF1`+dKv|rebbINJ>fByvf(T-sWuHk0`g83RF)@tLD>q zVr;ee?FY8KTAsmR%n2Mj7M0dSo_Y~i|4r3eWX`>i1~0LRi;I&A4i2tZTJjD4&_fTK z>&{JhxLD}0u_d@1dZ+-LmywY%dk7|WxMA*1&eNdxwSEl;%7irrPVC-dr<{n?UKC3K zu8YGmKh1o}ntaNe{7^_xa7ji+#__~%KOOT@%bWNI-Pil8QAkJ#L_Fi63lIo|<oC>V zG8kW4e-tggE0_JGw#Qu*KU0r8KWqr-VXqUo-PF|79Uj$R6xn+W@Y6p$JY0TmukS|q zk4;mddD5pZH$iV^=UlBZks7`N89IzYJ&uwb>h9?eP=dENQRlk(DdC`O=_+{yV#utP z?0tXn@x6Pexp$u5;8hl2t8-;MiL5V<e}6~wo1RPN%;ZNtz$VtiLlyC3ds__3yS2Jn zWgKnMa#f|Xt4sEhu`y+JSo?NgQ9(Ay$-(5x0C)1k4nS2e$L*d$5CgD*=DjTyd^Ueg z!8mn(q>6krkRz{Eev!!>PuV%2a}8tqfiM#xHfKi9wCCT9A6du*y0iTxl??;Z5mxg` zF1haOlMJ9qqut8Jcgw60K5!Q1Zj|N3^rZJ{zqiHNBM0g_J3DvE%gblhZTbfW6kjco ziOmVjAd7n-CS{<fpk)m&{1UCG=r=s)NhGlCac%;WEVqrh$i+ik_mcnc!WDRlv7KvL zbpCpd8uN`1<kFb=+?%?PrnM6t9sQWBE*oM19C}LbZgIY6{tAg|k;ullDXoUM$`lOj z3=Ud9Rh88_UYB0+s(*l8pmLeX=yaE!qSo?UN~Uj^NlMAB*4C;FrJXZ#zTFXiXhNKM zj@Zz0Xo7E|xeb`qSS_LA(V1ot?c#i$_o8H-{knZ#LKq~(6YNz|TH3X-^PR+Zg`-zF zmR~}vZ+Lj?6~~&BHICyoPjO@B`Mt!oly!J;$Je2#q@8)a=5sy*ZzXHZf?e`D+A6NV zq#sp}Jq!O)x;EEy-Dv6$#+l_9rof|1ihvZDeEf==0+ngyv!&dWs&wb(LFRiwiBqRe zRm{$M`ZsKR9(Xv{eOGPmTMmNoF2}G?7sb5QhSrG~`}pxAS3z_TPO)>6=<1r4&|Wj& zH#WAS>(7CF^`&xfelKKe6&-yiK2X1Z+65`jwbT5ig>ay8H!CYEKTd|->?);EQML;z zcJEo9X6P)(R;gVj-mN}hrbig+8g}R*=eE#03BHg=uW7>1VtfqEh54QLjy4ZS`W*bg z5R{BLhTd^*xA*dTcqX*uRe4t?bZ?oJR$(Vc$LYy#hR#dJQ?Ah}%VE=;(OZJF*O}t7 z-Wa~lIQI*eq!=ho-JtEyNhcA>yh_cXCZL${(z0|4j*nklV=FKsB0@WITUPq^zthua zKIGtVG8-)eZBVyoJG0Y_wB}~g+~t$e76HLWMgPTgO6jseQ5$12YuK!?ieuzR!wQGs zr<o(Z_1E`)^6DfE0O{1cce?K1zs_`Xcn@6=HK!JJDO!j&J$RHl?7tly#eOo|!lBd` zOGD33mU)7OsI^fk5Mg3NgHY~mUl+wbDmdRl0$`?FbTBTbZhlF_q9ZT$rD<?>`Bd-1 zcN5#WPZC^pUqT8B3nc+BKRp0i_WyX+GP6Q;C~l&|l^hIeN(<ry+ikOphc7)UE0fb_ zXNo9iy={Li>_ihXtB!boBTCawmoBIv9+=!0UB#SuTPJ0lA!ll2#PgbySRT^36?9qh zx;%i_x*(mcZwI2VEInqzW!~uCJ~&BeXa9P_%+l$_ZcAbm>0sb$iS0`gEp;Ov(A6cw z&0*idQvyO>PhN8cl+TQvz#4E(+~EuJI+4YrQ4uLWqk%DKdDx3NE&m)PnlYYnJU$GS z;JT1-bs@1UFfcIb1Hq}*cSIXO7;D7!-Pcza8CKAgWtNT#dOsPBZ_DVnqk1SUp47zw z&d;L!ZHwhJOUB*ST0<$!vEAC*+Rdqr#i8cbwthOOC6=~|CoR8Em$i#v&nyk9wC~bL zKlD}05V3pKADSO=E4Y$UOO@T>rJF2bMU_JlqvMycl<)7#oxCpRA~!@F*Y7-+7NIxw zChp$25Y8#DHM4WhI;+T=f;2RA)UT=W89EMh9<Mj#(~@neX}6WU<k&ue0(vw+lO?o& za$@IE5wY|F+I-CYZ+ZY4$~Z7^LxRmFe4-^X|5&1S+tDJGI$)#@TS5kVUOmD|jDI4% zrc9f}S$FT=q+IThR>=B1e7(f*LY`<9%2OTPpPrMIq`p4T3aC&hkg&S6L|xN2FQ$$= z7=##N#*SorTfMB-QVsvqUu1laHm^%9ub|OroWx;4{ial(R*{_ffv}B*x7?})dDQY3 z{-?Xut3P|F-01K$NjJ?=F(RV|$A#y&e4-$4sA3A$B6o3}UNb9-vUj2M6Jm3S<eMq9 z&aljghP_PrDcf?#^rs;k3t`d%X6ChYEnht;-O*fR!1T@1`}d#Q*xReRCgRRt+guu< za5fAw61qc&D&6vp+!8*^M!d;ZHsv4=bR?bp;dw?iHdT3ibNRh6yNssTVJ{2qp0*#^ zD~A=!>F?B&Q*Yh^<XmW`IX%Vm2?`4fPx(XF7bEw2yikX8U95CAr)EHG*#)Eb%gTIt z9PjF*3!56xJ_&>=@IaTl@fyr+w)xgBTIjcxH^#=svPZ7COTRX`n)XC!F<<DEFke*b z75>N(o}qyaLbl+|>J_J|E3NmVx%p*mw41LjJM!`rnJxB7_fC~@Q=ffopq$f<)o?uP zY6il@r2nh%ljq3sY~3t(Amqqsb6NnPEbWhaGqG9+v+YA$k{NFGFLaK@Ke!U==g||# zpZCSu#-_+$8=yHmGd*3{;>SO!s5hGFaDF9T-?TXAtD%Svzr=hD*p+SQ+5M}Bh3vM2 zSXT>V_TApW!P`2-YZdl%cY7)JA%Um9BexExC>~*lQe*vpR&n8<6pth@69b#nq=>c~ zsoLBJULStl6Z_#>rp+GiDq!?@#$0@SJbUQol96=*Teq>JS?qhQ$Dayzy>ywls-qi? z*LrkUa7&b}V!9CxaIm%Aq9PP*tBnUF;{c;_kKZ$>rn9OYH85)1H35d4%wUHc(L~)V zd~-Aun6e#<J^<Zhe~u~MNm@oP>H|kbt2wXY;4FtHCnDU+c5HuC0)T++1@I01#;_av P|5--*m-Q-iuSER^p5<0S literal 0 HcmV?d00001 diff --git a/app/design/frontend/default/iphone/skin/default/js/iphone.js b/app/design/frontend/default/iphone/skin/default/js/iphone.js index 080da6fc83e..84d0e46a903 100644 --- a/app/design/frontend/default/iphone/skin/default/js/iphone.js +++ b/app/design/frontend/default/iphone/skin/default/js/iphone.js @@ -19,7 +19,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) */ @@ -51,8 +51,11 @@ document.observe("dom:loaded", function() { }); } + + var supportsOrientationChange = "onorientationchange" in window, + orientationEvent = supportsOrientationChange ? "orientationchange" : "resize"; - Event.observe(window, 'orientationchange', function() { + Event.observe(window, orientationEvent, function() { var orientation, page; @@ -72,23 +75,25 @@ document.observe("dom:loaded", function() { if ( $('nav-container') ) { - $$("#nav-container ul").each(function(ul) { - ul.setStyle({'width' : document.body.offsetWidth + "px"}); - }); - - page = Math.floor(Math.abs(sliderPosition/viewportWidth)); - sliderPosition = (sliderPosition + viewportWidth*page) - document.body.offsetWidth*page; - viewportWidth = document.body.offsetWidth; - - $("nav-container").setStyle({"-webkit-transform" : "translate3d(" + sliderPosition + "px, 0, 0)"}); + setTimeout(function () { + $$("#nav-container ul").each(function(ul) { + ul.setStyle({'width' : document.body.offsetWidth + "px"}); + }); + + page = Math.floor(Math.abs(sliderPosition/viewportWidth)); + sliderPosition = (sliderPosition + viewportWidth*page) - document.body.offsetWidth*page; + viewportWidth = document.body.offsetWidth; + + $("nav-container").setStyle({"-webkit-transform" : "translate3d(" + sliderPosition + "px, 0, 0)"}); - if ( upSellCarousel ) { - if (orientation === 'landscape') { - upSellCarousel.resize(3); - } else { - upSellCarousel.resize(2); + if ( upSellCarousel ) { + if (orientation === 'landscape') { + upSellCarousel.resize(3); + } else { + upSellCarousel.resize(2); + } } - } + }, 400); } diff --git a/app/design/frontend/default/iphone/theme.xml b/app/design/frontend/default/iphone/theme.xml index 10e73d61a59..e4fb26c28bd 100644 --- a/app/design/frontend/default/iphone/theme.xml +++ b/app/design/frontend/default/iphone/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/view.xml b/app/design/frontend/default/iphone/view.xml index 40bceb48c57..d22ed102437 100644 --- a/app/design/frontend/default/iphone/view.xml +++ b/app/design/frontend/default/iphone/view.xml @@ -21,7 +21,7 @@ * * @category Mage * @package modern_theme - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Catalog/layout.xml b/app/design/frontend/default/modern/Mage_Catalog/layout.xml index 4e481032f5a..c9bc531de0f 100644 --- a/app/design/frontend/default/modern/Mage_Catalog/layout.xml +++ b/app/design/frontend/default/modern/Mage_Catalog/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Catalog/product/list.phtml b/app/design/frontend/default/modern/Mage_Catalog/product/list.phtml index 1ea8c58b3c2..788d41db2e1 100644 --- a/app/design/frontend/default/modern/Mage_Catalog/product/list.phtml +++ b/app/design/frontend/default/modern/Mage_Catalog/product/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Catalog/product/list/upsell.phtml b/app/design/frontend/default/modern/Mage_Catalog/product/list/upsell.phtml index a578afa85eb..76ed77fa607 100644 --- a/app/design/frontend/default/modern/Mage_Catalog/product/list/upsell.phtml +++ b/app/design/frontend/default/modern/Mage_Catalog/product/list/upsell.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Catalog/product/view.phtml b/app/design/frontend/default/modern/Mage_Catalog/product/view.phtml index 34983dd8b9f..36eb9b9db44 100644 --- a/app/design/frontend/default/modern/Mage_Catalog/product/view.phtml +++ b/app/design/frontend/default/modern/Mage_Catalog/product/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Catalog/product/view/media.phtml b/app/design/frontend/default/modern/Mage_Catalog/product/view/media.phtml index f1347d716b9..05108f38ce7 100644 --- a/app/design/frontend/default/modern/Mage_Catalog/product/view/media.phtml +++ b/app/design/frontend/default/modern/Mage_Catalog/product/view/media.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Catalog/product/view/tabs.phtml b/app/design/frontend/default/modern/Mage_Catalog/product/view/tabs.phtml index b9693992f18..ca88182f1c6 100644 --- a/app/design/frontend/default/modern/Mage_Catalog/product/view/tabs.phtml +++ b/app/design/frontend/default/modern/Mage_Catalog/product/view/tabs.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_CatalogSearch/form.mini.phtml b/app/design/frontend/default/modern/Mage_CatalogSearch/form.mini.phtml index 8c5cb9a75d8..507a9522c0b 100644 --- a/app/design/frontend/default/modern/Mage_CatalogSearch/form.mini.phtml +++ b/app/design/frontend/default/modern/Mage_CatalogSearch/form.mini.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_CatalogSearch/layout.xml b/app/design/frontend/default/modern/Mage_CatalogSearch/layout.xml index 9654cfe8f49..73073969cab 100644 --- a/app/design/frontend/default/modern/Mage_CatalogSearch/layout.xml +++ b/app/design/frontend/default/modern/Mage_CatalogSearch/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Checkout/cart.phtml b/app/design/frontend/default/modern/Mage_Checkout/cart.phtml index 2e04c6854c5..646b7e82c29 100644 --- a/app/design/frontend/default/modern/Mage_Checkout/cart.phtml +++ b/app/design/frontend/default/modern/Mage_Checkout/cart.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 +99,8 @@ <?php if($this->getContinueShoppingUrl()): ?> <button type="button" title="<?php echo $this->__('Continue Shopping') ?>" class="button btn-continue" onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button> <?php endif; ?> - <button type="submit" title="<?php echo $this->__('Update Shopping Cart') ?>" class="button btn-update"><span><span><?php echo $this->__('Update Shopping Cart') ?></span></span></button> + <button type="submit" name="update_cart_action" value="empty_cart" title="<?php echo $this->__('Clear Shopping Cart'); ?>" class="button btn-update"><span><span><?php echo $this->__('Clear Shopping Cart'); ?></span></span></button> + <button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update Shopping Cart'); ?>" class="button btn-update" style="margin-left: 5px;"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span></button> </td> </tr> </tfoot> diff --git a/app/design/frontend/default/modern/Mage_Checkout/layout.xml b/app/design/frontend/default/modern/Mage_Checkout/layout.xml index 0b4e1682de9..ad1bb5e2093 100644 --- a/app/design/frontend/default/modern/Mage_Checkout/layout.xml +++ b/app/design/frontend/default/modern/Mage_Checkout/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Contacts/layout.xml b/app/design/frontend/default/modern/Mage_Contacts/layout.xml index f3af686bb42..a6798c446ac 100644 --- a/app/design/frontend/default/modern/Mage_Contacts/layout.xml +++ b/app/design/frontend/default/modern/Mage_Contacts/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Customer/layout.xml b/app/design/frontend/default/modern/Mage_Customer/layout.xml index 61073ddef78..d38b2f7268d 100644 --- a/app/design/frontend/default/modern/Mage_Customer/layout.xml +++ b/app/design/frontend/default/modern/Mage_Customer/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -262,4 +262,4 @@ Customer account address edit page </reference> </customer_address_form> -</layout> +</layout> \ No newline at end of file diff --git a/app/design/frontend/default/modern/Mage_Newsletter/layout.xml b/app/design/frontend/default/modern/Mage_Newsletter/layout.xml index 8675ae7bd56..26944eaa61d 100644 --- a/app/design/frontend/default/modern/Mage_Newsletter/layout.xml +++ b/app/design/frontend/default/modern/Mage_Newsletter/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Newsletter/subscribe.phtml b/app/design/frontend/default/modern/Mage_Newsletter/subscribe.phtml index c020b50ca7d..123d60f8817 100644 --- a/app/design/frontend/default/modern/Mage_Newsletter/subscribe.phtml +++ b/app/design/frontend/default/modern/Mage_Newsletter/subscribe.phtml @@ -20,14 +20,15 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail"> <div class="form-subscribe"> - <div class="form-subscribe-header"><?php echo $this->__('Sign up for our newsletter') ?></div> - <label for="newsletter"><?php echo $this->__('Newsletter Sign-up:') ?></label> + <div class="form-subscribe-header"> + <label for="newsletter"><?php echo $this->__('Newsletter Sign-up:') ?></label> + </div> <div class="input-box"> <input type="text" name="email" id="newsletter" title="<?php echo $this->__('Sign up for our newsletter') ?>" class="input-text required-entry validate-email" /> </div> diff --git a/app/design/frontend/default/modern/Mage_Page/3columns.phtml b/app/design/frontend/default/modern/Mage_Page/3columns.phtml index aa8a272082a..1cba8f16a47 100644 --- a/app/design/frontend/default/modern/Mage_Page/3columns.phtml +++ b/app/design/frontend/default/modern/Mage_Page/3columns.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Page/html/footer.phtml b/app/design/frontend/default/modern/Mage_Page/html/footer.phtml index 8b1791b093c..87e491aba3d 100644 --- a/app/design/frontend/default/modern/Mage_Page/html/footer.phtml +++ b/app/design/frontend/default/modern/Mage_Page/html/footer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Page/html/header.phtml b/app/design/frontend/default/modern/Mage_Page/html/header.phtml index d4aa6b4ffab..b9588f15d9e 100644 --- a/app/design/frontend/default/modern/Mage_Page/html/header.phtml +++ b/app/design/frontend/default/modern/Mage_Page/html/header.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Page/layout.xml b/app/design/frontend/default/modern/Mage_Page/layout.xml index 20d2fd8126a..264ee3815c5 100644 --- a/app/design/frontend/default/modern/Mage_Page/layout.xml +++ b/app/design/frontend/default/modern/Mage_Page/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Payment/layout.xml b/app/design/frontend/default/modern/Mage_Payment/layout.xml index f8b282b00ed..d9142e4c196 100644 --- a/app/design/frontend/default/modern/Mage_Payment/layout.xml +++ b/app/design/frontend/default/modern/Mage_Payment/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Persistent/layout.xml b/app/design/frontend/default/modern/Mage_Persistent/layout.xml index 4f993e32ecf..fcd528af940 100644 --- a/app/design/frontend/default/modern/Mage_Persistent/layout.xml +++ b/app/design/frontend/default/modern/Mage_Persistent/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Review/layout.xml b/app/design/frontend/default/modern/Mage_Review/layout.xml index 164a3f2a274..5d74aa94c12 100644 --- a/app/design/frontend/default/modern/Mage_Review/layout.xml +++ b/app/design/frontend/default/modern/Mage_Review/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Rss/layout.xml b/app/design/frontend/default/modern/Mage_Rss/layout.xml index cada63a5e73..8568f092c10 100644 --- a/app/design/frontend/default/modern/Mage_Rss/layout.xml +++ b/app/design/frontend/default/modern/Mage_Rss/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Sales/layout.xml b/app/design/frontend/default/modern/Mage_Sales/layout.xml index 148cf032157..7fd68aae476 100644 --- a/app/design/frontend/default/modern/Mage_Sales/layout.xml +++ b/app/design/frontend/default/modern/Mage_Sales/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Sendfriend/layout.xml b/app/design/frontend/default/modern/Mage_Sendfriend/layout.xml index 00eb476f015..befd58dd9c4 100644 --- a/app/design/frontend/default/modern/Mage_Sendfriend/layout.xml +++ b/app/design/frontend/default/modern/Mage_Sendfriend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Tag/layout.xml b/app/design/frontend/default/modern/Mage_Tag/layout.xml index 2e9ce7190f9..b91487556ea 100644 --- a/app/design/frontend/default/modern/Mage_Tag/layout.xml +++ b/app/design/frontend/default/modern/Mage_Tag/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/Mage_Wishlist/layout.xml b/app/design/frontend/default/modern/Mage_Wishlist/layout.xml index 8aa887e2959..76d8ec45ea3 100644 --- a/app/design/frontend/default/modern/Mage_Wishlist/layout.xml +++ b/app/design/frontend/default/modern/Mage_Wishlist/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/skin/default/Mage_Catalog/widgets.css b/app/design/frontend/default/modern/skin/default/Mage_Catalog/widgets.css index db0e81e65dd..9b6ea509037 100644 --- a/app/design/frontend/default/modern/skin/default/Mage_Catalog/widgets.css +++ b/app/design/frontend/default/modern/skin/default/Mage_Catalog/widgets.css @@ -19,7 +19,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/skin/default/Mage_Cms/widgets.css b/app/design/frontend/default/modern/skin/default/Mage_Cms/widgets.css index 007a3c31d84..c0ff60a2797 100644 --- a/app/design/frontend/default/modern/skin/default/Mage_Cms/widgets.css +++ b/app/design/frontend/default/modern/skin/default/Mage_Cms/widgets.css @@ -19,7 +19,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/skin/default/Mage_Reports/widgets.css b/app/design/frontend/default/modern/skin/default/Mage_Reports/widgets.css index 3f64eb0124f..ca30335c181 100644 --- a/app/design/frontend/default/modern/skin/default/Mage_Reports/widgets.css +++ b/app/design/frontend/default/modern/skin/default/Mage_Reports/widgets.css @@ -19,7 +19,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/skin/default/css/print.css b/app/design/frontend/default/modern/skin/default/css/print.css index 18f420a5acb..900cbbead7d 100644 --- a/app/design/frontend/default/modern/skin/default/css/print.css +++ b/app/design/frontend/default/modern/skin/default/css/print.css @@ -19,7 +19,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/skin/default/css/styles-ie.css b/app/design/frontend/default/modern/skin/default/css/styles-ie.css index f6741d6427f..1f32591a6b3 100644 --- a/app/design/frontend/default/modern/skin/default/css/styles-ie.css +++ b/app/design/frontend/default/modern/skin/default/css/styles-ie.css @@ -19,7 +19,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/skin/default/css/styles.css b/app/design/frontend/default/modern/skin/default/css/styles.css index cc1b34b7c34..f66070fca80 100644 --- a/app/design/frontend/default/modern/skin/default/css/styles.css +++ b/app/design/frontend/default/modern/skin/default/css/styles.css @@ -19,7 +19,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -400,7 +400,7 @@ tr.summary-details-excluded { font-style:italic; } .std ul.disc { list-style:disc outside; padding-left:18px; margin:0 0 10px; } .std dl dt { font-weight:bold; } .std dl dd { margin:0 0 10px; } -/*.std ul, +.std ul, .std ol, .std dl, .std p, @@ -420,7 +420,7 @@ tr.summary-details-excluded { font-style:italic; } .std b, .std strong { font-weight:bold; } .std i, -.std em { font-style:italic; }*/ +.std em { font-style:italic; } /* Misc */ .links li { display:inline; } @@ -1399,6 +1399,26 @@ f/********** Product Prices > */ .account-create {} /* Account Login/Create Pages ============================================================ */ +/* Captcha */ +.captcha-note { clear:left; padding-top:5px; } +.captcha-image { float:left; display:inline; margin:0; position:relative; width:258px; } +.captcha-image .captcha-img { border:1px solid #b6b6b6; vertical-align:bottom; width:100%; } +.registered-users .captcha-image { margin:0; } +.captcha-reload { cursor:pointer; position:absolute; top:2px; right:2px; } +.captcha-reload.refreshing { animation:rotate 1.5s infinite linear; -webkit-animation:rotate 1.5s infinite linear; -moz-animation:rotate 1.5s infinite linear; } + +@-webkit-keyframes rotate { + 0% { -webkit-transform:rotate(0); } + 0% { -webkit-transform:rotate(-360deg); } +} +@-moz-keyframes rotate { + 0% { -moz-transform:rotate(0); } + 0% { -moz-transform:rotate(-360deg); } +} +@keyframes rotate { + 0% { transform:rotate(0); } + 0% { transform:rotate(-360deg); } +} /* Remember Me Popup ===================================================================== */ .window-overlay { background:rgba(0, 0, 0, 0.35); position:absolute; top:0; left:0; height:100%; width:100%; z-index:990; } diff --git a/app/design/frontend/default/modern/theme.xml b/app/design/frontend/default/modern/theme.xml index 9dff831d0e4..f0eb3e8985c 100644 --- a/app/design/frontend/default/modern/theme.xml +++ b/app/design/frontend/default/modern/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (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/modern/view.xml b/app/design/frontend/default/modern/view.xml index 79417b93ee2..07af45fdb5e 100644 --- a/app/design/frontend/default/modern/view.xml +++ b/app/design/frontend/default/modern/view.xml @@ -21,7 +21,7 @@ * * @category Mage * @package modern_theme - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/install/default/default/skin/default/css/boxes.css b/app/design/install/default/default/skin/default/css/boxes.css index da6d1cd346c..a74adeb850a 100644 --- a/app/design/install/default/default/skin/default/css/boxes.css +++ b/app/design/install/default/default/skin/default/css/boxes.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/install/default/default/skin/default/css/clears.css b/app/design/install/default/default/skin/default/css/clears.css index a685e4e8182..808db1458dc 100644 --- a/app/design/install/default/default/skin/default/css/clears.css +++ b/app/design/install/default/default/skin/default/css/clears.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/install/default/default/skin/default/css/ie7minus.css b/app/design/install/default/default/skin/default/css/ie7minus.css index 269cbac2968..bae36ec0c4c 100644 --- a/app/design/install/default/default/skin/default/css/ie7minus.css +++ b/app/design/install/default/default/skin/default/css/ie7minus.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/install/default/default/skin/default/css/iestyles.css b/app/design/install/default/default/skin/default/css/iestyles.css index 787d27112ba..106a0989e3f 100644 --- a/app/design/install/default/default/skin/default/css/iestyles.css +++ b/app/design/install/default/default/skin/default/css/iestyles.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ .col2-set, diff --git a/app/design/install/default/default/skin/default/css/reset.css b/app/design/install/default/default/skin/default/css/reset.css index a27b0154ccf..737af5617c3 100644 --- a/app/design/install/default/default/skin/default/css/reset.css +++ b/app/design/install/default/default/skin/default/css/reset.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /******************************************/ diff --git a/app/design/install/default/default/theme.xml b/app/design/install/default/default/theme.xml index 45b319d3a8b..349c67c5c2e 100644 --- a/app/design/install/default/default/theme.xml +++ b/app/design/install/default/default/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/config.xml b/app/etc/config.xml index a3c1df60677..29a04117569 100644 --- a/app/etc/config.xml +++ b/app/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) */ --> diff --git a/app/etc/local.xml.additional b/app/etc/local.xml.additional index d2f4cc7812d..169c11fc2a9 100644 --- a/app/etc/local.xml.additional +++ b/app/etc/local.xml.additional @@ -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/etc/local.xml.template b/app/etc/local.xml.template index 5b64224770d..59666ca0324 100644 --- a/app/etc/local.xml.template +++ b/app/etc/local.xml.template @@ -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/etc/modules/Mage_All.xml b/app/etc/modules/Mage_All.xml index ae5d4823e5c..36f71f0e249 100644 --- a/app/etc/modules/Mage_All.xml +++ b/app/etc/modules/Mage_All.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/etc/modules/Mage_Api.xml b/app/etc/modules/Mage_Api.xml index 221755f06b9..1fed7e48304 100644 --- a/app/etc/modules/Mage_Api.xml +++ b/app/etc/modules/Mage_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/etc/modules/Mage_Authorizenet.xml b/app/etc/modules/Mage_Authorizenet.xml index 81a887a2202..fc666db0f65 100755 --- a/app/etc/modules/Mage_Authorizenet.xml +++ b/app/etc/modules/Mage_Authorizenet.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/etc/modules/Mage_Bundle.xml b/app/etc/modules/Mage_Bundle.xml index 548c813708b..395f9d9a7e8 100644 --- a/app/etc/modules/Mage_Bundle.xml +++ b/app/etc/modules/Mage_Bundle.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) */ --> diff --git a/app/etc/modules/Mage_Captcha.xml b/app/etc/modules/Mage_Captcha.xml new file mode 100755 index 00000000000..ef84e715540 --- /dev/null +++ b/app/etc/modules/Mage_Captcha.xml @@ -0,0 +1,39 @@ +<?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_Captcha + * @copyright 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> + <modules> + <Mage_Captcha> + <active>true</active> + <codePool>core</codePool> + <depends> + <Mage_Customer /> + <Mage_Adminhtml /> + </depends> + </Mage_Captcha> + </modules> +</config> diff --git a/app/etc/modules/Mage_Centinel.xml b/app/etc/modules/Mage_Centinel.xml index 180c0cec2b4..51871d22e06 100644 --- a/app/etc/modules/Mage_Centinel.xml +++ b/app/etc/modules/Mage_Centinel.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/etc/modules/Mage_Connect.xml b/app/etc/modules/Mage_Connect.xml index 8125e961d6d..6b6ec062e72 100644 --- a/app/etc/modules/Mage_Connect.xml +++ b/app/etc/modules/Mage_Connect.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/etc/modules/Mage_Downloadable.xml b/app/etc/modules/Mage_Downloadable.xml index 4d18665fa6e..3902d8d3dc5 100644 --- a/app/etc/modules/Mage_Downloadable.xml +++ b/app/etc/modules/Mage_Downloadable.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/etc/modules/Mage_GoogleOptimizer.xml b/app/etc/modules/Mage_GoogleOptimizer.xml index 61329ad2485..73dbeffed74 100644 --- a/app/etc/modules/Mage_GoogleOptimizer.xml +++ b/app/etc/modules/Mage_GoogleOptimizer.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_GoogleShopping.xml b/app/etc/modules/Mage_GoogleShopping.xml index 8eef51621bc..4eef74bafb0 100644 --- a/app/etc/modules/Mage_GoogleShopping.xml +++ b/app/etc/modules/Mage_GoogleShopping.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_ImportExport.xml b/app/etc/modules/Mage_ImportExport.xml index 314f4dc6763..a0029e0ffe4 100755 --- a/app/etc/modules/Mage_ImportExport.xml +++ b/app/etc/modules/Mage_ImportExport.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/etc/modules/Mage_LoadTest.xml b/app/etc/modules/Mage_LoadTest.xml index 9df587b51ce..21439fa6f92 100644 --- a/app/etc/modules/Mage_LoadTest.xml +++ b/app/etc/modules/Mage_LoadTest.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_LoadTest - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_Ogone.xml b/app/etc/modules/Mage_Ogone.xml index 89a7ba96251..c2430245949 100644 --- a/app/etc/modules/Mage_Ogone.xml +++ b/app/etc/modules/Mage_Ogone.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_PageCache.xml b/app/etc/modules/Mage_PageCache.xml index 34ee30e9c30..ddac7728a32 100644 --- a/app/etc/modules/Mage_PageCache.xml +++ b/app/etc/modules/Mage_PageCache.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/etc/modules/Mage_Persistent.xml b/app/etc/modules/Mage_Persistent.xml index 56fdf052174..35cc48e0532 100644 --- a/app/etc/modules/Mage_Persistent.xml +++ b/app/etc/modules/Mage_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/etc/modules/Mage_Weee.xml b/app/etc/modules/Mage_Weee.xml index 3b55ba4196a..8a12bfefe9c 100644 --- a/app/etc/modules/Mage_Weee.xml +++ b/app/etc/modules/Mage_Weee.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/etc/modules/Mage_Widget.xml b/app/etc/modules/Mage_Widget.xml index d3958ba92bc..69d1e0eec91 100644 --- a/app/etc/modules/Mage_Widget.xml +++ b/app/etc/modules/Mage_Widget.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/etc/modules/Mage_XmlConnect.xml b/app/etc/modules/Mage_XmlConnect.xml index 9b36095f4fb..cf85eab5dba 100644 --- a/app/etc/modules/Mage_XmlConnect.xml +++ b/app/etc/modules/Mage_XmlConnect.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/etc/modules/Phoenix_Moneybookers.xml b/app/etc/modules/Phoenix_Moneybookers.xml index 8bf39db839a..c45021b2270 100644 --- a/app/etc/modules/Phoenix_Moneybookers.xml +++ b/app/etc/modules/Phoenix_Moneybookers.xml @@ -21,7 +21,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/shell/indexer.php b/dev/shell/indexer.php index 768e5df4117..b02bfc63f8e 100644 --- a/dev/shell/indexer.php +++ b/dev/shell/indexer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shell - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/shell/install.php b/dev/shell/install.php index d1411999dbc..e429124c5fc 100644 --- a/dev/shell/install.php +++ b/dev/shell/install.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/shell/log.php b/dev/shell/log.php index 30ddfa0a651..fdfaa71a6d2 100644 --- a/dev/shell/log.php +++ b/dev/shell/log.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shell - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/etc/integration-tests-config.xml b/dev/tests/integration/etc/integration-tests-config.xml index aabbce7bd72..268d596fec0 100644 --- a/dev/tests/integration/etc/integration-tests-config.xml +++ b/dev/tests/integration/etc/integration-tests-config.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/etc/local-mysql.xml.dist b/dev/tests/integration/etc/local-mysql.xml.dist index d315318f35e..04771b02ea5 100644 --- a/dev/tests/integration/etc/local-mysql.xml.dist +++ b/dev/tests/integration/etc/local-mysql.xml.dist @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/framework/Magento/Test/Bootstrap.php b/dev/tests/integration/framework/Magento/Test/Bootstrap.php index 960a66d0e29..9706ca220d2 100644 --- a/dev/tests/integration/framework/Magento/Test/Bootstrap.php +++ b/dev/tests/integration/framework/Magento/Test/Bootstrap.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -143,12 +143,12 @@ class Magento_Test_Bootstrap * Self instance getter * * @return Magento_Test_Bootstrap - * @throws Exception + * @throws Magento_Exception */ public static function getInstance() { if (!self::$_instance) { - throw new Exception('Bootstrap instance is not defined yet.'); + throw new Magento_Exception('Bootstrap instance is not defined yet.'); } return self::$_instance; } @@ -175,13 +175,15 @@ class Magento_Test_Bootstrap * @param string $moduleEtcFiles * @param string $tmpDir * @param string $cleanupAction + * @param bool $developerMode + * @throws Magento_Exception */ public function __construct( $magentoDir, $localXmlFile, $globalEtcFiles, $moduleEtcFiles, $tmpDir, $cleanupAction = self::CLEANUP_NONE, $developerMode = false ) { if (!in_array($cleanupAction, array(self::CLEANUP_NONE, self::CLEANUP_UNINSTALL, self::CLEANUP_RESTORE_DB))) { - throw new Exception("Cleanup action '{$cleanupAction}' is not supported."); + throw new Magento_Exception("Cleanup action '{$cleanupAction}' is not supported."); } $this->_magentoDir = $magentoDir; @@ -270,12 +272,12 @@ class Magento_Test_Bootstrap * Re-create empty temporary dir by specified * * @param string $optionCode - * @throws Exception if one of protected directories specified + * @throws Magento_Exception if one of protected directories specified */ public function cleanupDir($optionCode) { if (in_array($optionCode, array('etc_dir', 'var_dir', 'media_dir'))) { - throw new Exception("Directory '{$optionCode}' must not be cleaned up while running tests."); + throw new Magento_Exception("Directory '{$optionCode}' must not be cleaned up while running tests."); } $dir = $this->_options[$optionCode]; $this->_removeDirectory($dir, false); @@ -318,18 +320,18 @@ class Magento_Test_Bootstrap /** * Load application local.xml file, determine database vendor name * - * @throws Exception + * @throws Magento_Exception */ protected function _readLocalXml() { if (!is_file($this->_localXmlFile)) { - throw new Exception("Local XML configuration file '{$this->_localXmlFile}' does not exist."); + throw new Magento_Exception("Local XML configuration file '{$this->_localXmlFile}' does not exist."); } $this->_localXml = simplexml_load_file($this->_localXmlFile); $dbVendorId = (string)$this->_localXml->global->resources->default_setup->connection->model; $dbVendorMap = array('mysql4' => 'mysql', 'mssql' => 'mssql', 'oracle' => 'oracle'); if (!array_key_exists($dbVendorId, $dbVendorMap)) { - throw new Exception("Database vendor '{$dbVendorId}' is not supported."); + throw new Magento_Exception("Database vendor '{$dbVendorId}' is not supported."); } $this->_dbVendorName = $dbVendorMap[$dbVendorId]; } @@ -338,17 +340,17 @@ class Magento_Test_Bootstrap * Check all required directories contents and permissions * * @param string $tmpDir - * @throws Exception when any of required directories is not eligible + * @throws Magento_Exception when any of required directories is not eligible */ protected function _verifyDirectories($tmpDir) { /* Magento application dir */ if (!is_file($this->_magentoDir . '/app/bootstrap.php')) { - throw new Exception('Unable to locate Magento root folder and bootstrap.php.'); + throw new Magento_Exception('Unable to locate Magento root folder and bootstrap.php.'); } /* Temporary directory */ if (!is_dir($tmpDir) || !is_writable($tmpDir)) { - throw new Exception("The '{$tmpDir}' is not a directory or not writable."); + throw new Magento_Exception("The '{$tmpDir}' is not a directory or not writable."); } } @@ -400,7 +402,7 @@ class Magento_Test_Bootstrap /** * Create a directory with write permissions or don't touch existing one * - * @throws Exception + * @throws Magento_Exception * @param string $dir */ protected function _ensureDirExists($dir) @@ -410,7 +412,7 @@ class Magento_Test_Bootstrap mkdir($dir, 0777); umask($old); } else if (!is_dir($dir)) { - throw new Exception("'$dir' is not a directory."); + throw new Magento_Exception("'$dir' is not a directory."); } } @@ -440,6 +442,8 @@ class Magento_Test_Bootstrap /** * Install application using temporary directory and vendor-specific database settings + * + * @throws Magento_Exception */ protected function _install() { @@ -464,7 +468,9 @@ class Magento_Test_Bootstrap /* Make sure that local.xml contains an invalid installation date */ $installDate = (string)$this->_localXml->global->install->date; if ($installDate && strtotime($installDate)) { - throw new Exception("Configuration file '$this->_localXmlFile' must contain an invalid installation date."); + throw new Magento_Exception( + "Configuration file '$this->_localXmlFile' must contain an invalid installation date." + ); } /* Replace local.xml */ @@ -485,7 +491,7 @@ class Magento_Test_Bootstrap $localXml = file_get_contents($targetLocalXml); $localXml = str_replace($installDate, date('r'), $localXml, $replacementCount); if ($replacementCount != 1) { - throw new Exception("Unable to replace installation date properly in '$targetLocalXml' file."); + throw new Magento_Exception("Unable to replace installation date properly in '$targetLocalXml' file."); } file_put_contents($targetLocalXml, $localXml, LOCK_EX); diff --git a/dev/tests/integration/framework/Magento/Test/Db/DbAbstract.php b/dev/tests/integration/framework/Magento/Test/Db/DbAbstract.php index 74a73f8feec..cc057f66ea0 100644 --- a/dev/tests/integration/framework/Magento/Test/Db/DbAbstract.php +++ b/dev/tests/integration/framework/Magento/Test/Db/DbAbstract.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 +72,8 @@ abstract class Magento_Test_Db_DbAbstract * @param string $user * @param string $password * @param string $schema - * @param string $dumpFile + * @param string $varPath + * @throws Magento_Exception */ public function __construct($host, $user, $password, $schema, $varPath) { @@ -83,7 +84,9 @@ abstract class Magento_Test_Db_DbAbstract $this->_varPath = $varPath; if (!is_dir($this->_varPath) || !is_writable($this->_varPath)) { - throw new Exception(sprintf('The specified "%s" is not a directory or not writable.', $this->_varPath)); + throw new Magento_Exception( + sprintf('The specified "%s" is not a directory or not writable.', $this->_varPath) + ); } } diff --git a/dev/tests/integration/framework/Magento/Test/Db/Mysql.php b/dev/tests/integration/framework/Magento/Test/Db/Mysql.php index 7eb7063b2dc..9841c2c138b 100644 --- a/dev/tests/integration/framework/Magento/Test/Db/Mysql.php +++ b/dev/tests/integration/framework/Magento/Test/Db/Mysql.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Entity.php b/dev/tests/integration/framework/Magento/Test/Entity.php index f4db5ec17f1..4462398cbc0 100644 --- a/dev/tests/integration/framework/Magento/Test/Entity.php +++ b/dev/tests/integration/framework/Magento/Test/Entity.php @@ -21,7 +21,7 @@ * @category Magento * @package Test * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Helper/Config.php b/dev/tests/integration/framework/Magento/Test/Helper/Config.php index daa3f1ecc5f..1a25c4fc52e 100644 --- a/dev/tests/integration/framework/Magento/Test/Helper/Config.php +++ b/dev/tests/integration/framework/Magento/Test/Helper/Config.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Test * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Helper/Factory.php b/dev/tests/integration/framework/Magento/Test/Helper/Factory.php index 02e130a335c..1f3997adacb 100644 --- a/dev/tests/integration/framework/Magento/Test/Helper/Factory.php +++ b/dev/tests/integration/framework/Magento/Test/Helper/Factory.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Test * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Listener.php b/dev/tests/integration/framework/Magento/Test/Listener.php index c77aa83570d..3bc6b8188ab 100644 --- a/dev/tests/integration/framework/Magento/Test/Listener.php +++ b/dev/tests/integration/framework/Magento/Test/Listener.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Config.php b/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Config.php index 621a27c01cb..6f76834550b 100644 --- a/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Config.php +++ b/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Config.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Fixture.php b/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Fixture.php index be4c5f37708..a590df6794e 100644 --- a/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Fixture.php +++ b/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Fixture.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -117,8 +117,6 @@ class Magento_Test_Listener_Annotation_Fixture /** * Start transaction - * - * @throws Exception */ protected function _startTransaction() { @@ -155,6 +153,7 @@ class Magento_Test_Listener_Annotation_Fixture * Execute fixture scripts if any * * @param array $fixtures + * @throws Magento_Exception */ protected function _applyFixtures(array $fixtures) { @@ -164,14 +163,14 @@ class Magento_Test_Listener_Annotation_Fixture /* Start transaction before applying first fixture to be able to revert them all further */ if (empty($this->_appliedFixtures)) { if (!$this->_isSingleConnection()) { - throw new Exception('Transaction fixtures with 2 connections are not implemented yet.'); + throw new Magento_Exception('Transaction fixtures with 2 connections are not implemented yet.'); } $this->_startTransaction(); } /* Execute fixture scripts */ foreach ($fixtures as $fixture) { if (strpos($fixture, '\\') !== false) { - throw new Exception('The "\" symbol is not allowed for fixture definition.'); + throw new Magento_Exception('The "\" symbol is not allowed for fixture definition.'); } $fixtureMethod = array(get_class($this->_listener->getCurrentTest()), $fixture); $fixtureScript = realpath(__DIR__ . '/../../../../../testsuite') . DIRECTORY_SEPARATOR . $fixture; diff --git a/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Isolation.php b/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Isolation.php index eea7c24d5e6..fc8a5dfa7b1 100644 --- a/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Isolation.php +++ b/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Isolation.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,6 +74,8 @@ class Magento_Test_Listener_Annotation_Isolation /** * Handler for 'endTest' event + * + * @throws Magento_Exception */ public function endTest() { @@ -86,7 +88,9 @@ class Magento_Test_Listener_Annotation_Isolation if (isset($annotations['method']['magentoAppIsolation'])) { $isolation = $annotations['method']['magentoAppIsolation']; if ($isolation !== array('enabled') && $isolation !== array('disabled')) { - throw new Exception('Invalid "@magentoAppIsolation" annotation, can be "enabled" or "disabled" only.'); + throw new Magento_Exception( + 'Invalid "@magentoAppIsolation" annotation, can be "enabled" or "disabled" only.' + ); } $isIsolationEnabled = ($isolation === array('enabled')); } else { diff --git a/dev/tests/integration/framework/Magento/Test/Profiler/OutputBamboo.php b/dev/tests/integration/framework/Magento/Test/Profiler/OutputBamboo.php index 9f2925e2b82..94801e253ea 100644 --- a/dev/tests/integration/framework/Magento/Test/Profiler/OutputBamboo.php +++ b/dev/tests/integration/framework/Magento/Test/Profiler/OutputBamboo.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Test * @subpackage integration_test - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Request.php b/dev/tests/integration/framework/Magento/Test/Request.php index 55ffe32d554..677ecee2bf5 100644 --- a/dev/tests/integration/framework/Magento/Test/Request.php +++ b/dev/tests/integration/framework/Magento/Test/Request.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Response.php b/dev/tests/integration/framework/Magento/Test/Response.php index e7838d240fd..fc73a2613c8 100644 --- a/dev/tests/integration/framework/Magento/Test/Response.php +++ b/dev/tests/integration/framework/Magento/Test/Response.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/TestCase/ControllerAbstract.php b/dev/tests/integration/framework/Magento/Test/TestCase/ControllerAbstract.php index d5e5628eae4..6ae0ff7ad46 100644 --- a/dev/tests/integration/framework/Magento/Test/TestCase/ControllerAbstract.php +++ b/dev/tests/integration/framework/Magento/Test/TestCase/ControllerAbstract.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/TestCase/IntegrityAbstract.php b/dev/tests/integration/framework/Magento/Test/TestCase/IntegrityAbstract.php index 1db580155af..b00d2443384 100644 --- a/dev/tests/integration/framework/Magento/Test/TestCase/IntegrityAbstract.php +++ b/dev/tests/integration/framework/Magento/Test/TestCase/IntegrityAbstract.php @@ -21,7 +21,7 @@ * @category Magento * @package Test * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/TestSuite/ModuleGroups.php b/dev/tests/integration/framework/Magento/Test/TestSuite/ModuleGroups.php index 94328668170..f76a2e78927 100644 --- a/dev/tests/integration/framework/Magento/Test/TestSuite/ModuleGroups.php +++ b/dev/tests/integration/framework/Magento/Test/TestSuite/ModuleGroups.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/bootstrap.php b/dev/tests/integration/framework/bootstrap.php index 3cb1cfdf72c..0a9a84d2526 100644 --- a/dev/tests/integration/framework/bootstrap.php +++ b/dev/tests/integration/framework/bootstrap.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/framework/bootstrap.php b/dev/tests/integration/framework/tests/unit/framework/bootstrap.php index 376a19c3313..a06c006f126 100644 --- a/dev/tests/integration/framework/tests/unit/framework/bootstrap.php +++ b/dev/tests/integration/framework/tests/unit/framework/bootstrap.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/phpunit.xml.dist b/dev/tests/integration/framework/tests/unit/phpunit.xml.dist index 9ce04167e74..d5af756af1a 100644 --- a/dev/tests/integration/framework/tests/unit/phpunit.xml.dist +++ b/dev/tests/integration/framework/tests/unit/phpunit.xml.dist @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-custom.xml b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-custom.xml index d897e3335e4..e71daca8dcf 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-custom.xml +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-custom.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-invalid.xml b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-invalid.xml index f45cd36194f..c85d327ba34 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-invalid.xml +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-invalid.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php index 72e1dd350da..c11d8a4b201 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 @@ class Magento_Test_BootstrapTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception */ public function testGetInstance() { @@ -244,7 +244,7 @@ class Magento_Test_BootstrapTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception */ public function testConstructorCleanupException() { @@ -253,7 +253,7 @@ class Magento_Test_BootstrapTest extends PHPUnit_Framework_TestCase /** * @dataProvider constructorExceptionDataProvider - * @expectedException Exception + * @expectedException Magento_Exception */ public function testConstructorException($localXmlFile) { @@ -286,7 +286,8 @@ class Magento_Test_BootstrapTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @dataProvider cleanupDirExceptionDataProvider + * @expectedException Magento_Exception */ public function testCleanupDirException($optionCode) { @@ -299,10 +300,9 @@ class Magento_Test_BootstrapTest extends PHPUnit_Framework_TestCase public function cleanupDirExceptionDataProvider() { return array( - array('etc_dir'), - array('var_dir'), - array('media_dir'), - array('static_dir') + 'etc' => array('etc_dir'), + 'var' => array('var_dir'), + 'media' => array('media_dir'), ); } } diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Db/MysqlTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Db/MysqlTest.php index dafc88b8526..f501c496a34 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Db/MysqlTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Db/MysqlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php index 53e04624892..59d57880ba9 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,13 +42,15 @@ class Magento_Test_EntityTest extends PHPUnit_Framework_TestCase /** * Callback for save method in mocked model + * + * @throws Magento_Exception */ public function saveModelAndFailOnUpdate() { if (!$this->_model->getId()) { $this->saveModelSuccessfully(); } else { - throw new Exception('Synthetic model update failure.'); + throw new Magento_Exception('Synthetic model update failure.'); } } @@ -64,7 +66,7 @@ class Magento_Test_EntityTest extends PHPUnit_Framework_TestCase { return array( 'successful CRUD' => array('saveModelSuccessfully'), - 'cleanup on update error' => array('saveModelAndFailOnUpdate', 'Exception'), + 'cleanup on update error' => array('saveModelAndFailOnUpdate', 'Magento_Exception'), ); } diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/FactoryTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/FactoryTest.php index 98f674dc10b..dd3ee83db21 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/FactoryTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/FactoryTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/ConfigTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/ConfigTest.php index 88a553cb77c..bf56e11dc9b 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/ConfigTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/FixtureTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/FixtureTest.php index 64b8a823263..0dec19426ec 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/FixtureTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/FixtureTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -132,6 +132,15 @@ class Magento_Test_Listener_Annotation_FixtureTest extends PHPUnit_Framework_Tes $this->_annotation->endTest(); } + /** + * @magentoDataFixture fixture\path\must\not\contain\backslash.php + * @expectedException Magento_Exception + */ + public function testMethodAnnotationInvalidPath() + { + $this->_annotation->startTest(); + } + /** * @param Magento_Test_Listener_Annotation_Fixture $annotation * @depends testClassAnnotation diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/IsolationTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/IsolationTest.php index dc1e90f381d..cac803a6c14 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/IsolationTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/IsolationTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,13 @@ class Magento_Test_Listener_Annotation_IsolationTest extends PHPUnit_Framework_T protected function tearDown() { - $this->_listener->endTest($this->_listener->getCurrentTest(), 0); + /* + * If an exception is thrown by a listener on 'startTest' event, + * 'setUp' method won't be executed and there will be nothing to cleanup + */ + if ($this->_listener) { + $this->_listener->endTest($this->_listener->getCurrentTest(), 0); + } } public function testStartTestSuite() @@ -65,7 +71,7 @@ class Magento_Test_Listener_Annotation_IsolationTest extends PHPUnit_Framework_T /** * @magentoAppIsolation invalid - * @expectedException Exception + * @expectedException Magento_Exception */ public function testEndTestIsolationInvalid() { @@ -75,7 +81,7 @@ class Magento_Test_Listener_Annotation_IsolationTest extends PHPUnit_Framework_T /** * @magentoAppIsolation enabled * @magentoAppIsolation disabled - * @expectedException Exception + * @expectedException Magento_Exception */ public function testEndTestIsolationAmbiguous() { diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/_files/sample_fixture_two_rollback.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/_files/sample_fixture_two_rollback.php index c409278a0a1..d99a676c60a 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/_files/sample_fixture_two_rollback.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/_files/sample_fixture_two_rollback.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ListenerTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ListenerTest.php index 6ceaa34727f..7efc8233d32 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ListenerTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ListenerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Profiler/OutputBambooTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Profiler/OutputBambooTest.php index 56daa3fd523..93dc596ae76 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Profiler/OutputBambooTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Profiler/OutputBambooTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php index 10a29eeaf20..7d684e9ffc6 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ResponseTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ResponseTest.php index d01362b482d..dae3eb2c75b 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ResponseTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ResponseTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php index 60eec6fcee8..3c8e50b63b9 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/ModuleGroupsTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/ModuleGroupsTest.php index ad8649c5ee2..2eaab2c71d2 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/ModuleGroupsTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/ModuleGroupsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -159,11 +159,12 @@ class Magento_Test_TestSuite_ModuleGroupsTest extends PHPUnit_Framework_TestCase * Adds fixture tests to the suite * * @param Magento_Test_TestSuite_ModuleGroups $suite - * @return Magento_Test_Profiler_ModuleGroupsTest + * @return Magento_Test_TestSuite_ModuleGroupsTest */ protected function _fillTests($suite) { - $fileIterator = File_Iterator_Factory::getFileIterator( + $fileIteratorFactory = new File_Iterator_Factory(); + $fileIterator = $fileIteratorFactory->getFileIterator( array(__DIR__ . '/_files/ModuleGroups'), '.php' ); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Author_Module.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Author_Module.php index 2288181607e..16152ac3517 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Author_Module.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Author_Module.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Integrity.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Integrity.php index 6e1fb6fbe24..a727761fd75 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Integrity.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Integrity.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Catalog.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Catalog.php index 5506d401748..ebf9f5cf533 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Catalog.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Catalog.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core.php index 056f5584c22..727383533ea 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core_Mage_Eav.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core_Mage_Eav.php index 354262dfaef..11e58c8b647 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core_Mage_Eav.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core_Mage_Eav.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/phpunit-ce.xml.dist b/dev/tests/integration/phpunit-ce.xml.dist index d2deea4c6d7..b4bed55d389 100644 --- a/dev/tests/integration/phpunit-ce.xml.dist +++ b/dev/tests/integration/phpunit-ce.xml.dist @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/phpunit.xml.dist b/dev/tests/integration/phpunit.xml.dist index 1d4cbe902a5..03aa860ead5 100644 --- a/dev/tests/integration/phpunit.xml.dist +++ b/dev/tests/integration/phpunit.xml.dist @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/AllRelevantTests.php b/dev/tests/integration/testsuite/AllRelevantTests.php index 852461f78cb..0423c4ea6ce 100644 --- a/dev/tests/integration/testsuite/AllRelevantTests.php +++ b/dev/tests/integration/testsuite/AllRelevantTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,9 +32,10 @@ class AllRelevantTests { public static function suite() { + $fileIteratorFactory = new File_Iterator_Factory(); $suite = new Magento_Test_TestSuite_ModuleGroups(false); $suite->addTestFiles( - File_Iterator_Factory::getFileIterator( + $fileIteratorFactory->getFileIterator( array(__DIR__), array('Test.php') ) diff --git a/dev/tests/integration/testsuite/Mage/Admin/Model/UserTest.php b/dev/tests/integration/testsuite/Mage/Admin/Model/UserTest.php new file mode 100644 index 00000000000..b440a7ffb8b --- /dev/null +++ b/dev/tests/integration/testsuite/Mage/Admin/Model/UserTest.php @@ -0,0 +1,54 @@ +<?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 Magento + * @package Mage_Admin + * @subpackage integration_tests + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * @group module:Mage_Admin + * @magentoDataFixture Mage/Admin/_files/user.php + */ +class Mage_Admin_Model_UserTest extends PHPUnit_Framework_TestCase +{ + /** + * @var Mage_Admin_Model_User + */ + protected $_model; + + protected function setUp() + { + $this->_model = new Mage_Admin_Model_User; + } + + /** + * Ensure that an exception is not thrown, if the user does not exist + */ + public function testLoadByUsername() + { + $this->_model->loadByUsername('non_existing_user'); + $this->assertNull($this->_model->getId(), 'The admin user has an unexpected ID'); + $this->_model->loadByUsername('user'); + $this->assertNotEmpty($this->_model->getId(), 'The admin user should have been loaded'); + } +} diff --git a/dev/tests/integration/testsuite/Mage/Admin/_files/user.php b/dev/tests/integration/testsuite/Mage/Admin/_files/user.php new file mode 100644 index 00000000000..b1be18ccb06 --- /dev/null +++ b/dev/tests/integration/testsuite/Mage/Admin/_files/user.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 Magento + * @package Mage_Adminhtml + * @subpackage integration_tests + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +$user = new Mage_Admin_Model_User(); +$user->setData(array( + 'firstname' => 'firstname', + 'lastname' => 'lastname', + 'email' => 'admin@example.com', + 'username' => 'user', + 'password' => 'password', + 'is_active' => 1 +)); +$user->save(); + +$roleAdmin = new Mage_Admin_Model_Role(); +$roleAdmin->load('Administrators', 'role_name'); + +$roleUser = new Mage_Admin_Model_Role(); +$roleUser->setData(array( + 'parent_id' => $roleAdmin->getId(), + 'tree_level' => $roleAdmin->getTreeLevel() + 1, + 'role_type' => Mage_Admin_Model_Acl::ROLE_TYPE_USER, + 'user_id' => $user->getId(), + 'role_name' => $user->getFirstname(), +)); +$roleUser->save(); diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Bestsellers/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Bestsellers/GridTest.php index 3cb9ace85a7..d72978c416e 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Bestsellers/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Bestsellers/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Coupons/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Coupons/GridTest.php index 36dbbc3e296..f166f446b18 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Coupons/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Coupons/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Invoiced/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Invoiced/GridTest.php index 7efb87852f3..d82f557c367 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Invoiced/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Invoiced/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Refunded/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Refunded/GridTest.php index 7ba1a1de87d..04a7589e381 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Refunded/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Refunded/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Sales/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Sales/GridTest.php index 4e0e96872d0..adf8b98a8b4 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Sales/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Sales/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Shipping/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Shipping/GridTest.php index ddde2b1b5bc..f38a6b4428a 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Shipping/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Shipping/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Tax/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Tax/GridTest.php index fed831b7166..9a264ab2442 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Tax/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Tax/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Bundle/Model/ProductTest.php b/dev/tests/integration/testsuite/Mage/Bundle/Model/ProductTest.php index a334034e6a7..97bf609b7ef 100644 --- a/dev/tests/integration/testsuite/Mage/Bundle/Model/ProductTest.php +++ b/dev/tests/integration/testsuite/Mage/Bundle/Model/ProductTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/AbstractTest.php index 2be585437dc..0f8a359470f 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/CrosssellTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/CrosssellTest.php index 82ac3acb9b8..f22b95d3d3d 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/CrosssellTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/CrosssellTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/RelatedTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/RelatedTest.php index 0077f65584f..0bd2274b493 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/RelatedTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/RelatedTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ListTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ListTest.php index 58e1f006586..d3f1bfb733b 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ListTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ListTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/NewTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/NewTest.php index d704714a223..573f44c3442 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/NewTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/NewTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/OptionsTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/OptionsTest.php index bfca13d2007..f452eb51a88 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/OptionsTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/OptionsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/Type/ConfigurableTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/Type/ConfigurableTest.php index 2b842f5671c..107871af4ba 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/Type/ConfigurableTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/Type/ConfigurableTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ViewTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ViewTest.php index 8611f5705e9..2f702efdaeb 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ViewTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ViewTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Category/FlatTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Category/FlatTest.php index d4ba437e16d..d2f5fc1e241 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Category/FlatTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Category/FlatTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/CategoryTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/CategoryTest.php index c797f1be361..3f5b327cd66 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/CategoryTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/CategoryTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/DataTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/DataTest.php index 13c73ec4152..b19d52b1c9e 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/ImageTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/ImageTest.php index 21beecba6df..a807e55f752 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/ImageTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/ImageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/MapTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/MapTest.php index aaafc87880e..e9933eec28c 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/MapTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/MapTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/OutputTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/OutputTest.php index 2a753b9e883..051156c5587 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/OutputTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/OutputTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/CompareTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/CompareTest.php index d1df320ddf0..17c1af84744 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/CompareTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/CompareTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/FlatTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/FlatTest.php index 1427e755900..3bb352450b2 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/FlatTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/FlatTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/UrlTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/UrlTest.php index a9fe5754b2a..455e5476d88 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/UrlTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/UrlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/ViewTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/ViewTest.php index c0d89cdd80e..8a1221fe1a4 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/ViewTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/ViewTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/ProductTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/ProductTest.php index e23a0cd82a4..67db56c0609 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/ProductTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/ProductTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/AbstractTest.php index a8c630ecce3..bf17bcb9767 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Api/V2Test.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Api/V2Test.php index 80522f14fd3..b3b5af045c0 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Api/V2Test.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Api/V2Test.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/ApiTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/ApiTest.php index f9a4577b300..7b0e6b00da4 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/ApiTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/ApiTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Attribute/ApiTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Attribute/ApiTest.php index 46efa05cb14..551a2621fb7 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Attribute/ApiTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Attribute/ApiTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTest.php index 4b3b54ba201..e7405acf0c6 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTreeTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTreeTest.php index 4268071d6fb..bd8cc1aeaef 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTreeTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTreeTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Convert/Adapter/ProductTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Convert/Adapter/ProductTest.php index ff877828a9c..83f25abae12 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Convert/Adapter/ProductTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Convert/Adapter/ProductTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/DesignTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/DesignTest.php index ca4ea04e6c6..c1be6aa212b 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/DesignTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/DesignTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/AttributeTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/AttributeTest.php index 69fbdae641a..6c9b2787ea9 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/AttributeTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/AttributeTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/CategoryTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/CategoryTest.php index 1e9c02f90cc..ff6ff6b1ad3 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/CategoryTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/CategoryTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/DecimalTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/DecimalTest.php index 771f3637b50..cbf4054b8fd 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/DecimalTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/DecimalTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/ItemTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/ItemTest.php index a247f1e8304..243778384d5 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/ItemTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/ItemTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/PriceTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/PriceTest.php index aa52072d86d..4ae94c8722c 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/PriceTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/PriceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 @@ class Mage_Catalog_Model_Layer_Filter_PriceTest extends PHPUnit_Framework_TestCa */ public function testGetPriceRangeManual() { + $this->markTestIncomplete('MAGE-4937'); $this->assertEquals(15, $this->_model->getPriceRange()); } diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_weight_filterable.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_weight_filterable.php index 1599e036819..11815f476cf 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_weight_filterable.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_weight_filterable.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_with_option.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_with_option.php index 29bd4595dfc..32b3fd71fc4 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_with_option.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_with_option.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/LayerTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/LayerTest.php index 42f8341ecef..fe2cc752345 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/LayerTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/LayerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/ApiTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/ApiTest.php index 97db160e8db..836ac67902b 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/ApiTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/ApiTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/MediaTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/MediaTest.php index c34150e225d..ee62db19a2b 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/MediaTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/MediaTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/PriceTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/PriceTest.php index f16bf60c9db..02a3dae18ff 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/PriceTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/PriceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/TierpriceTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/TierpriceTest.php index b942eee43e6..983ea6c9136 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/TierpriceTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/TierpriceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Media/ApiTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Media/ApiTest.php index 847f5113a49..54b7306a862 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Media/ApiTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Media/ApiTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2Test.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2Test.php index ab3957dbd5d..8a417047b14 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2Test.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2Test.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/ApiTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/ApiTest.php index a3640cc9dbd..f6c81d1eea2 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/ApiTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/ApiTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/ImageTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/ImageTest.php index a47d613a3e2..0b244cd11fa 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/ImageTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/ImageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/AbstractTest.php index a9a08aa2e0f..fd6f3c8d03f 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ApiTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ApiTest.php index cd1d0c9f896..6bb14d545ef 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ApiTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ApiTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/AttributeTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/AttributeTest.php index a113322dba5..94062b5bb88 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/AttributeTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/AttributeTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/PriceTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/PriceTest.php index bc7b8d0feab..5ed2a7e4049 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/PriceTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/PriceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ConfigurableTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ConfigurableTest.php index 2121d349058..8e4d673b2b0 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ConfigurableTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ConfigurableTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/PriceTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/PriceTest.php index 2c38bd59b57..12b93ccd3c6 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/PriceTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/PriceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/VirtualTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/VirtualTest.php index 7742dfe4ff3..1bd2f32d7e7 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/VirtualTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/VirtualTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/TypeTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/TypeTest.php index 1c938608d14..40e83e4a087 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/TypeTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/TypeTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/UrlTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/UrlTest.php index 525cb60abc3..a75684fedca 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/UrlTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/UrlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductExternalTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductExternalTest.php index ff05d5a6d90..65757063690 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductExternalTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductExternalTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductGettersTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductGettersTest.php index 8c1e32e5a65..1f4dea052b0 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductGettersTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductGettersTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductPriceTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductPriceTest.php index 8bdd0ad055f..4dbb640bdbf 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductPriceTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductPriceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductTest.php index 96d97f94862..73db51a690e 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Eav/AttributeTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Eav/AttributeTest.php index 478a0f9d388..fc65e8656e3 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Eav/AttributeTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Eav/AttributeTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Product/CollectionTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Product/CollectionTest.php index 51637e912eb..e02774fd643 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Product/CollectionTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Product/CollectionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/UrlTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/UrlTest.php new file mode 100644 index 00000000000..35bab86534d --- /dev/null +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/UrlTest.php @@ -0,0 +1,51 @@ +<?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 Magento + * @package Magento_Catalog + * @subpackage integration_tests + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * @group module:Mage_Catalog + */ +class Mage_Catalog_Model_Resource_UrlTest extends PHPUnit_Framework_TestCase +{ + /** + * @var Mage_Catalog_Model_Resource_Url + */ + protected $_model; + + protected function setUp() + { + $this->_model = new Mage_Catalog_Model_Resource_Url(); + } + + /** + * @magentoDataFixture Mage/Catalog/Model/Resource/_files/url_rewrites.php + */ + public function testGetLastUsedRewriteRequestIncrement() + { + $this->markTestIncomplete('Bug MAGETWO-724'); + $this->assertEquals(1000, $this->_model->getLastUsedRewriteRequestIncrement('url-key-', '.html', 1)); + } +} diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/_files/url_rewrites.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/_files/url_rewrites.php new file mode 100644 index 00000000000..20117f79bda --- /dev/null +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/_files/url_rewrites.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 Magento + * @package Mage_Catalog + * @subpackage integration_tests + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +$category = new Mage_Catalog_Model_Category(); +$category->setId(3) + ->setName('Category 1') + ->setParentId(2) /**/ + ->setPath('1/2/3') + ->setLevel(2) + ->setAvailableSortBy('name') + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setPosition(1) + ->save(); + +$urlKeys = array( + 'url-key-', + 'url-key-1', + 'url-key-2', + 'url-key-5', + 'url-key-1000', + 'url-key-999', + 'url-key-asdf', +); + +foreach ($urlKeys as $i => $urlKey) { + $id = $i + 1; + $product = new Mage_Catalog_Model_Product(); + $product->setTypeId(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) + ->setId($id) + ->setStoreId(1) + ->setAttributeSetId(4) + ->setWebsiteIds(array(1)) + ->setName('Simple Product ' . $id) + ->setSku('simple-' . $id) + ->setPrice(10) + ->setCategoryIds(array(3)) + ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) + ->setStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED) + ->setUrlKey($urlKey) + ->setUrlPath($urlKey . '.html') + ->save(); +} diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/UrlTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/UrlTest.php index 69d4c580fb2..f53bba842d8 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/UrlTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/UrlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/WidgetTest.php b/dev/tests/integration/testsuite/Mage/Catalog/WidgetTest.php index b3ca950192f..1b6a6157404 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/WidgetTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/WidgetTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/categories.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/categories.php index f1dcd00f5a5..9468bc840d5 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/categories.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/categories.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_configurable.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_configurable.php index 01c30ac8197..ad77e378572 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_configurable.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_configurable.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image.php index 1f9d82a80fb..04470048fa9 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image_rollback.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image_rollback.php index d930a0e151f..8adc74d0a3a 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image_rollback.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image_rollback.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_simple.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_simple.php index b015936a82d..3625859943e 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_simple.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_simple.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image.php index d4254639e75..c0d621c7f60 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image_rollback.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image_rollback.php index 355443c0197..b026d20cb96 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image_rollback.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image_rollback.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/products.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/products.php index 249e5c67a5d..c026a37deef 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/products.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/products.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/products_crosssell.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/products_crosssell.php index 72e3af3f17a..70006cd2638 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/products_crosssell.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/products_crosssell.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/products_new.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/products_new.php index 0128b5055b7..98e99144ad5 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/products_new.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/products_new.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/products_related.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/products_related.php index a6fb9cfc14a..a0735c892f0 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/products_related.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/products_related.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/two_products.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/two_products.php index 94005394ab3..ba361be241b 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/two_products.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/two_products.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites.php index c499dfe9dc9..0d03fda1f72 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites_invalid.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites_invalid.php index a58c5b026e4..cb2137b79ab 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites_invalid.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites_invalid.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/controllers/CategoryControllerTest.php b/dev/tests/integration/testsuite/Mage/Catalog/controllers/CategoryControllerTest.php index 0c6836b156f..2c1d1fca09f 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/controllers/CategoryControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/controllers/CategoryControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/controllers/IndexControllerTest.php b/dev/tests/integration/testsuite/Mage/Catalog/controllers/IndexControllerTest.php index f534272384e..23942bbce9c 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/controllers/IndexControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/controllers/IndexControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/controllers/Product/CompareControllerTest.php b/dev/tests/integration/testsuite/Mage/Catalog/controllers/Product/CompareControllerTest.php index ba251f42b5f..b41bfb5e8b3 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/controllers/Product/CompareControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/controllers/Product/CompareControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/controllers/ProductControllerTest.php b/dev/tests/integration/testsuite/Mage/Catalog/controllers/ProductControllerTest.php index ec0ab31c807..9f82f4bebda 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/controllers/ProductControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/controllers/ProductControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/controllers/Seo/SitemapControllerTest.php b/dev/tests/integration/testsuite/Mage/Catalog/controllers/Seo/SitemapControllerTest.php index 32d4c2903e7..1e18d444c33 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/controllers/Seo/SitemapControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/controllers/Seo/SitemapControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/controllers/_files/products.php b/dev/tests/integration/testsuite/Mage/Catalog/controllers/_files/products.php index 3d742ba8f9a..1370bbbb1d5 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/controllers/_files/products.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/controllers/_files/products.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/CatalogInventory/Model/Stock/ItemTest.php b/dev/tests/integration/testsuite/Mage/CatalogInventory/Model/Stock/ItemTest.php index 7d7a96ad14f..22435889025 100644 --- a/dev/tests/integration/testsuite/Mage/CatalogInventory/Model/Stock/ItemTest.php +++ b/dev/tests/integration/testsuite/Mage/CatalogInventory/Model/Stock/ItemTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_CatalogInventory * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/CatalogSearch/Block/TermTest.php b/dev/tests/integration/testsuite/Mage/CatalogSearch/Block/TermTest.php index d53fa303491..45cb142857b 100644 --- a/dev/tests/integration/testsuite/Mage/CatalogSearch/Block/TermTest.php +++ b/dev/tests/integration/testsuite/Mage/CatalogSearch/Block/TermTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_CatalogSearch * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/CatalogSearch/Helper/DataTest.php b/dev/tests/integration/testsuite/Mage/CatalogSearch/Helper/DataTest.php index 45ee4143e5b..0ded32d16de 100644 --- a/dev/tests/integration/testsuite/Mage/CatalogSearch/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/CatalogSearch/Helper/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_CatalogSearch * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Checkout/Block/Cart/Item/RendererTest.php b/dev/tests/integration/testsuite/Mage/Checkout/Block/Cart/Item/RendererTest.php index 764cf6cd5ef..41377420648 100644 --- a/dev/tests/integration/testsuite/Mage/Checkout/Block/Cart/Item/RendererTest.php +++ b/dev/tests/integration/testsuite/Mage/Checkout/Block/Cart/Item/RendererTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Checkout * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/Block/BlockTest.php b/dev/tests/integration/testsuite/Mage/Cms/Block/BlockTest.php index 0a8a825c7c1..72de4b406ea 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/Block/BlockTest.php +++ b/dev/tests/integration/testsuite/Mage/Cms/Block/BlockTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/Block/Widget/BlockTest.php b/dev/tests/integration/testsuite/Mage/Cms/Block/Widget/BlockTest.php index f96f22f10c3..d7d101c5cec 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/Block/Widget/BlockTest.php +++ b/dev/tests/integration/testsuite/Mage/Cms/Block/Widget/BlockTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/Helper/PageTest.php b/dev/tests/integration/testsuite/Mage/Cms/Helper/PageTest.php index 7978a58d824..fba25852f20 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/Helper/PageTest.php +++ b/dev/tests/integration/testsuite/Mage/Cms/Helper/PageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/ConfigTest.php b/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/ConfigTest.php index 985f76bd6cb..2c504f06dd1 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/ConfigTest.php +++ b/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/Images/StorageTest.php b/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/Images/StorageTest.php index 0bb49cd1032..4a4ad02c296 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/Images/StorageTest.php +++ b/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/Images/StorageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/_files/block.php b/dev/tests/integration/testsuite/Mage/Cms/_files/block.php index 80a714c0b0e..e7a3a0d2f36 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/_files/block.php +++ b/dev/tests/integration/testsuite/Mage/Cms/_files/block.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/_files/pages.php b/dev/tests/integration/testsuite/Mage/Cms/_files/pages.php index d4f6b1b1298..200e7a2458f 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/_files/pages.php +++ b/dev/tests/integration/testsuite/Mage/Cms/_files/pages.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/controllers/PageControllerTest.php b/dev/tests/integration/testsuite/Mage/Cms/controllers/PageControllerTest.php index 6a0a4cdb838..2fad5dd8bb4 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/controllers/PageControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Cms/controllers/PageControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php index 288dde0b6fc..19a235e43a4 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/TemplateTest.php b/dev/tests/integration/testsuite/Mage/Core/Block/TemplateTest.php index 0921818c691..ef9acf10b8c 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/TemplateTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Block/TemplateTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/TextTest.php b/dev/tests/integration/testsuite/Mage/Core/Block/TextTest.php index 0873f3457c7..65de66e8e9c 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/TextTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Block/TextTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/_files/adminhtml/default/default/Mage_Core/dummy.phtml b/dev/tests/integration/testsuite/Mage/Core/Block/_files/adminhtml/default/default/Mage_Core/dummy.phtml index 5f5594b334f..a8be76c8968 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/_files/adminhtml/default/default/Mage_Core/dummy.phtml +++ b/dev/tests/integration/testsuite/Mage/Core/Block/_files/adminhtml/default/default/Mage_Core/dummy.phtml @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/_files/frontend/default/default/Mage_Core/dummy.phtml b/dev/tests/integration/testsuite/Mage/Core/Block/_files/frontend/default/default/Mage_Core/dummy.phtml index 5f5594b334f..a8be76c8968 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/_files/frontend/default/default/Mage_Core/dummy.phtml +++ b/dev/tests/integration/testsuite/Mage/Core/Block/_files/frontend/default/default/Mage_Core/dummy.phtml @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/_files/template_test_assign.phtml b/dev/tests/integration/testsuite/Mage/Core/Block/_files/template_test_assign.phtml index cb8ea7316d6..4244ad4290f 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/_files/template_test_assign.phtml +++ b/dev/tests/integration/testsuite/Mage/Core/Block/_files/template_test_assign.phtml @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/dev/tests/integration/testsuite/Mage/Core/Controller/RequestHttpTest.php b/dev/tests/integration/testsuite/Mage/Core/Controller/RequestHttpTest.php index 52137a42f7f..858c98152e6 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Controller/RequestHttpTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Controller/RequestHttpTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/ActionTest.php b/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/ActionTest.php index 3b273148b17..c175acf053f 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/ActionTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/ActionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/FrontTest.php b/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/FrontTest.php index 7701a7bec20..c86a776b16f 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/FrontTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/FrontTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/Router/StandardTest.php b/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/Router/StandardTest.php index 97d9509fd4a..3916e1fb0eb 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/Router/StandardTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/Router/StandardTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/AbstractTest.php index 522710d0793..360bcae3555 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,6 +113,20 @@ class Mage_Core_Helper_AbstractTest extends PHPUnit_Framework_TestCase $this->assertEquals($expected[0], $this->_helper->jsQuoteEscape($data[0])); } + /** + * @covers Mage_Core_Helper_Abstract::quoteEscape + */ + public function testQuoteEscape() + { + $data = "Text with 'single' and \"double\" quotes"; + $expected = array( + "Text with 'single' and "double" quotes", + "Text with \\'single\\' and \\"double\\" quotes", + ); + $this->assertEquals($expected[0], $this->_helper->quoteEscape($data)); + $this->assertEquals($expected[1], $this->_helper->quoteEscape($data, true)); + } + public function testSetGetLayout() { $this->assertNull($this->_helper->getLayout()); diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/DataTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/DataTest.php index b3dd782a91c..923d9670c7e 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 @@ XML; /** * @param array $array * @param string $rootName - * @expectedException Exception + * @expectedException Magento_Exception * @dataProvider assocToXmlExceptionDataProvider */ public function testAssocToXmlException($array, $rootName = '_') diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/HttpTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/HttpTest.php index 4cfa73c71e7..264a377b95b 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/HttpTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/HttpTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/JsTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/JsTest.php index b7f9c11f88a..8c54e49bc4f 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/JsTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/JsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -39,7 +39,7 @@ class Mage_Core_Helper_JsTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->_helper = new Mage_Core_Helper_Js; + $this->_helper = new Mage_Core_Helper_Js(); } public function testGetTranslateJson() diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/StringTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/StringTest.php index b1301691338..7c425838b11 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/StringTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/StringTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/Url/RewriteTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/Url/RewriteTest.php index d6c917253ee..0adc229d8c2 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/Url/RewriteTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/Url/RewriteTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/UrlTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/UrlTest.php index d2703f3f78f..8ae6e207217 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/UrlTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/UrlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/App/AreaTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/App/AreaTest.php index 21b115cae05..046dd274355 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/App/AreaTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/App/AreaTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/AppTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/AppTest.php index e97a8dd1a3f..b3be327bba2 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/AppTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/AppTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/CacheTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/CacheTest.php index 0d20b426e6f..950e68d8d91 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/CacheTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/CacheTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,6 +70,34 @@ class Mage_Core_Model_CacheTest extends PHPUnit_Framework_TestCase ); } + /** + * @param string $optionCode + * @param string $extensionRequired + * @dataProvider backendTwoLevelsDataProvider + */ + public function testBackendTwoLevels($optionCode, $extensionRequired) + { + if ($extensionRequired) { + if (!extension_loaded($extensionRequired)) { + $this->markTestSkipped("The PHP extension '{$extensionRequired}' is required for this test."); + } + } + $model = new Mage_Core_Model_Cache(array('backend' => $optionCode)); + $backend = $model->getFrontend()->getBackend(); + $this->assertInstanceOf('Zend_Cache_Backend_TwoLevels', $backend); + } + + /** + * @return array + */ + public function backendTwoLevelsDataProvider() + { + return array( + array('Memcached', 'memcached'), + array('Memcached', 'memcache'), + ); + } + public function testGetFrontend() { $frontend = $this->_model->getFrontend(); @@ -270,6 +298,7 @@ class Mage_Core_Model_CacheTest extends PHPUnit_Framework_TestCase Mage_Core_Model_CacheTestRequestProcessor::$isEnabled = true; $this->assertTrue($model->processRequest()); } + } class Mage_Core_Model_CacheTestRequestProcessor diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Config/BaseTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Config/BaseTest.php index a793d2d0e1d..cfa39f23177 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Config/BaseTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Config/BaseTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Config/DataTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Config/DataTest.php index bd246a1fb7a..977cebc8396 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Config/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Config/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Config/ElementTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Config/ElementTest.php index 8578d88800d..b1293f42bba 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Config/ElementTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Config/ElementTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Config/FieldsetTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Config/FieldsetTest.php index f251c0bf4f4..a2baa9579b4 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Config/FieldsetTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Config/FieldsetTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Config/OptionsTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Config/OptionsTest.php index 3bf988490c3..b59577e8d9e 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Config/OptionsTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Config/OptionsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 +78,7 @@ class Mage_Core_Model_Config_OptionsTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Mage_Core_Exception */ public function testGetDirException() { diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Config/SystemTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Config/SystemTest.php index 48d524b672c..09bc4bbebf7 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Config/SystemTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Config/SystemTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/ConfigFactoryTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/ConfigFactoryTest.php index dcf8d6b7d84..620ea2b3e9e 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/ConfigFactoryTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/ConfigFactoryTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/ConfigTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/ConfigTest.php index 438b4ef0ea9..ac66c624734 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Backend/ExceptionsTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Backend/ExceptionsTest.php index 2824c845ee1..c8e0e171796 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Backend/ExceptionsTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Backend/ExceptionsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageMergingTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageMergingTest.php index 667f5ed8c19..765ea62f337 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageMergingTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageMergingTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 @@ class Mage_Core_Model_Design_PackageMergingTest extends PHPUnit_Framework_TestCa /** * @magentoConfigFixture current_store dev/css/merge_css_files 1 - * @expectedException Exception + * @expectedException Magento_Exception */ public function testMergeFilesException() { diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageTest.php index d464078dcb0..6a92944596f 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,9 +194,9 @@ class Mage_Core_Model_Design_PackageTest extends PHPUnit_Framework_TestCase 'ru_RU', ), 'lib skin file inside theme' => array( - 'varien/product.js', + 'jquery/jquery-no-conflict.js', array('_skin' => 'theme_nested_skin'), - $prefix . 'custom_theme/skin/theme_nested_skin/varien/product.js', + $prefix . 'custom_theme/skin/theme_nested_skin/jquery/jquery-no-conflict.js', ), 'primary theme fallback - same theme & default skin' => array( 'fixture_script_two.js', @@ -214,9 +214,9 @@ class Mage_Core_Model_Design_PackageTest extends PHPUnit_Framework_TestCase $prefix . 'default/skin/default/fixture_script_four.js', ), 'lib fallback' => array( - 'varien/product.js', + 'jquery/jquery-no-conflict.js', array('_skin' => 'default'), - '%s/pub/js/varien/product.js', + '%s/pub/js/jquery/jquery-no-conflict.js', ), ); } @@ -325,7 +325,7 @@ class Mage_Core_Model_Design_PackageTest extends PHPUnit_Framework_TestCase /** * @param string $file - * @expectedException Exception + * @expectedException Magento_Exception * @dataProvider getSkinUrlDataExceptionProvider */ public function testGetSkinUrlException($file) @@ -339,17 +339,15 @@ class Mage_Core_Model_Design_PackageTest extends PHPUnit_Framework_TestCase public function getSkinUrlDataExceptionProvider() { return array( - // non-existing theme file - array('path/to/nonexisting-file.ext'), - // non-existing module file - array('Some_Module::path/to/nonexisting-file.ext'), + 'non-existing theme file' => array('path/to/nonexisting-file.ext'), + 'non-existing module file' => array('Some_Module::path/to/nonexisting-file.ext'), ); } /** * @param string $file - * @expectedException Exception + * @expectedException Magento_Exception * @dataProvider findFileExceptionDataProvider */ public function testFindFileException($file) diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/DesignTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/DesignTest.php index 4dddcd4c947..41a223e9115 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/DesignTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/DesignTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/a/d/theme.xml b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/a/d/theme.xml index 069342fef20..9425c1dee7d 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/a/d/theme.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/a/d/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/b/e/theme.xml b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/b/e/theme.xml index 4ee5a86e3b8..63f27ed4cde 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/b/e/theme.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/b/e/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/default/default/theme.xml b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/default/default/theme.xml index e95655aa694..b0639291355 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/default/default/theme.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/default/default/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/DesignTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/DesignTest.php index 282a91ab53f..9f452de5a56 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/DesignTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/DesignTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Email/Template/FilterTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Email/Template/FilterTest.php index 60a9a212390..874a2d617b9 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Email/Template/FilterTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Email/Template/FilterTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Email/TemplateTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Email/TemplateTest.php index 94369c2dd89..349f3cb61ba 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Email/TemplateTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Email/TemplateTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/EncryptionTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/EncryptionTest.php index faae607846f..c08e6b64af1 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/EncryptionTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/EncryptionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Layout/DataTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Layout/DataTest.php index 257295c8184..3d49d83ec6e 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Layout/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Layout/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Layout/ElementTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Layout/ElementTest.php index 4d31f9ad4df..20c137dd0fd 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Layout/ElementTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Layout/ElementTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Layout/UpdateTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Layout/UpdateTest.php index 9df0e796db8..02a696860d8 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Layout/UpdateTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Layout/UpdateTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -122,7 +122,7 @@ class Mage_Core_Model_Layout_UpdateTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception * @dataProvider getFileLayoutUpdatesXmlExceptionDataProvider */ public function testGetFileLayoutUpdatesXmlException($configFixture) diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/LayoutTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/LayoutTest.php index 82b2781eaa5..5d9d3055c33 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/LayoutTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/LayoutTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/CacheTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/CacheTest.php index b6fa8efb0ee..a2a919f7547 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/CacheTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/CacheTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/ConfigTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/ConfigTest.php index 3a247d514f2..d53df3b96ef 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/ConfigTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Db/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Db/AbstractTest.php index 952ee4bb108..5d4da746c2c 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Db/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Db/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Entity/TableTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Entity/TableTest.php index 4e15fa14921..a61268909af 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Entity/TableTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Entity/TableTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Helper/Mysql4Test.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Helper/Mysql4Test.php index b6aa400ce25..98aa1a9672a 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Helper/Mysql4Test.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Helper/Mysql4Test.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/IteratorTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/IteratorTest.php index 36114b9a1c5..da7058e7876 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/IteratorTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/IteratorTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/LayoutTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/LayoutTest.php index 08f1a595b6e..f03dbd461c0 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/LayoutTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/LayoutTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SessionTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SessionTest.php index 61bc9f891d1..b8796a4b331 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SessionTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SessionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SetupTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SetupTest.php index 2601d5720b9..8adbb18dfd1 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SetupTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SetupTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Store/CollectionTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Store/CollectionTest.php index 156c4d7490b..c9672c72d16 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Store/CollectionTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Store/CollectionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/TransactionTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/TransactionTest.php index e3ab56ed9e7..8b9f870be77 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/TransactionTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/TransactionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/ResourceMysqlTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/ResourceMysqlTest.php index 4f2d68f07ac..a84ff399fe0 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/ResourceMysqlTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/ResourceMysqlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/ResourceTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/ResourceTest.php index 107ac26a21d..cdb8eb23d47 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/ResourceTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/ResourceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Session/Abstract/VarienTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Session/Abstract/VarienTest.php new file mode 100644 index 00000000000..90e7d9d7409 --- /dev/null +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Session/Abstract/VarienTest.php @@ -0,0 +1,72 @@ +<?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 Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Test class for Mage_Core_Model_Session_Abstract_Varien + * + */ +class Mage_Core_Model_Session_Abstract_VarienTest extends PHPUnit_Framework_TestCase +{ + /** + * @dataProvider sessionSaveMethodDataProvider + */ + public function testSessionSaveMethod($saveMethod, $iniValue) + { + $this->markTestIncomplete('Bug MAGE-5487'); + + // depending on configuration some values cannot be set as default save session handlers. + $origSessionHandler = ini_set('session.save_handler', $iniValue); + if ($iniValue && (ini_get($iniValue) != $iniValue)) { + $this->markTestSkipped("Can't set '$iniValue' as session save handler"); + } + ini_set('session.save_handler', $origSessionHandler); + + Mage::getConfig()->setNode(Mage_Core_Model_Session_Abstract::XML_NODE_SESSION_SAVE, $saveMethod); + /** + * @var Mage_Core_Model_Session_Abstract_Varien + */ + $model = new Mage_Core_Model_Session_Abstract(); + $model->start(); + if ($iniValue) { + $this->assertEquals(ini_get('session.save_handler'), $iniValue); + } + } + + public function sessionSaveMethodDataProvider() + { + $testCases = array( + array('db', 'user'), + array('memcache', 'memcache'), + array('memcached', 'memcached'), + array('eaccelerator', 'eaccelerator'), + array('', ''), + array('dummy', ''), + ); + + return $testCases; + } +} diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/StoreTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/StoreTest.php index 565de8a28f4..e2526e0e8b2 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/StoreTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/StoreTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/TemplateTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/TemplateTest.php index d368ad1dc14..57671082095 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/TemplateTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 @@ class Mage_Core_Model_TemplateTest extends PHPUnit_Framework_TestCase { /** * @dataProvider setDesignConfigExceptionDataProvider - * @expectedException Exception + * @expectedException Magento_Exception */ public function testSetDesignConfigException($config) { diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/ExprTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/ExprTest.php index fc72a74d1d1..05f5c6c6b57 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/ExprTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/ExprTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/InlineTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/InlineTest.php index 5730906ea7d..424f3162b5a 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/InlineTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/InlineTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -114,6 +114,7 @@ class Mage_Core_Model_Translate_InlineTest extends PHPUnit_Framework_TestCase { $actualText = $originalText; $this->_model->processResponseBody($actualText); + $this->markTestIncomplete('Bug MAGE-2494'); $this->assertEquals($expectedText, $actualText); } diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/StringTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/StringTest.php index c3b0a00f8f5..2f9a1355c18 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/StringTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/StringTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/_files/_translation_data.php b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/_files/_translation_data.php index fa331faa9be..62f1fef866e 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/_files/_translation_data.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/_files/_translation_data.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/TranslateTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/TranslateTest.php index ddd06be46e5..f0da11bf719 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/TranslateTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/TranslateTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Url/RewriteTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Url/RewriteTest.php index 5b5aff4c539..529bd9a0d80 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Url/RewriteTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Url/RewriteTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/UrlTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/UrlTest.php index 3186e6db14a..e9f846ea440 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/UrlTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/UrlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Variable/ConfigTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Variable/ConfigTest.php index 67af589ea73..29f51470496 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Variable/ConfigTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Variable/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/VariableTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/VariableTest.php index d005684162c..4beee540139 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/VariableTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/VariableTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/WebsiteTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/WebsiteTest.php index 49208ace181..47372f57d70 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/WebsiteTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/WebsiteTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/_layout_update.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/_layout_update.xml index 149d9027f6f..77035653d3e 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/_layout_update.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/_layout_update.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/adminhtml/package/test/theme.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/adminhtml/package/test/theme.xml index b25b136ec04..2c130a71ea6 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/adminhtml/package/test/theme.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/adminhtml/package/test/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/default/default/theme.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/default/default/theme.xml index 45b319d3a8b..349c67c5c2e 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/default/default/theme.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/default/default/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/default/fixture_script_two.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/default/fixture_script_two.js index 292dbf3c7f0..b88ca07cbf0 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/default/fixture_script_two.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/default/fixture_script_two.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the default skin of the custom theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/Fixture_Module/fixture_script.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/Fixture_Module/fixture_script.js index a767351fc60..3c2694c98c7 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/Fixture_Module/fixture_script.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/Fixture_Module/fixture_script.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* modular fixture skin file located inside the nested skin of the custom theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/fixture_script.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/fixture_script.js index 9e91f5f0afc..0ef49cd0ebb 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/fixture_script.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/fixture_script.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the nested skin of the custom theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/varien/product.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/jquery/jquery-no-conflict.js similarity index 93% rename from dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/varien/product.js rename to dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/jquery/jquery-no-conflict.js index 9dd7df72c74..c338f1260ee 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/varien/product.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/jquery/jquery-no-conflict.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file that overrides the lib file */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/Fixture_Module/fixture_script.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/Fixture_Module/fixture_script.js index 73b8f350d6b..45a713854a6 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/Fixture_Module/fixture_script.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/Fixture_Module/fixture_script.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* localized modular fixture skin file located inside the nested skin of the custom theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/fixture_script.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/fixture_script.js index 5b6b77ce46c..bfc53e2bf04 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/fixture_script.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/fixture_script.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* localized fixture skin file located inside the nested skin of the custom theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/theme.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/theme.xml index 5505b38a92d..a6cd3944f42 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/theme.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/fallback.phtml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/fallback.phtml index e99233ceb7b..6e70d50c9c8 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/fallback.phtml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/fallback.phtml @@ -21,6 +21,6 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/access_violation.php b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/access_violation.php index dfd04b9b67c..ba4afa09300 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/access_violation.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/access_violation.php @@ -21,6 +21,6 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_four.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_four.js index bf7cb8caa6a..43caebf5b45 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_four.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_four.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the default skin of the default theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_three.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_three.js index bf7cb8caa6a..43caebf5b45 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_three.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_three.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the default skin of the default theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_two.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_two.js index bf7cb8caa6a..43caebf5b45 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_two.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_two.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the default skin of the default theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/scripts.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/scripts.js index 144114045d2..06cae5423e2 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/scripts.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/scripts.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* scripts.js */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/deep/recursive.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/deep/recursive.css index aeaee0addd3..f77e8e7f9a9 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/deep/recursive.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/deep/recursive.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ dt {background: url('../../recursive2.gif')} diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/exception.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/exception.css index 59dda6b9d23..1bf8c86edd4 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/exception.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/exception.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ li.rogue {background: url(../../access_violation.php);} diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/file.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/file.css index d71539d48c2..37122691eac 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/file.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/file.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @import url(../recursive.css); diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/recursive.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/recursive.css index bf4d8ed14e9..fbbe5ac0365 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/recursive.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/recursive.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ dl {background: url(recursive.gif)} diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_three.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_three.js index b5c1514eab9..7e226d137d1 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_three.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_three.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the nested skin of the default theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_two.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_two.js index b5c1514eab9..7e226d137d1 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_two.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_two.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the nested skin of the default theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/layout.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/layout.xml index eb1a8c442c4..9f64c8bba63 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/layout.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/layout.xml @@ -22,7 +22,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/theme_template.phtml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/theme_template.phtml index e99233ceb7b..6e70d50c9c8 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/theme_template.phtml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/theme_template.phtml @@ -21,6 +21,6 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Cms/layout.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Cms/layout.xml index 95e6d47361e..f045ca76a99 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Cms/layout.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Cms/layout.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Core/layout.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Core/layout.xml index 8a428ccd541..d821ee4a1a6 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Core/layout.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Core/layout.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/css/styles.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/css/styles.css index 84a8e791bc3..c3154cfb19b 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/css/styles.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/css/styles.css @@ -20,6 +20,6 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/js/tabs.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/js/tabs.js index 61c2ef9ed4d..d1467deef82 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/js/tabs.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/js/tabs.js @@ -20,6 +20,6 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/view.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/view.xml index 6c82111167b..a538af37669 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/view.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/view.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.css index 67c8c13ebd2..e0a2f1c095b 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* calendar.css */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.js index 2c7e6100766..f70dd91c15e 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* calendar.js */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_css_files.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_css_files.css index 2fefa5899c8..a42c1ba3848 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_css_files.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_css_files.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @import url(../frontend/package/default/theme/en_US/recursive.css); diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_js_files.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_js_files.js index b808e91a6c3..a749fe46fa4 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_js_files.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_js_files.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* calendar.js */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/file.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/file.css index 337118838b1..c96fc7e43df 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/file.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/file.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ a {color:red} diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/script.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/script.js index 144114045d2..06cae5423e2 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/script.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/script.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* scripts.js */ diff --git a/dev/tests/integration/testsuite/Mage/Core/_files/design_change.php b/dev/tests/integration/testsuite/Mage/Core/_files/design_change.php index 3ef95e558f6..eb5522452c0 100644 --- a/dev/tests/integration/testsuite/Mage/Core/_files/design_change.php +++ b/dev/tests/integration/testsuite/Mage/Core/_files/design_change.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/_files/design_change_timezone.php b/dev/tests/integration/testsuite/Mage/Core/_files/design_change_timezone.php index 35dd20645b5..f6dbb7cf492 100644 --- a/dev/tests/integration/testsuite/Mage/Core/_files/design_change_timezone.php +++ b/dev/tests/integration/testsuite/Mage/Core/_files/design_change_timezone.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/_files/store.php b/dev/tests/integration/testsuite/Mage/Core/_files/store.php index f104831b252..2a9270f6a4d 100644 --- a/dev/tests/integration/testsuite/Mage/Core/_files/store.php +++ b/dev/tests/integration/testsuite/Mage/Core/_files/store.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/_files/variable.php b/dev/tests/integration/testsuite/Mage/Core/_files/variable.php index 86c423f26f6..59a1f46d08a 100644 --- a/dev/tests/integration/testsuite/Mage/Core/_files/variable.php +++ b/dev/tests/integration/testsuite/Mage/Core/_files/variable.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/controllers/AjaxControllerTest.php b/dev/tests/integration/testsuite/Mage/Core/controllers/AjaxControllerTest.php index 832b2822237..dca416d2d4c 100644 --- a/dev/tests/integration/testsuite/Mage/Core/controllers/AjaxControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/controllers/AjaxControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/controllers/IndexControllerTest.php b/dev/tests/integration/testsuite/Mage/Core/controllers/IndexControllerTest.php index fb65bfdad51..59fdba2fd7d 100644 --- a/dev/tests/integration/testsuite/Mage/Core/controllers/IndexControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/controllers/IndexControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cron/Model/ObserverTest.php b/dev/tests/integration/testsuite/Mage/Cron/Model/ObserverTest.php index c4fc0a1170f..c841d9f6fe9 100644 --- a/dev/tests/integration/testsuite/Mage/Cron/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Mage/Cron/Model/ObserverTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cron * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/Block/Account/Dashboard/InfoTest.php b/dev/tests/integration/testsuite/Mage/Customer/Block/Account/Dashboard/InfoTest.php index d86c1268faf..0e42218e94d 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/Block/Account/Dashboard/InfoTest.php +++ b/dev/tests/integration/testsuite/Mage/Customer/Block/Account/Dashboard/InfoTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/Block/Widget/GenderTest.php b/dev/tests/integration/testsuite/Mage/Customer/Block/Widget/GenderTest.php index 5d8fda23b70..179dc1f4b7a 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/Block/Widget/GenderTest.php +++ b/dev/tests/integration/testsuite/Mage/Customer/Block/Widget/GenderTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/Model/Address/ConfigTest.php b/dev/tests/integration/testsuite/Mage/Customer/Model/Address/ConfigTest.php index a100e941e04..fb3ef247b40 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/Model/Address/ConfigTest.php +++ b/dev/tests/integration/testsuite/Mage/Customer/Model/Address/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/Model/Convert/Adapter/CustomerTest.php b/dev/tests/integration/testsuite/Mage/Customer/Model/Convert/Adapter/CustomerTest.php index c8ca1966e42..0ea51b12fa6 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/Model/Convert/Adapter/CustomerTest.php +++ b/dev/tests/integration/testsuite/Mage/Customer/Model/Convert/Adapter/CustomerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/Model/FormTest.php b/dev/tests/integration/testsuite/Mage/Customer/Model/FormTest.php index 5c9f51f9c95..987113988f5 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/Model/FormTest.php +++ b/dev/tests/integration/testsuite/Mage/Customer/Model/FormTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/Model/GroupTest.php b/dev/tests/integration/testsuite/Mage/Customer/Model/GroupTest.php index 46c9b7ec1b7..21b6b43bdd9 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/Model/GroupTest.php +++ b/dev/tests/integration/testsuite/Mage/Customer/Model/GroupTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/_files/address_formats.php b/dev/tests/integration/testsuite/Mage/Customer/_files/address_formats.php index 82d224b7253..15922ea1bee 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/_files/address_formats.php +++ b/dev/tests/integration/testsuite/Mage/Customer/_files/address_formats.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Eav/Model/Resource/Entity/Attribute/CollectionTest.php b/dev/tests/integration/testsuite/Mage/Eav/Model/Resource/Entity/Attribute/CollectionTest.php index 105e21a6e39..3b9228b8db9 100644 --- a/dev/tests/integration/testsuite/Mage/Eav/Model/Resource/Entity/Attribute/CollectionTest.php +++ b/dev/tests/integration/testsuite/Mage/Eav/Model/Resource/Entity/Attribute/CollectionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/GiftMessage/Block/Message/InlineTest.php b/dev/tests/integration/testsuite/Mage/GiftMessage/Block/Message/InlineTest.php index e64f8aea98c..7b1480b3eac 100644 --- a/dev/tests/integration/testsuite/Mage/GiftMessage/Block/Message/InlineTest.php +++ b/dev/tests/integration/testsuite/Mage/GiftMessage/Block/Message/InlineTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_GiftMessage * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Index/Model/ShellTest.php b/dev/tests/integration/testsuite/Mage/Index/Model/ShellTest.php index 54ec79332cb..1893020e24e 100644 --- a/dev/tests/integration/testsuite/Mage/Index/Model/ShellTest.php +++ b/dev/tests/integration/testsuite/Mage/Index/Model/ShellTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Index * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Log/Model/Resource/ShellTest.php b/dev/tests/integration/testsuite/Mage/Log/Model/Resource/ShellTest.php index 75c8fb20c32..8a80cb19956 100644 --- a/dev/tests/integration/testsuite/Mage/Log/Model/Resource/ShellTest.php +++ b/dev/tests/integration/testsuite/Mage/Log/Model/Resource/ShellTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Log * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Log/Model/ShellTest.php b/dev/tests/integration/testsuite/Mage/Log/Model/ShellTest.php index cad96501a16..7d21ce79781 100644 --- a/dev/tests/integration/testsuite/Mage/Log/Model/ShellTest.php +++ b/dev/tests/integration/testsuite/Mage/Log/Model/ShellTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Log * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Newsletter/Model/QueueTest.php b/dev/tests/integration/testsuite/Mage/Newsletter/Model/QueueTest.php index a737f453233..f8781d075a6 100644 --- a/dev/tests/integration/testsuite/Mage/Newsletter/Model/QueueTest.php +++ b/dev/tests/integration/testsuite/Mage/Newsletter/Model/QueueTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Newsletter * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Newsletter/Model/TemplateTest.php b/dev/tests/integration/testsuite/Mage/Newsletter/Model/TemplateTest.php index 976be3f9129..2729e31604f 100644 --- a/dev/tests/integration/testsuite/Mage/Newsletter/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Mage/Newsletter/Model/TemplateTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Newsletter * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Newsletter/_files/queue.php b/dev/tests/integration/testsuite/Mage/Newsletter/_files/queue.php index 540f8f547be..e45eab0076a 100644 --- a/dev/tests/integration/testsuite/Mage/Newsletter/_files/queue.php +++ b/dev/tests/integration/testsuite/Mage/Newsletter/_files/queue.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Newsletter * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Newsletter/_files/subscribers.php b/dev/tests/integration/testsuite/Mage/Newsletter/_files/subscribers.php index eddb2bb1617..a1169c5bb74 100644 --- a/dev/tests/integration/testsuite/Mage/Newsletter/_files/subscribers.php +++ b/dev/tests/integration/testsuite/Mage/Newsletter/_files/subscribers.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Newsletter * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Newsletter/_files/template.php b/dev/tests/integration/testsuite/Mage/Newsletter/_files/template.php index 8089aa325f7..05783835032 100644 --- a/dev/tests/integration/testsuite/Mage/Newsletter/_files/template.php +++ b/dev/tests/integration/testsuite/Mage/Newsletter/_files/template.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Newsletter * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Page/Block/Html/BreadcrumbsTest.php b/dev/tests/integration/testsuite/Mage/Page/Block/Html/BreadcrumbsTest.php index 6bbb675d430..22ca031a760 100644 --- a/dev/tests/integration/testsuite/Mage/Page/Block/Html/BreadcrumbsTest.php +++ b/dev/tests/integration/testsuite/Mage/Page/Block/Html/BreadcrumbsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Page * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Page/Block/Html/FooterTest.php b/dev/tests/integration/testsuite/Mage/Page/Block/Html/FooterTest.php index c861377b5bb..d575c477e8a 100644 --- a/dev/tests/integration/testsuite/Mage/Page/Block/Html/FooterTest.php +++ b/dev/tests/integration/testsuite/Mage/Page/Block/Html/FooterTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Page * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Page/Block/Html/HeadTest.php b/dev/tests/integration/testsuite/Mage/Page/Block/Html/HeadTest.php index f190d56313f..f758a078ab3 100644 --- a/dev/tests/integration/testsuite/Mage/Page/Block/Html/HeadTest.php +++ b/dev/tests/integration/testsuite/Mage/Page/Block/Html/HeadTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Page * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -60,7 +60,7 @@ class Mage_Page_Block_Html_HeadTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception */ public function testAddCssException() { diff --git a/dev/tests/integration/testsuite/Mage/ProductAlert/Block/Email/StockTest.php b/dev/tests/integration/testsuite/Mage/ProductAlert/Block/Email/StockTest.php index 7e48ee05a01..6121b8b74dd 100644 --- a/dev/tests/integration/testsuite/Mage/ProductAlert/Block/Email/StockTest.php +++ b/dev/tests/integration/testsuite/Mage/ProductAlert/Block/Email/StockTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_ProductAlert * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Report/WidgetTest.php b/dev/tests/integration/testsuite/Mage/Report/WidgetTest.php index 645dfc1a667..0662245f621 100644 --- a/dev/tests/integration/testsuite/Mage/Report/WidgetTest.php +++ b/dev/tests/integration/testsuite/Mage/Report/WidgetTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Report * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Review/controllers/ProductControllerTest.php b/dev/tests/integration/testsuite/Mage/Review/controllers/ProductControllerTest.php index 436fc8c2082..7208319bf81 100644 --- a/dev/tests/integration/testsuite/Mage/Review/controllers/ProductControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Review/controllers/ProductControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Review * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Sales/Block/Order/CommentsTest.php b/dev/tests/integration/testsuite/Mage/Sales/Block/Order/CommentsTest.php index 3b5f9d95352..179f07d4fb4 100644 --- a/dev/tests/integration/testsuite/Mage/Sales/Block/Order/CommentsTest.php +++ b/dev/tests/integration/testsuite/Mage/Sales/Block/Order/CommentsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Sales * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Sales/Model/Order/Shipment/TrackTest.php b/dev/tests/integration/testsuite/Mage/Sales/Model/Order/Shipment/TrackTest.php index 337b417abca..3b0caf3fbfa 100644 --- a/dev/tests/integration/testsuite/Mage/Sales/Model/Order/Shipment/TrackTest.php +++ b/dev/tests/integration/testsuite/Mage/Sales/Model/Order/Shipment/TrackTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Sale * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Shipping/Helper/DataTest.php b/dev/tests/integration/testsuite/Mage/Shipping/Helper/DataTest.php index 0b86e77b738..9b6ced5e46e 100644 --- a/dev/tests/integration/testsuite/Mage/Shipping/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/Shipping/Helper/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Shipping * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Tag/Block/Customer/ViewTest.php b/dev/tests/integration/testsuite/Mage/Tag/Block/Customer/ViewTest.php index e1c4be4bd8e..903c81953fd 100644 --- a/dev/tests/integration/testsuite/Mage/Tag/Block/Customer/ViewTest.php +++ b/dev/tests/integration/testsuite/Mage/Tag/Block/Customer/ViewTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Tag * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Tag/Model/TagTest.php b/dev/tests/integration/testsuite/Mage/Tag/Model/TagTest.php index 9f3202de2c3..5aaa986b134 100644 --- a/dev/tests/integration/testsuite/Mage/Tag/Model/TagTest.php +++ b/dev/tests/integration/testsuite/Mage/Tag/Model/TagTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Tag * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/MainTest.php b/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/MainTest.php index d916f36becf..7f6bdd79ed4 100644 --- a/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/MainTest.php +++ b/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/MainTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/SettingsTest.php b/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/SettingsTest.php index ff54432e66b..36baeaaf245 100644 --- a/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/SettingsTest.php +++ b/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/SettingsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/ConfigTest.php b/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/ConfigTest.php index 6091d1b1fc5..804f62a3b3f 100644 --- a/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/ConfigTest.php +++ b/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/InstanceTest.php b/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/InstanceTest.php index 605d79fcbbd..c487fdd49c0 100644 --- a/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/InstanceTest.php +++ b/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/InstanceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Widget/Model/WidgetTest.php b/dev/tests/integration/testsuite/Mage/Widget/Model/WidgetTest.php index caf0e705696..5d00129277a 100644 --- a/dev/tests/integration/testsuite/Mage/Widget/Model/WidgetTest.php +++ b/dev/tests/integration/testsuite/Mage/Widget/Model/WidgetTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Wishlist/Block/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Wishlist/Block/AbstractTest.php index 95f7da6f522..8910b52f3d2 100644 --- a/dev/tests/integration/testsuite/Mage/Wishlist/Block/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Wishlist/Block/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Wishlist * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/Catalog/ImageTest.php b/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/Catalog/ImageTest.php index f8d0f2c59e8..54b4cf68996 100644 --- a/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/Catalog/ImageTest.php +++ b/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/Catalog/ImageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_XmlConnect * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/DataTest.php b/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/DataTest.php index a87f261e163..7cac4390517 100644 --- a/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_XmlConnect * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/ImageTest.php b/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/ImageTest.php index f768b8ea04c..02245f4eda3 100644 --- a/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/ImageTest.php +++ b/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/ImageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_XmlConnect * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/XmlConnect/Model/Catalog/Category/ImageTest.php b/dev/tests/integration/testsuite/Mage/XmlConnect/Model/Catalog/Category/ImageTest.php index 52a822e1555..d57e9aca3fd 100644 --- a/dev/tests/integration/testsuite/Mage/XmlConnect/Model/Catalog/Category/ImageTest.php +++ b/dev/tests/integration/testsuite/Mage/XmlConnect/Model/Catalog/Category/ImageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_XmlConnect * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/XmlConnect/Model/TabsTest.php b/dev/tests/integration/testsuite/Mage/XmlConnect/Model/TabsTest.php index b23e5bbda75..d6219db2032 100644 --- a/dev/tests/integration/testsuite/Mage/XmlConnect/Model/TabsTest.php +++ b/dev/tests/integration/testsuite/Mage/XmlConnect/Model/TabsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_XmlConnect * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/MageTest.php b/dev/tests/integration/testsuite/MageTest.php index 87733e249b5..62110a5c3e3 100644 --- a/dev/tests/integration/testsuite/MageTest.php +++ b/dev/tests/integration/testsuite/MageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -134,4 +134,38 @@ class MageTest extends PHPUnit_Framework_TestCase 'class name' => array('Mage_Core_Helper_Js', 'Mage_Core_Helper_Js'), ); } + + /** + * @magentoAppIsolation enabled + */ + public function testSetConfigModel() + { + Mage::reset(); + Mage::setConfigModel(); + $config = Mage::getConfig(); + $this->assertInstanceOf('Mage_Core_Model_Config', $config); + + Mage::reset(); + Mage::setConfigModel(array('config_model' => 'Mage_Core_Model_Config')); + $config = Mage::getConfig(); + $this->assertInstanceOf('Mage_Core_Model_Config', $config); + + Mage::reset(); + Mage::setConfigModel(array('config_model' => 'ERROR_STRING')); + $config = Mage::getConfig(); + $this->assertInstanceOf('Mage_Core_Model_Config', $config); + } + + /** + * @magentoAppIsolation enabled + */ + public function testSetIsInstalled() + { + if (!Mage::isInstalled()) { + $this->assertFalse(Mage::isInstalled()); + + Mage::setIsInstalled(array('is_installed' => true)); + $this->assertTrue(Mage::isInstalled()); + } + } } diff --git a/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/FormTest.php b/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/FormTest.php index 220d137040a..8df0bb880d3 100644 --- a/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/FormTest.php +++ b/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/FormTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Phoenix_Moneybookers * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/PaymentTest.php b/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/PaymentTest.php index 28ea11b9212..debaf2833e9 100644 --- a/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/PaymentTest.php +++ b/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/PaymentTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Phoenix_Moneybookers * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/Mage/Widget/SkinFilesTest.php b/dev/tests/integration/testsuite/integrity/Mage/Widget/SkinFilesTest.php index f6a303d4585..dfa511e84bc 100644 --- a/dev/tests/integration/testsuite/integrity/Mage/Widget/SkinFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/Mage/Widget/SkinFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/Mage/Widget/TemplateFilesTest.php b/dev/tests/integration/testsuite/integrity/Mage/Widget/TemplateFilesTest.php index 46a86fbeced..e980ab86168 100644 --- a/dev/tests/integration/testsuite/integrity/Mage/Widget/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/Mage/Widget/TemplateFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/Mage/XmlConnect/SkinFilesTest.php b/dev/tests/integration/testsuite/integrity/Mage/XmlConnect/SkinFilesTest.php index 3f777ebd5a0..39ed836c88b 100644 --- a/dev/tests/integration/testsuite/integrity/Mage/XmlConnect/SkinFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/Mage/XmlConnect/SkinFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_XmlConnect * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/modular/Email/TemplateFilesTest.php b/dev/tests/integration/testsuite/integrity/modular/Email/TemplateFilesTest.php index fa4e74621e8..622d2284e89 100644 --- a/dev/tests/integration/testsuite/integrity/modular/Email/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/modular/Email/TemplateFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/modular/LayoutFilesTest.php b/dev/tests/integration/testsuite/integrity/modular/LayoutFilesTest.php index a42ce1b02ad..2c28e7a8207 100644 --- a/dev/tests/integration/testsuite/integrity/modular/LayoutFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/modular/LayoutFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/modular/TemplateFilesTest.php b/dev/tests/integration/testsuite/integrity/modular/TemplateFilesTest.php index 7b342805bfa..bc123d31d2c 100644 --- a/dev/tests/integration/testsuite/integrity/modular/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/modular/TemplateFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/modular/ViewConfigFilesTest.php b/dev/tests/integration/testsuite/integrity/modular/ViewConfigFilesTest.php index 4634b64bb25..2ae7f552b98 100644 --- a/dev/tests/integration/testsuite/integrity/modular/ViewConfigFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/modular/ViewConfigFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/theme/SkinFilesTest.php b/dev/tests/integration/testsuite/integrity/theme/SkinFilesTest.php index 97c514e5739..65298dd1101 100644 --- a/dev/tests/integration/testsuite/integrity/theme/SkinFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/theme/SkinFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,12 +150,15 @@ class Integrity_Theme_SkinFilesTest extends Magento_Test_TestCase_IntegrityAbstr $layout = Mage::app()->getLayout()->getUpdate()->getFileLayoutUpdatesXml( $area, $package, $theme ); - foreach ($layout->xpath('//action[@method="addCss" or @method="addJs"]/*[1]') as $filenameNode) { - $skinFile = (string)$filenameNode; - if ($this->_isFileForDisabledModule($skinFile)) { - continue; + $elements = $layout->xpath('//action[@method="addCss" or @method="addJs"]/*[1]'); + if ($elements) { + foreach ($elements as $filenameNode) { + $skinFile = (string)$filenameNode; + if ($this->_isFileForDisabledModule($skinFile)) { + continue; + } + $files[$area][$package][$theme][] = $skinFile; } - $files[$area][$package][$theme][] = $skinFile; } } diff --git a/dev/tests/integration/testsuite/integrity/theme/TemplateFilesTest.php b/dev/tests/integration/testsuite/integrity/theme/TemplateFilesTest.php index 793ccbce6ea..c46869ac899 100644 --- a/dev/tests/integration/testsuite/integrity/theme/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/theme/TemplateFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/theme/XmlFilesTest.php b/dev/tests/integration/testsuite/integrity/theme/XmlFilesTest.php index cf3bd97f2ba..b1d7439633c 100644 --- a/dev/tests/integration/testsuite/integrity/theme/XmlFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/theme/XmlFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/static/framework/Inspection/CodeSniffer/Command.php b/dev/tests/static/framework/Inspection/CodeSniffer/Command.php index 3a014241a2a..bd319002b10 100644 --- a/dev/tests/static/framework/Inspection/CodeSniffer/Command.php +++ b/dev/tests/static/framework/Inspection/CodeSniffer/Command.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/static/framework/Inspection/CommandAbstract.php b/dev/tests/static/framework/Inspection/CommandAbstract.php index 38a295262d0..90f0356e794 100644 --- a/dev/tests/static/framework/Inspection/CommandAbstract.php +++ b/dev/tests/static/framework/Inspection/CommandAbstract.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 @@ abstract class Inspection_CommandAbstract public function run(array $whiteList, array $blackList = array()) { $shellCmd = $this->_buildShellCmd($whiteList, $blackList); - return $this->_execShellCmd($shellCmd); + return ($this->_execShellCmd($shellCmd) !== false); } /** @@ -65,7 +65,7 @@ abstract class Inspection_CommandAbstract */ public function canRun() { - return $this->_execShellCmd($this->_buildVersionShellCmd()); + return ($this->_execShellCmd($this->_buildVersionShellCmd()) !== false); } /** @@ -75,10 +75,10 @@ abstract class Inspection_CommandAbstract */ public function getVersion() { - if (!$this->_execShellCmd($this->_buildVersionShellCmd(), $versionOutput)) { + $versionOutput = $this->_execShellCmd($this->_buildVersionShellCmd()); + if (!$versionOutput) { return null; } - $versionOutput = implode("\n", $versionOutput); return (preg_match('/[^\d]*([^\s]+)/', $versionOutput, $matches) ? $matches[1] : $versionOutput); } @@ -109,16 +109,16 @@ abstract class Inspection_CommandAbstract abstract protected function _buildShellCmd($whiteList, $blackList); /** - * Execute the shell command on the current environment + * Execute a shell command on the current environment and return its output or FALSE on failure * * @param string $shellCmd - * @param array $output - * @return bool + * @return string|false */ - protected function _execShellCmd($shellCmd, array &$output = null) + protected function _execShellCmd($shellCmd) { $output = array(); exec($shellCmd . ' 2>&1', $output, $exitCode); - return ($exitCode === 0); + $output = implode(PHP_EOL, $output); + return ($exitCode === 0 ? $output : false); } } diff --git a/dev/tests/static/framework/Inspection/CopyPasteDetector/Command.php b/dev/tests/static/framework/Inspection/CopyPasteDetector/Command.php index 27067af3fce..9d1e0db261e 100644 --- a/dev/tests/static/framework/Inspection/CopyPasteDetector/Command.php +++ b/dev/tests/static/framework/Inspection/CopyPasteDetector/Command.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,24 +108,22 @@ class Inspection_CopyPasteDetector_Command extends Inspection_CommandAbstract } /** - * Under Unix platform creates one more report in html-format. - * The report is generated based on already existing report in xml format and XSLT conversion scheme - * in "html_report.xslt". Returns null, if conversion tool was not found, otherwise returns true/false as a result - * of conversion tool execution. + * Generate HTML representation for an existing XML report using XSLT transformation * * @return bool|null */ protected function _generateHtmlReport() { - $isWindows = strncasecmp(PHP_OS, 'win', 3) == 0; - if ($isWindows) { - return null; - } - if (!$this->_execShellCmd('xsltproc --version')) { + if ($this->_execShellCmd('xsltproc --version') === false) { return null; } $xsltFile = __DIR__ . '/html_report.xslt'; - $result = $this->_execShellCmd("xsltproc {$xsltFile} {$this->_reportFile} > {$this->_reportFile}.html"); - return $result; + $result = $this->_execShellCmd(sprintf( + "xsltproc %s %s > %s", + escapeshellarg($xsltFile), + escapeshellarg($this->_reportFile), + escapeshellarg("{$this->_reportFile}.html") + )); + return ($result !== false); } } diff --git a/dev/tests/static/framework/Inspection/MessDetector/Command.php b/dev/tests/static/framework/Inspection/MessDetector/Command.php index e45e00d32b7..0e593aa20a2 100644 --- a/dev/tests/static/framework/Inspection/MessDetector/Command.php +++ b/dev/tests/static/framework/Inspection/MessDetector/Command.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/static/framework/bootstrap.php b/dev/tests/static/framework/bootstrap.php index bd58290f3e5..f5f9af2d0ef 100644 --- a/dev/tests/static/framework/bootstrap.php +++ b/dev/tests/static/framework/bootstrap.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ if (!defined('PATH_TO_SOURCE_CODE')) { diff --git a/dev/tests/static/framework/tests/unit/phpunit.xml.dist b/dev/tests/static/framework/tests/unit/phpunit.xml.dist index fbfb3dba7c9..4e5e511dd1f 100644 --- a/dev/tests/static/framework/tests/unit/phpunit.xml.dist +++ b/dev/tests/static/framework/tests/unit/phpunit.xml.dist @@ -21,7 +21,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/static/framework/tests/unit/testsuite/Inspection/CodeSniffer/CommandTest.php b/dev/tests/static/framework/tests/unit/testsuite/Inspection/CodeSniffer/CommandTest.php index 927630e6cf8..5d48ddcf627 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Inspection/CodeSniffer/CommandTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Inspection/CodeSniffer/CommandTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,13 +44,13 @@ class Inspection_CodeSniffer_CommandTest extends PHPUnit_Framework_TestCase /** * @dataProvider canRunDataProvider */ - public function testCanRun($expectedResult) + public function testCanRun($cmdOutput, $expectedResult) { $this->_cmd ->expects($this->once()) ->method('_execShellCmd') ->with($this->stringContains('phpcs')) - ->will($this->returnValue($expectedResult)) + ->will($this->returnValue($cmdOutput)) ; $this->assertEquals($expectedResult, $this->_cmd->canRun()); } @@ -58,8 +58,8 @@ class Inspection_CodeSniffer_CommandTest extends PHPUnit_Framework_TestCase public function canRunDataProvider() { return array( - 'success' => array(true), - 'failure' => array(false), + 'success' => array('PHP_CodeSniffer version X.Y.Z', true), + 'failure' => array(false, false), ); } @@ -68,16 +68,11 @@ class Inspection_CodeSniffer_CommandTest extends PHPUnit_Framework_TestCase */ public function testGetVersion($versionCmdOutput, $expectedVersion) { - $cmdCallback = function ($shellCmd, array &$output = null) use ($versionCmdOutput) - { - $output = array($versionCmdOutput); - return !empty($shellCmd); - }; $this->_cmd ->expects($this->once()) ->method('_execShellCmd') ->with($this->stringContains('phpcs')) - ->will($this->returnCallback($cmdCallback)) + ->will($this->returnValue($versionCmdOutput)) ; $this->assertEquals($expectedVersion, $this->_cmd->getVersion()); } diff --git a/dev/tests/static/framework/tests/unit/testsuite/Inspection/CopyPasteDetector/CommandTest.php b/dev/tests/static/framework/tests/unit/testsuite/Inspection/CopyPasteDetector/CommandTest.php index 2c5c1472d9c..270afbd0ca1 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Inspection/CopyPasteDetector/CommandTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Inspection/CopyPasteDetector/CommandTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,32 +41,25 @@ class Inspection_CopyPasteDetector_CommandTest extends PHPUnit_Framework_TestCas ); } - public function canTestDataProvider() - { - return array( - 'success' => array(true), - 'failure' => array(false), - ); - } - /** - * @dataProvider canTestDataProvider + * @dataProvider canRunDataProvider */ - public function testCanRun($expectedResult) + public function testCanRun($cmdOutput, $expectedResult) { $this->_cmd ->expects($this->once()) ->method('_execShellCmd') ->with($this->stringContains('phpcpd')) - ->will($this->returnValue($expectedResult)) + ->will($this->returnValue($cmdOutput)) ; $this->assertEquals($expectedResult, $this->_cmd->canRun()); } - public function getVersionDataProvider() + public function canRunDataProvider() { return array( - array('phpcpd 1.3.2 by Sebastian Bergmann.', '1.3.2'), + 'success' => array('phpcpd X.Y.Z', true), + 'failure' => array(false, false), ); } @@ -75,20 +68,22 @@ class Inspection_CopyPasteDetector_CommandTest extends PHPUnit_Framework_TestCas */ public function testGetVersion($versionCmdOutput, $expectedVersion) { - $cmdCallback = function ($shellCmd, array &$output = null) use ($versionCmdOutput) - { - $output = array($versionCmdOutput); - return !empty($shellCmd); - }; $this->_cmd ->expects($this->once()) ->method('_execShellCmd') ->with($this->stringContains('phpcpd')) - ->will($this->returnCallback($cmdCallback)) + ->will($this->returnValue($versionCmdOutput)) ; $this->assertEquals($expectedVersion, $this->_cmd->getVersion()); } + public function getVersionDataProvider() + { + return array( + array('phpcpd 1.3.2 by Sebastian Bergmann.', '1.3.2'), + ); + } + public function testRun() { $expectedQuoteChar = substr(escapeshellarg(' '), 0, 1); @@ -100,10 +95,34 @@ class Inspection_CopyPasteDetector_CommandTest extends PHPUnit_Framework_TestCas ; $expectedCmd = str_replace('"', $expectedQuoteChar, $expectedCmd); $this->_cmd - ->expects($this->once()) + ->expects($this->at(0)) ->method('_execShellCmd') ->with($expectedCmd) ; $this->_cmd->run(array('some/test/dir with space', 'some/test/file with space.php')); } + + public function testRunHtmlReport() + { + $this->_cmd + ->expects($this->at(0)) + ->method('_execShellCmd') + ->with($this->stringContains('phpcpd')) + ; + $this->_cmd + ->expects($this->at(1)) + ->method('_execShellCmd') + ->with($this->stringContains('xsltproc')) + ->will($this->returnValue('Using libxml X, libxslt Y and libexslt Z')) + ; + $expectedQuoteChar = substr(escapeshellarg(' '), 0, 1); + $expectedXsltCmd = 'xsltproc "%s/html_report.xslt" "some/report/file.xml" > "some/report/file.xml.html"'; + $expectedXsltCmd = str_replace('"', $expectedQuoteChar, $expectedXsltCmd); + $this->_cmd + ->expects($this->at(2)) + ->method('_execShellCmd') + ->with($this->matches($expectedXsltCmd)) + ; + $this->_cmd->run(array()); + } } diff --git a/dev/tests/static/framework/tests/unit/testsuite/Inspection/MessDetector/CommandTest.php b/dev/tests/static/framework/tests/unit/testsuite/Inspection/MessDetector/CommandTest.php index 14be9911319..e6e07d121e4 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Inspection/MessDetector/CommandTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Inspection/MessDetector/CommandTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,13 +49,13 @@ class Inspection_MessDetector_CommandTest extends PHPUnit_Framework_TestCase /** * @dataProvider canTestDataProvider */ - public function testCanRun($expectedResult) + public function testCanRun($cmdOutput, $expectedResult) { $this->_cmd ->expects($this->once()) ->method('_execShellCmd') ->with($this->stringContains('phpmd')) - ->will($this->returnValue($expectedResult)) + ->will($this->returnValue($cmdOutput)) ; $this->assertEquals($expectedResult, $this->_cmd->canRun()); } @@ -63,16 +63,8 @@ class Inspection_MessDetector_CommandTest extends PHPUnit_Framework_TestCase public function canTestDataProvider() { return array( - 'success' => array(true), - 'failure' => array(false), - ); - } - - public function getVersionDataProvider() - { - return array( - array('PHPMD 0.2.8RC1 by Manuel Pichler', '0.2.8RC1'), - array('PHPMD 1.1.1 by Manuel Pichler', '1.1.1'), + 'success' => array('PHPMD X.Y.Z', true), + 'failure' => array(false, false), ); } @@ -81,20 +73,23 @@ class Inspection_MessDetector_CommandTest extends PHPUnit_Framework_TestCase */ public function testGetVersion($versionCmdOutput, $expectedVersion) { - $cmdCallback = function ($shellCmd, array &$output = null) use ($versionCmdOutput) - { - $output = array($versionCmdOutput); - return !empty($shellCmd); - }; $this->_cmd ->expects($this->once()) ->method('_execShellCmd') ->with($this->stringContains('phpmd')) - ->will($this->returnCallback($cmdCallback)) + ->will($this->returnValue($versionCmdOutput)) ; $this->assertEquals($expectedVersion, $this->_cmd->getVersion()); } + public function getVersionDataProvider() + { + return array( + array('PHPMD 0.2.8RC1 by Manuel Pichler', '0.2.8RC1'), + array('PHPMD 1.1.1 by Manuel Pichler', '1.1.1'), + ); + } + public function testRun() { $expectedQuoteChar = substr(escapeshellarg(' '), 0, 1); diff --git a/dev/tests/static/phpunit-all.xml.dist b/dev/tests/static/phpunit-all.xml.dist index 2481868d112..a4d56cf25e6 100644 --- a/dev/tests/static/phpunit-all.xml.dist +++ b/dev/tests/static/phpunit-all.xml.dist @@ -23,7 +23,7 @@ * * @category tests * @package static - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/static/phpunit.xml.dist b/dev/tests/static/phpunit.xml.dist index 8e316d443df..8bef5f4fe2f 100644 --- a/dev/tests/static/phpunit.xml.dist +++ b/dev/tests/static/phpunit.xml.dist @@ -23,7 +23,7 @@ * * @category tests * @package static - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/static/testsuite/Integrity/ClassesTest.php b/dev/tests/static/testsuite/Integrity/ClassesTest.php index d198aab986e..13994e9ee65 100644 --- a/dev/tests/static/testsuite/Integrity/ClassesTest.php +++ b/dev/tests/static/testsuite/Integrity/ClassesTest.php @@ -23,7 +23,7 @@ * @category tests * @package static * @subpackage Integrity - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 Integrity_ClassesTest extends PHPUnit_Framework_TestCase @@ -36,14 +36,14 @@ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase protected static $_existingClasses = array(); /** - * @param SplFileInfo $file - * @dataProvider phpFileDataProvider + * @param string $file + * @dataProvider Util_Files::getPhpFiles */ public function testPhpFile($file) { self::skipBuggyFile($file); $contents = file_get_contents($file); - $classes = $this->_collectMatches($contents, '/ + $classes = Util_Classes::getAllMatches($contents, '/ # ::getResourceModel ::getBlockSingleton ::getModel ::getSingleton \:\:get(?:ResourceModel | BlockSingleton | Model | Singleton)?\(\s*[\'"]([a-z\d_]+)[\'"]\s*[\),] @@ -66,7 +66,7 @@ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase ); // without modifier "i". Starting from capital letter is a significant characteristic of a class name - $this->_collectMatches($contents, '/(?:\-> | parent\:\:)(?:_init | setType)\(\s* + Util_Classes::getAllMatches($contents, '/(?:\-> | parent\:\:)(?:_init | setType)\(\s* \'([A-Z][a-z\d][A-Za-z\d_]+)\'(?:,\s*\'([A-Z][a-z\d][A-Za-z\d_]+)\') \s*\)/x', $classes @@ -85,20 +85,12 @@ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase */ protected function _collectResourceHelpersPhp($contents, &$classes) { - $matches = $this->_collectMatches($contents, '/(?:\:\:|\->)getResourceHelper\(\s*\'([a-z\d_]+)\'\s*\)/ix'); + $matches = Util_Classes::getAllMatches($contents, '/(?:\:\:|\->)getResourceHelper\(\s*\'([a-z\d_]+)\'\s*\)/ix'); foreach ($matches as $moduleName) { $classes[] = "{$moduleName}_Model_Resource_Helper_Mysql4"; } } - /** - * @return array - */ - public function phpFileDataProvider() - { - return FileDataProvider::getPhpFiles(); - } - /** * @param string $path * @dataProvider configFileDataProvider @@ -106,44 +98,8 @@ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase public function testConfigFile($path) { self::skipBuggyFile($path); - $xml = simplexml_load_file($path); - $classes = array(); - - // various nodes - $nodes = $xml->xpath('/config//resource_adapter | //class | //model | //backend_model | //source_model - | //price_model | //model_token | //writer_model | //clone_model | //frontend_model | //admin_renderer - | //renderer' - ) ?: array(); - foreach ($nodes as $node) { - if (preg_match('/^([A-Z][a-z\d_][A-Za-z\d_]+)\:?/', (string)$node, $matches)) { - $classes[$matches[1]] = 1; - } - } - - // "backend_model" attribute - $nodes = $xml->xpath('//@backend_model') ?: array(); - foreach ($nodes as $node) { - $node = (array)$node; - $classes[$node['@attributes']['backend_model']] = 1; - } - - $this->_collectLoggingExpectedModels($xml, $classes); - - $this->_assertClassesExist(array_keys($classes)); - } - - /** - * Special case: collect "expected models" from logging xml-file - * - * @param SimpleXmlElement $xml - * @param array &$classes - */ - protected function _collectLoggingExpectedModels($xml, &$classes) - { - $nodes = $xml->xpath('/logging/*/expected_models/* | /logging/*/actions/*/expected_models/*') ?: array(); - foreach ($nodes as $node) { - $classes[$node->getName()] = 1; - } + $classes = Util_Classes::collectClassesInConfig(simplexml_load_file($path)); + $this->_assertClassesExist($classes); } /** @@ -151,71 +107,30 @@ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase */ public function configFileDataProvider() { - return FileDataProvider::getConfigFiles(); + return Util_Files::getConfigFiles(); } /** * @param string $path - * @dataProvider layoutFileDataProvider + * @dataProvider Util_Files::getLayoutFiles */ public function testLayoutFile($path) { self::skipBuggyFile($path); $xml = simplexml_load_file($path); - $classes = array(); - - // block@type - $nodes = $xml->xpath('/layout//block[@type]') ?: array(); - foreach ($nodes as $node) { - $node = (array)$node; - $class = $node['@attributes']['type']; - $classes[(string)$class] = 1; - } - // any text nodes that contain conventional block/model/helper names - $nodes = $xml->xpath('/layout//action/attributeType | /layout//action[@method="addTab"]/content - | /layout//action[@method="addRenderer" or @method="addItemRender" or @method="addColumnRender" - or @method="addPriceBlockType" or @method="addMergeSettingsBlockType" - or @method="addInformationRenderer" or @method="addOptionRenderer" or @method="addRowItemRender" - or @method="addDatabaseBlock"]/*[2] - | /layout//action[@method="setMassactionBlockName" or @method="addProductConfigurationHelper"]/name - | /layout//action[@method="setEntityModelClass"]/code - | /layout//*[contains(text(), "_Block_") or contains(text(), "_Model_") or contains(text(), "_Helper_")]' - ) ?: array(); - foreach ($nodes as $node) { - $classes[(string)$node] = 1; + $classes = Util_Classes::getXmlNodeValues($xml, + '/layout//*[contains(text(), "_Block_") or contains(text(), "_Model_") or contains(text(), "_Helper_")]' + ); + foreach (Util_Classes::getXmlAttributeValues($xml, '/layout//@helper', 'helper') as $class) { + $classes[] = Util_Classes::getCallbackClass($class); } - - $this->_collectLayoutHelpersAndModules($xml, $classes); - - $this->_assertClassesExist(array_keys($classes)); - } - - /** - * Special case: collect declaration of helpers and modules in layout files and figure out helper class names - * - * @param SimpleXmlElement $xml - * @param array &$classes - */ - protected function _collectLayoutHelpersAndModules($xml, &$classes) - { - $nodes = $xml->xpath('/layout//@helper | /layout//@module') ?: array(); - foreach ($nodes as $node) { - $node = (array)$node; - if (isset($node['@attributes']['helper'])) { - $class = explode('::', $node['@attributes']['helper']); - $classes[array_shift($class)] = 1; - } - if (isset($node['@attributes']['module'])) { - $class = $node['@attributes']['module'] . '_Helper_Data'; - $classes[$class] = 1; - } + foreach (Util_Classes::getXmlAttributeValues($xml, '/layout//@module', 'module') as $module) { + $classes[] = "{$module}_Helper_Data"; } - } + $classes = array_merge($classes, Util_Classes::collectLayoutClasses($xml)); - public function layoutFileDataProvider() - { - return FileDataProvider::getLayoutFiles(); + $this->_assertClassesExist(array_unique($classes)); } /** @@ -246,27 +161,6 @@ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase } } - /** - * Sub-routine to find all unique matches in specified content using specified PCRE - * - * @param string $contents - * @param string $regex - * @param array &$result - * @return array - */ - protected function _collectMatches($contents, $regex, &$result = array()) - { - preg_match_all($regex, $contents, $matches); - array_shift($matches); - foreach ($matches as $row) { - $result = array_merge($result, $row); - } - $result = array_filter(array_unique($result), function($value) { - return !empty($value); - }); - return $result; - } - /** * Check whether specified classes correspond to a file according PSR-0 standard * diff --git a/dev/tests/static/testsuite/Legacy/ClassesTest.php b/dev/tests/static/testsuite/Legacy/ClassesTest.php index 73eb4725a46..392d45050ae 100644 --- a/dev/tests/static/testsuite/Legacy/ClassesTest.php +++ b/dev/tests/static/testsuite/Legacy/ClassesTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Integrity - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,25 +31,25 @@ class Legacy_ClassesTest extends PHPUnit_Framework_TestCase { /** - * List of already found classes to avoid checking them over and over again - * - * @var array + * @param string $file + * @dataProvider Util_Files::getPhpFiles */ - protected static $_existingClasses = array(); + public function testPhpCode($file) + { + $classes = self::collectPhpCodeClasses(file_get_contents($file)); + $this->_assertNonFactoryName($classes); + } /** - * Collect class names by patterns + * Scan contents as PHP-code and find class name occurrences * - * @param string $file - * @dataProvider FileDataProvider::getPhpFiles + * @param string $contents + * @param array &$classes + * @return array */ - public function testPhpCode($file) + public static function collectPhpCodeClasses($contents, &$classes = array()) { - $contents = file_get_contents($file); - $classes = array(); - $this->_collectMatches( - $contents, - '/ + Util_Classes::getAllMatches($contents, '/ # ::getModel ::getSingleton ::getResourceModel ::getResourceSingleton \:\:get(?:Resource)?(?:Model | Singleton)\(\s*[\'"]([^\'"]+)[\'"]\s*[\),] @@ -84,220 +84,85 @@ class Legacy_ClassesTest extends PHPUnit_Framework_TestCase $skipForInit = implode('|', array('id', '[\w\d_]+_id', 'pk', 'code', 'status', 'serial_number', 'entity_pk_value', 'currency_code') ); - $this->_collectMatches( - $contents, - '/ + Util_Classes::getAllMatches($contents, '/ (?:parent\:\: | \->)_init\(\s*[\'"]([^\'"]+)[\'"]\s*\) | (?:parent\:\: | \->)_init\(\s*[\'"]([^\'"]+)[\'"]\s*,\s*[\'"]((?!(' . $skipForInit . '))[^\'"]+)[\'"]\s*\) /Uix', $classes ); - - $this->_assertClassesNamedCorrect($classes, $file); + return $classes; } /** - * Return list of php and phtml files - * - * @return array - */ - public function phpFileDataProvider() - { - return FileDataProvider::getPhpFiles(); - } - - /** - * Collect class names by xpath in configurable files - * * @param string $path * @dataProvider configFileDataProvider */ public function testConfiguration($path) { $xml = simplexml_load_file($path); - $classes = array(); - - // various nodes - // excluding class in /config/sections and model in //staging_items/* - $nodes = $xml->xpath('/config//resource_adapter | /config/*[not(name()="sections")]//class - | //model[parent::parent[not(name() = "staging_items")]] | //backend_model | //source_model - | //price_model | //model_token | //writer_model | //clone_model | //frontend_model | //admin_renderer - | //renderer' - ) ?: array(); - foreach ($nodes as $node) { - if (preg_match('/([\w\d_\/]+)\:{0,2}/i', (string)$node, $matches)) { - $classes[$matches[1]] = 1; - } - } - - // "backend_model" attribute - $nodes = $xml->xpath('//@backend_model') ?: array(); - foreach ($nodes as $node) { - $node = (array)$node; - $classes[$node['@attributes']['backend_model']] = 1; - } - $this->_collectLoggingExpectedModels($xml, $classes); + $classes = Util_Classes::collectClassesInConfig($xml); + $this->_assertNonFactoryName($classes); - $this->_assertClassesNamedCorrect(array_keys($classes), $path); + $modules = Util_Classes::getXmlAttributeValues($xml, '//@module', 'module'); + $this->_assertNonFactoryName(array_unique($modules)); } /** - * Return list of configurable files - * * @return array */ public function configFileDataProvider() { - return FileDataProvider::getConfigFiles(); + return Util_Files::getConfigFiles(); } /** - * Special case: collect "expected models" from logging xml-file - * - * @param SimpleXmlElement $xml - * @param array &$classes - */ - protected function _collectLoggingExpectedModels($xml, &$classes) - { - $nodes = $xml->xpath('/logging/*/expected_models/* | /logging/*/actions/*/expected_models/*') ?: array(); - foreach ($nodes as $node) { - $classes[$node->getName()] = 1; - } - } - - /** - * Collect class names from layout files - * * @param string $path * @dataProvider layoutFileDataProvider */ public function testLayouts($path) { $xml = simplexml_load_file($path); - $classes = array(); - - // block@type - $nodes = $xml->xpath('/layout//block[@type]') ?: array(); - foreach ($nodes as $node) { - $node = (array)$node; - $class = $node['@attributes']['type']; - $classes[(string)$class] = 1; + $classes = Util_Classes::collectLayoutClasses($xml); + foreach (Util_Classes::getXmlAttributeValues($xml, '/layout//@helper', 'helper') as $class) { + $classes[] = Util_Classes::getCallbackClass($class); } - - // any text nodes that contain conventional block/model/helper names - $nodes = $xml->xpath('/layout//action/attributeType | /layout//renderer_block | /layout//renderer - | /layout//action[@method="addTab"]/content - | /layout//action[@method="addRenderer" or @method="addItemRender" or @method="addColumnRender" - or @method="addPriceBlockType" or @method="addMergeSettingsBlockType" - or @method="addInformationRenderer" or @method="addOptionRenderer" or @method="addRowItemRender" - or @method="addDatabaseBlock"]/block - | /layout//action[@method="setMassactionBlockName" or @method="addProductConfigurationHelper"]/name - | /layout//action[@method="setEntityModelClass"]/code' - ) ?: array(); - foreach ($nodes as $node) { - $classes[(string)$node] = 1; - } - - $this->_collectLayoutHelpersAndModules($xml, $classes); - - $this->_assertClassesNamedCorrect(array_keys($classes), $path); + $classes = array_merge($classes, Util_Classes::getXmlAttributeValues($xml, '/layout//@module', 'module')); + $this->_assertNonFactoryName(array_unique($classes)); } /** - * Return list of layout files - * * @return array */ public function layoutFileDataProvider() { - return FileDataProvider::getLayoutFiles(); - } - - /** - * Special case: collect declaration of helpers and modules in layout files and figure out helper class names - * - * @param SimpleXmlElement $xml - * @param array &$classes - */ - protected function _collectLayoutHelpersAndModules($xml, &$classes) - { - $nodes = $xml->xpath('/layout//@helper | /layout//@module') ?: array(); - foreach ($nodes as $node) { - $node = (array)$node; - if (isset($node['@attributes']['helper'])) { - $class = explode('::', $node['@attributes']['helper']); - $classes[array_shift($class)] = 1; - } - if (isset($node['@attributes']['module'])) { - $class = $node['@attributes']['module'] . '_Helper_Data'; - $classes[$class] = 1; - } - } + return Util_Files::getLayoutFiles(); } /** - * Sub-routine to find all unique matches in specified content using specified PCRE + * Check whether specified classes or module names correspond to a file according PSR-0 standard * - * @param string $contents - * @param string $regex - * @param array &$result - * @return array - */ - protected function _collectMatches($contents, $regex, &$result = array()) - { - preg_match_all($regex, $contents, $matches); - - array_shift($matches); - foreach ($matches as $row) { - $result = array_merge($result, $row); - } - $result = array_filter(array_unique($result), function($value) { - return !empty($value); - }); - return $result; - } - - /** - * Check whether specified classes correspond to a file according PSR-0 standard - * - * Cyclomatic complexity is because of temporary marking test as incomplete * Suppressing "unused variable" because of the "catch" block * - * @param array $classes - * @param string $fileName - * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @param array $names * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ - protected function _assertClassesNamedCorrect($classes, $fileName) + protected function _assertNonFactoryName($names) { - if (!$classes) { + if (!$names) { return; } - $badClasses = array(); - foreach ($classes as $class) { + $factoryNames = array(); + foreach ($names as $name) { try { - $matches = array(); - $this->assertTrue(preg_match('/(?:[^\w\d_]|__)/i', $class, $matches) == 0); - array_filter( - array_map(function ($value) { - return ucfirst($value) === $value; - }, - explode('_', $class) - ), - array($this, "assertTrue") - ); - self::$_existingClasses[$class] = 1; + $this->assertFalse(false === strpos($name, '_')); + $this->assertRegExp('/^([A-Z][A-Za-z\d_]+)+$/', $name); } catch (PHPUnit_Framework_AssertionFailedError $e) { - if ('Mage_Catalog_Model_Resource_Convert' == $class) { - $this->markTestIncomplete('Bug MAGE-4763'); - } - - $badClasses[] = $class; + $factoryNames[] = $name; } } - if ($badClasses) { - $this->fail("Incorrect class(es) declaration in {$fileName}:\n" . implode("\n", $badClasses)); + if ($factoryNames) { + $this->fail('Obsolete factory name(s) detected:' . "\n" . implode("\n", $factoryNames)); } } } diff --git a/dev/tests/static/testsuite/Legacy/ConfigTest.php b/dev/tests/static/testsuite/Legacy/ConfigTest.php index c6e7d56879f..a9cdb9739e1 100644 --- a/dev/tests/static/testsuite/Legacy/ConfigTest.php +++ b/dev/tests/static/testsuite/Legacy/ConfigTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,6 @@ class Legacy_ConfigTest extends PHPUnit_Framework_TestCase */ public function configFileDataProvider() { - return FileDataProvider::getConfigFiles('config.xml'); + return Util_Files::getConfigFiles('config.xml'); } } diff --git a/dev/tests/static/testsuite/Legacy/EmailTemplateTest.php b/dev/tests/static/testsuite/Legacy/EmailTemplateTest.php index 7dce06e2c4f..c48e9f0ca8b 100644 --- a/dev/tests/static/testsuite/Legacy/EmailTemplateTest.php +++ b/dev/tests/static/testsuite/Legacy/EmailTemplateTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,6 @@ class Legacy_EmailTemplateTest extends PHPUnit_Framework_TestCase public function obsoleteDirectivesDataProvider() { - return FileDataProvider::getEmailTemplates(); + return Util_Files::getEmailTemplates(); } } diff --git a/dev/tests/static/testsuite/Legacy/FilesystemTest.php b/dev/tests/static/testsuite/Legacy/FilesystemTest.php new file mode 100644 index 00000000000..8a9ba2a9788 --- /dev/null +++ b/dev/tests/static/testsuite/Legacy/FilesystemTest.php @@ -0,0 +1,53 @@ +<?php +/** + * Backwards-incompatible changes in file system + * + * 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 tests + * @package static + * @copyright 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 Legacy_FilesystemTest extends PHPUnit_Framework_TestCase +{ + /** + * Directories may re-appear again during merging, therefore ensure they were properly relocated + * + * @param string $path + * @dataProvider relocationsDataProvider + */ + public function testRelocations($path) + { + $this->assertFileNotExists(realpath(__DIR__ . '/../../../../..') . DIRECTORY_SEPARATOR . $path); + } + + public function relocationsDataProvider() + { + return array( + array('Relocated to pub/errors' => 'errors'), + array('Eliminated with Mage_Compiler' => 'includes'), + array('Relocated to pub/js' => 'js'), + array('Relocated to pub/media' => 'media'), + array('Eliminated as not needed' => 'pkginfo'), + array('Dissolved into themes under app/design ' => 'skin'), + ); + } +} diff --git a/dev/tests/static/testsuite/Legacy/LayoutTest.php b/dev/tests/static/testsuite/Legacy/LayoutTest.php index 58c8274727d..e3e6c502cfd 100644 --- a/dev/tests/static/testsuite/Legacy/LayoutTest.php +++ b/dev/tests/static/testsuite/Legacy/LayoutTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,6 +54,6 @@ class Legacy_LayoutTest extends PHPUnit_Framework_TestCase public function layoutFileDataProvider() { - return FileDataProvider::getLayoutFiles(); + return Util_Files::getLayoutFiles(); } } diff --git a/dev/tests/static/testsuite/Legacy/LicenseTest.php b/dev/tests/static/testsuite/Legacy/LicenseTest.php index da4d8ff1c38..c566b01295d 100644 --- a/dev/tests/static/testsuite/Legacy/LicenseTest.php +++ b/dev/tests/static/testsuite/Legacy/LicenseTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/static/testsuite/Legacy/ObsoleteCodeTest.php b/dev/tests/static/testsuite/Legacy/ObsoleteCodeTest.php index fe477e1b286..7a719d40852 100644 --- a/dev/tests/static/testsuite/Legacy/ObsoleteCodeTest.php +++ b/dev/tests/static/testsuite/Legacy/ObsoleteCodeTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 +64,7 @@ class Legacy_ObsoleteCodeTest extends PHPUnit_Framework_TestCase */ public function phpFileDataProvider() { - return FileDataProvider::getPhpFiles(); + return Util_Files::getPhpFiles(); } /** @@ -82,7 +82,7 @@ class Legacy_ObsoleteCodeTest extends PHPUnit_Framework_TestCase */ public function xmlFileDataProvider() { - return FileDataProvider::getXmlFiles(); + return Util_Files::getXmlFiles(); } /** @@ -100,7 +100,7 @@ class Legacy_ObsoleteCodeTest extends PHPUnit_Framework_TestCase */ public function jsFileDataProvider() { - return FileDataProvider::getJsFiles(); + return Util_Files::getJsFiles(); } /** @@ -265,8 +265,16 @@ class Legacy_ObsoleteCodeTest extends PHPUnit_Framework_TestCase $result = array(); foreach ($config as $key => $value) { $entity = is_string($key) ? $key : $value; - $class = isset($value['class_scope']) ? $value['class_scope'] : null; - $suggestion = isset($value['suggestion']) ? sprintf(self::SUGGESTION_MESSAGE, $value['suggestion']) : ''; + $class = null; + $suggestion = null; + if (is_array($value)) { + if (isset($value['class_scope'])) { + $class = $value['class_scope']; + } + if (isset($value['suggestion'])) { + $suggestion = sprintf(self::SUGGESTION_MESSAGE, $value['suggestion']); + } + } $result[$entity] = array( 'suggestion' => $suggestion, 'class_scope' => $class diff --git a/dev/tests/static/testsuite/Legacy/TableTest.php b/dev/tests/static/testsuite/Legacy/TableTest.php index 54daafe3b82..22339a45759 100644 --- a/dev/tests/static/testsuite/Legacy/TableTest.php +++ b/dev/tests/static/testsuite/Legacy/TableTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -159,18 +159,7 @@ class Legacy_TableTest extends PHPUnit_Framework_TestCase */ protected function _getRegexpTableInArrays($filePath) { - $keys = array( - 'table', - 'additional_attribute_table', - ); - - $regexps = array(); - foreach ($keys as $key) { - $regexps[] = '[\'"]' . $key . '[\'"]\s*=>\s*[\'"]([^\'"]+)'; - } - $result = '#' . implode('|', $regexps) . '#'; - - return $result; + return '/[\'"](?:[a-z\d_]+_)?table[\'"]\s*=>\s*[\'"]([^\'"]+)/'; } /** @@ -243,6 +232,6 @@ class Legacy_TableTest extends PHPUnit_Framework_TestCase */ public function tableNameDataProvider() { - return FileDataProvider::getPhpFiles(); + return Util_Files::getPhpFiles(); } } diff --git a/dev/tests/static/testsuite/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Legacy/_files/obsolete_classes.php index f83052271ea..ffbf1c92249 100644 --- a/dev/tests/static/testsuite/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Legacy/_files/obsolete_classes.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ return array( @@ -165,6 +165,7 @@ return array( 'Varien_Convert_Validator_Dryrun', 'Varien_Convert_Validator_Column', 'Varien_Convert_Validator_Interface', + 'Varien_Profiler' => array('suggestion' => 'Magento_Profiler'), 'Mage_Catalog_Model_Resource_Product_Attribute_Frontend_Tierprice', 'Mage_Adminhtml_Block_Api_Tab_Userroles', 'Mage_Adminhtml_Block_Api_Edituser', diff --git a/dev/tests/static/testsuite/Legacy/_files/obsolete_constants.php b/dev/tests/static/testsuite/Legacy/_files/obsolete_constants.php index e1e032a6140..b86e08dfe47 100644 --- a/dev/tests/static/testsuite/Legacy/_files/obsolete_constants.php +++ b/dev/tests/static/testsuite/Legacy/_files/obsolete_constants.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ return array( diff --git a/dev/tests/static/testsuite/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Legacy/_files/obsolete_methods.php index f220926ab8a..d34c02eb67c 100644 --- a/dev/tests/static/testsuite/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Legacy/_files/obsolete_methods.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ return array( diff --git a/dev/tests/static/testsuite/Legacy/_files/obsolete_properties.php b/dev/tests/static/testsuite/Legacy/_files/obsolete_properties.php index 42f2143ee3d..e56d77a1e51 100644 --- a/dev/tests/static/testsuite/Legacy/_files/obsolete_properties.php +++ b/dev/tests/static/testsuite/Legacy/_files/obsolete_properties.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ return array( diff --git a/dev/tests/static/testsuite/Php/Exemplar/CodeMessTest.php b/dev/tests/static/testsuite/Php/Exemplar/CodeMessTest.php index 39265f6542f..623be232521 100644 --- a/dev/tests/static/testsuite/Php/Exemplar/CodeMessTest.php +++ b/dev/tests/static/testsuite/Php/Exemplar/CodeMessTest.php @@ -18,10 +18,9 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento - * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @category tests + * @package static + * @copyright 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,7 +68,7 @@ class Php_Exemplar_CodeMessTest extends PHPUnit_Framework_TestCase $doc->load($rulesetFile); libxml_use_internal_errors(true); - $isValid = $doc->schemaValidate('http://pmd.sourceforge.net/ruleset_xml_schema.xsd'); + $isValid = $doc->schemaValidate(__DIR__ . '/_files/phpmd_ruleset.xsd'); $errors = "XML-file is invalid.\n"; if ($isValid === false) { foreach (libxml_get_errors() as $error) { @@ -93,24 +92,25 @@ class Php_Exemplar_CodeMessTest extends PHPUnit_Framework_TestCase /** * @param string $inputFile - * @param string $expectedReportFile + * @param string|array $expectedXpaths * @depends testRulesetFormat * @depends testPhpMdAvailability * @dataProvider ruleViolationDataProvider */ - public function testRuleViolation($inputFile, $expectedReportFile) + public function testRuleViolation($inputFile, $expectedXpaths) { $this->assertFalse(self::$_cmd->run( array($inputFile)), "PHP Mess Detector has failed to identify problem at the erroneous file {$inputFile}" ); - /* Cleanup report from the variable information */ - $actualReportXml = file_get_contents(self::$_cmd->getReportFile()); - $actualReportXml = preg_replace('/(?<!\?xml)\s+version=".+?"/', '', $actualReportXml, 1); - $actualReportXml = preg_replace('/\s+(?:timestamp|externalInfoUrl)=".+?"/', '', $actualReportXml); - $actualReportXml = str_replace(realpath($inputFile), basename($inputFile), $actualReportXml); - - $this->assertXmlStringEqualsXmlFile($expectedReportFile, $actualReportXml); + $actualReportXml = simplexml_load_file(self::$_cmd->getReportFile()); + $expectedXpaths = (array)$expectedXpaths; + foreach ($expectedXpaths as $expectedXpath) { + $this->assertNotEmpty( + $actualReportXml->xpath($expectedXpath), + "Expected xpath: '$expectedXpath' for file: '$inputFile'" + ); + } } /** @@ -118,59 +118,6 @@ class Php_Exemplar_CodeMessTest extends PHPUnit_Framework_TestCase */ public function ruleViolationDataProvider() { - return array( - 'cyclomatic complexity' => array( - __DIR__ . '/_files/phpmd/input/cyclomatic_complexity.php', - __DIR__ . '/_files/phpmd/output/cyclomatic_complexity.xml', - ), - 'method length' => array( - __DIR__ . '/_files/phpmd/input/method_length.php', - __DIR__ . '/_files/phpmd/output/method_length.xml', - ), - 'parameter list' => array( - __DIR__ . '/_files/phpmd/input/parameter_list.php', - __DIR__ . '/_files/phpmd/output/parameter_list.xml', - ), - 'method count' => array( - __DIR__ . '/_files/phpmd/input/method_count.php', - __DIR__ . '/_files/phpmd/output/method_count.xml', - ), - 'field count' => array( - __DIR__ . '/_files/phpmd/input/field_count.php', - __DIR__ . '/_files/phpmd/output/field_count.xml', - ), - 'public count' => array( - __DIR__ . '/_files/phpmd/input/public_count.php', - __DIR__ . '/_files/phpmd/output/public_count.xml', - ), - 'prohibited statement' => array( - __DIR__ . '/_files/phpmd/input/prohibited_statement.php', - __DIR__ . '/_files/phpmd/output/prohibited_statement.xml', - ), - 'prohibited statement goto' => array( - __DIR__ . '/_files/phpmd/input/prohibited_statement_goto.php', - __DIR__ . '/_files/phpmd/output/prohibited_statement_goto.xml', - ), - 'inheritance depth' => array( - __DIR__ . '/_files/phpmd/input/inheritance_depth.php', - __DIR__ . '/_files/phpmd/output/inheritance_depth.xml', - ), - 'descendant count' => array( - __DIR__ . '/_files/phpmd/input/descendant_count.php', - __DIR__ . '/_files/phpmd/output/descendant_count.xml', - ), - 'coupling' => array( - __DIR__ . '/_files/phpmd/input/coupling.php', - __DIR__ . '/_files/phpmd/output/coupling.xml', - ), - 'naming' => array( - __DIR__ . '/_files/phpmd/input/naming.php', - __DIR__ . '/_files/phpmd/output/naming.xml', - ), - 'unused' => array( - __DIR__ . '/_files/phpmd/input/unused.php', - __DIR__ . '/_files/phpmd/output/unused.xml', - ), - ); + return include(__DIR__ . '/_files/phpmd/data.php'); } } diff --git a/dev/tests/static/testsuite/Php/Exemplar/CodeStyleTest.php b/dev/tests/static/testsuite/Php/Exemplar/CodeStyleTest.php index fc73b0b586f..2b13aa68cf2 100644 --- a/dev/tests/static/testsuite/Php/Exemplar/CodeStyleTest.php +++ b/dev/tests/static/testsuite/Php/Exemplar/CodeStyleTest.php @@ -18,10 +18,9 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento - * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @category tests + * @package static + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/data.php b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/data.php new file mode 100644 index 00000000000..b3883be2bc0 --- /dev/null +++ b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/data.php @@ -0,0 +1,125 @@ +<?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 tests + * @package static + * @subpackage Legacy + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +return array( + 'cyclomatic complexity' => array( + __DIR__ . '/input/cyclomatic_complexity.php', + 'file/violation[@beginline=8 and @endline=40 and @rule="CyclomaticComplexity" and @ruleset="Code Size Rules" + and @package="+global" and @class="Foo" and @method="bar" and @priority=3]' + ), + 'method length' => array( + __DIR__ . '/input/method_length.php', + 'file/violation[@beginline=8 and @endline=107 and @rule="ExcessiveMethodLength" and @ruleset="Code Size Rules" + and @package="+global" and @class="Foo" and @method="bar" and @priority=3]', + ), + 'parameter list' => array( + __DIR__ . '/input/parameter_list.php', + 'file/violation[@beginline=8 and @endline=11 and @rule="ExcessiveParameterList" and @ruleset="Code Size Rules" + and @package="+global" and @class="Foo" and @method="bar" and @priority=3]', + ), + 'method count' => array( + __DIR__ . '/input/method_count.php', + 'file/violation[@beginline=6 and @endline=116 and @rule="TooManyMethods" and @ruleset="Code Size Rules" + and @package="+global" and @class="Foo" and @priority=3]', + ), + 'field count' => array( + __DIR__ . '/input/field_count.php', + 'file/violation[@beginline=6 and @endline=29 and @rule="TooManyFields" and @ruleset="Code Size Rules" + and @package="+global" and @class="Foo" and @priority=3]', + ), + 'public count' => array( + __DIR__ . '/input/public_count.php', + 'file/violation[@beginline=11 and @endline=58 and @rule="ExcessivePublicCount" and @ruleset="Code Size Rules" + and @package="+global" and @class="Foo" and @priority=3]', + ), + 'prohibited statement' => array( + __DIR__ . '/input/prohibited_statement.php', + array( + 'file/violation[@beginline=7 and @endline=7 and @rule="ExitExpression" and @ruleset="Design Rules" + and @priority=1]', + 'file/violation[@beginline=12 and @endline=12 and @rule="EvalExpression" and @ruleset="Design Rules" + and @priority=1]', + ), + ), + 'prohibited statement goto' => array( + __DIR__ . '/input/prohibited_statement_goto.php', + 'file/violation[@beginline=10 and @endline=10 and @rule="GotoStatement" and @ruleset="Design Rules" + and @priority=1]', + ), + 'inheritance depth' => array( + __DIR__ . '/input/inheritance_depth.php', + 'file/violation[@beginline=15 and @endline=15 and @rule="DepthOfInheritance" and @ruleset="Design Rules" + and @package="+global" and @class="Foo07" and @priority=2]', + ), + 'descendant count' => array( + __DIR__ . '/input/descendant_count.php', + 'file/violation[@beginline=3 and @endline=3 and @rule="NumberOfChildren" and @ruleset="Design Rules" + and @package="+global" and @class="Foo01" and @priority=2]', + ), + 'coupling' => array( + __DIR__ . '/input/coupling.php', + 'file/violation[@beginline=19 and @endline=78 and @rule="CouplingBetweenObjects" and @ruleset="Design Rules" + and @package="+global" and @class="Foo" and @priority=2]', + ), + 'naming' => array( + __DIR__ . '/input/naming.php', + array( + 'file/violation[@beginline=5 and @endline=5 and @rule="ConstantNamingConventions" + and @ruleset="Naming Rules" and @priority=4]', + 'file/violation[@beginline=11 and @endline=11 and @rule="ShortVariable" and @ruleset="Naming Rules" + and @priority=3]', + 'file/violation[@beginline=13 and @endline=13 and @rule="LongVariable" and @ruleset="Naming Rules" + and @priority=3]', + 'file/violation[@beginline=18 and @endline=18 and @rule="ConstructorWithNameAsEnclosingClass" + and @ruleset="Naming Rules" and @class="Foo" and @method="Foo" and @priority=3]', + 'file/violation[@beginline=20 and @endline=20 and @rule="ShortVariable" and @ruleset="Naming Rules" + and @priority=3]', + 'file/violation[@beginline=20 and @endline=20 and @rule="LongVariable" and @ruleset="Naming Rules" + and @priority=3]', + 'file/violation[@beginline=22 and @endline=22 and @rule="ShortVariable" and @ruleset="Naming Rules" + and @priority=3]', + 'file/violation[@beginline=23 and @endline=23 and @rule="LongVariable" and @ruleset="Naming Rules" + and @priority=3]', + 'file/violation[@beginline=30 and @endline=30 and @rule="ShortMethodName" and @ruleset="Naming Rules" + and @package="+global" and @class="Foo" and @method="_x" and @priority=3]', + 'file/violation[@beginline=36 and @endline=39 and @rule="BooleanGetMethodName" and @ruleset="Naming Rules" + and @package="+global" and @class="Foo" and @method="getBoolValue" and @priority=4]', + ), + ), + 'unused' => array( + __DIR__ . '/input/unused.php', + array( + 'file/violation[@beginline=5 and @endline=5 and @rule="UnusedPrivateField" and @ruleset="Unused Code Rules" + and @priority=3]', + 'file/violation[@beginline=7 and @endline=7 and @rule="UnusedPrivateMethod" and @ruleset="Unused Code Rules" + and @package="+global" and @class="Foo" and @method="_unusedMethod" and @priority=3]', + 'file/violation[@beginline=9 and @endline=9 and @rule="UnusedFormalParameter" + and @ruleset="Unused Code Rules" and @priority=3]', + 'file/violation[@beginline=11 and @endline=11 and @rule="UnusedLocalVariable" + and @ruleset="Unused Code Rules" and @priority=3]', + ), + ), +); diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/coupling.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/coupling.xml deleted file mode 100644 index 4c08cf79286..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/coupling.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="coupling.php"> - <violation beginline="19" endline="78" rule="CouplingBetweenObjects" ruleset="Design Rules" package="+global" class="Foo" priority="2"> - The class Foo has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/cyclomatic_complexity.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/cyclomatic_complexity.xml deleted file mode 100644 index 8e4ce0b529c..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/cyclomatic_complexity.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="cyclomatic_complexity.php"> - <violation beginline="8" endline="40" rule="CyclomaticComplexity" ruleset="Code Size Rules" package="+global" class="Foo" method="bar" priority="3"> - The method bar() has a Cyclomatic Complexity of 10. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/descendant_count.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/descendant_count.xml deleted file mode 100644 index c3c0a54ae4c..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/descendant_count.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="descendant_count.php"> - <violation beginline="3" endline="3" rule="NumberOfChildren" ruleset="Design Rules" package="+global" class="Foo01" priority="2"> - The class Foo01 has 15 children. Consider to rebalance this class hierarchy. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/field_count.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/field_count.xml deleted file mode 100644 index 5d0c0dd935a..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/field_count.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="field_count.php"> - <violation beginline="6" endline="29" rule="TooManyFields" ruleset="Code Size Rules" package="+global" class="Foo" priority="3"> - Too many fields - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/inheritance_depth.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/inheritance_depth.xml deleted file mode 100644 index f0db5d63d97..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/inheritance_depth.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="inheritance_depth.php"> - <violation beginline="15" endline="15" rule="DepthOfInheritance" ruleset="Design Rules" package="+global" class="Foo07" priority="2"> - The class Foo07 has 6 parents. Consider to reduce the depth of this class hierarchy. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_count.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_count.xml deleted file mode 100644 index aa401ab28ae..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_count.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="method_count.php"> - <violation beginline="6" endline="116" rule="TooManyMethods" ruleset="Code Size Rules" package="+global" class="Foo" priority="3"> - This class has too many methods, consider refactoring it. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_length.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_length.xml deleted file mode 100644 index c54238a0e2f..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_length.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="method_length.php"> - <violation beginline="8" endline="107" rule="ExcessiveMethodLength" ruleset="Code Size Rules" package="+global" class="Foo" method="bar" priority="3"> - Avoid really long methods. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/naming.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/naming.xml deleted file mode 100644 index 716948efe78..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/naming.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="naming.php"> - <violation beginline="5" endline="5" rule="ConstantNamingConventions" ruleset="Naming Rules" priority="4"> - Constant nonUppercaseName should be defined in uppercase - </violation> - <violation beginline="11" endline="11" rule="ShortVariable" ruleset="Naming Rules" priority="3"> - Avoid variables with short names like $_a - </violation> - <violation beginline="13" endline="13" rule="LongVariable" ruleset="Naming Rules" priority="3"> - Avoid excessively long variable names like $_tooLongPropertyName1 - </violation> - <violation beginline="18" endline="18" rule="ConstructorWithNameAsEnclosingClass" ruleset="Naming Rules" package="+global" class="Foo" method="Foo" priority="3"> - Classes should not have a constructor method with the same name as the class - </violation> - <violation beginline="20" endline="20" rule="ShortVariable" ruleset="Naming Rules" priority="3"> - Avoid variables with short names like $a1 - </violation> - <violation beginline="20" endline="20" rule="LongVariable" ruleset="Naming Rules" priority="3"> - Avoid excessively long variable names like $tooLongParameterName2 - </violation> - <violation beginline="22" endline="22" rule="ShortVariable" ruleset="Naming Rules" priority="3"> - Avoid variables with short names like $a2 - </violation> - <violation beginline="23" endline="23" rule="LongVariable" ruleset="Naming Rules" priority="3"> - Avoid excessively long variable names like $tooLongLocalVariable3 - </violation> - <violation beginline="30" endline="30" rule="ShortMethodName" ruleset="Naming Rules" package="+global" class="Foo" method="_x" priority="3"> - Avoid using short method names like Foo::_x() - </violation> - <violation beginline="36" endline="39" rule="BooleanGetMethodName" ruleset="Naming Rules" package="+global" class="Foo" method="getBoolValue" priority="4"> - The 'getBoolValue()' method which returns a boolean should be named 'is...()' or 'has...()' - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/parameter_list.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/parameter_list.xml deleted file mode 100644 index 10b56ec540b..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/parameter_list.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="parameter_list.php"> - <violation beginline="8" endline="11" rule="ExcessiveParameterList" ruleset="Code Size Rules" package="+global" class="Foo" method="bar" priority="3"> - Avoid really long parameter lists. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement.xml deleted file mode 100644 index e41a5a4b76a..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="prohibited_statement.php"> - <violation beginline="7" endline="7" rule="ExitExpression" ruleset="Design Rules" priority="1"> - The method terminateApplication() contains an exit expression. - </violation> - <violation beginline="12" endline="12" rule="EvalExpression" ruleset="Design Rules" priority="1"> - The method evaluateExpression() contains an eval expression. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement_goto.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement_goto.xml deleted file mode 100644 index ecd423d8a02..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement_goto.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="prohibited_statement_goto.php"> - <violation beginline="10" endline="10" rule="GotoStatement" ruleset="Design Rules" priority="1"> - The method loopArrayCallback() utilizes a goto statement. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/public_count.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/public_count.xml deleted file mode 100644 index c3f45ca379e..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/public_count.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="public_count.php"> - <violation beginline="11" endline="58" rule="ExcessivePublicCount" ruleset="Code Size Rules" package="+global" class="Foo" priority="3"> - This class has a bunch of public methods and attributes - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/unused.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/unused.xml deleted file mode 100644 index b6104d30132..00000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/unused.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="unused.php"> - <violation beginline="5" endline="5" rule="UnusedPrivateField" ruleset="Unused Code Rules" priority="3"> - Avoid unused private fields such as '$_unusedField'. - </violation> - <violation beginline="7" endline="7" rule="UnusedPrivateMethod" ruleset="Unused Code Rules" package="+global" class="Foo" method="_unusedMethod" priority="3"> - Avoid unused private methods such as '_unusedMethod'. - </violation> - <violation beginline="9" endline="9" rule="UnusedFormalParameter" ruleset="Unused Code Rules" priority="3"> - Avoid unused parameters such as '$unusedParameter'. - </violation> - <violation beginline="11" endline="11" rule="UnusedLocalVariable" ruleset="Unused Code Rules" priority="3"> - Avoid unused local variables such as '$unusedLocalVariable'. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd_ruleset.xsd b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd_ruleset.xsd new file mode 100644 index 00000000000..cd8830c85e8 --- /dev/null +++ b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd_ruleset.xsd @@ -0,0 +1,132 @@ +<?xml version="1.0"?> +<!-- +/** + * XML-schema for validating rulesets for PHP Mess Detector + * + * Copyright (c) 2002-2009, InfoEther, Inc + * All rights reserved. + * + * Redistribution and use 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. + * * The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed in part by support from + * the Defense Advanced Research Project Agency (DARPA)" + * * Neither the name of InfoEther, LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * 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. + * + * @link http://pmd.sourceforge.net/ruleset_xml_schema.xsd + * @license http://pmd.sourceforge.net/license.html + */ +--> +<xs:schema + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns="http://pmd.sf.net/ruleset/1.0.0" + targetNamespace="http://pmd.sf.net/ruleset/1.0.0" + elementFormDefault="qualified"> + + <xs:element name="ruleset"> + <xs:complexType> + <xs:sequence> + <xs:element ref="description" minOccurs="1" maxOccurs="1" /> + <xs:element ref="exclude-pattern" minOccurs="0" maxOccurs="unbounded" /> + <xs:element ref="include-pattern" minOccurs="0" maxOccurs="unbounded" /> + <xs:element ref="rule" minOccurs="1" maxOccurs="unbounded" /> + </xs:sequence> + <xs:attribute name="name" type="xs:string" use="required" /> + <xs:attribute name="language" type="xs:string" use="optional"> + <xs:annotation> + <xs:documentation source="version">1.0.0+</xs:documentation> + <xs:documentation source="description"> + Language on which this ruleset applies; + e.g. "java" (default), "jsp" + </xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + </xs:element> + + <xs:element name="description" type="xs:string"> + </xs:element> + + <xs:element name="include-pattern" type="xs:string"> + </xs:element> + + <xs:element name="exclude-pattern" type="xs:string"> + </xs:element> + + <xs:element name="rule"> + <xs:complexType> + <xs:sequence> + <xs:element ref="description" minOccurs="0" maxOccurs="1" /> + <xs:element ref="priority" minOccurs="0" maxOccurs="1"/> + <xs:element ref="properties" minOccurs="0" maxOccurs="1" /> + <xs:element ref="exclude" minOccurs="0" maxOccurs="unbounded" /> + <xs:element ref="example" minOccurs="0" maxOccurs="unbounded" /> + </xs:sequence> + <xs:attribute name="name" type="xs:ID" use="optional" /> + <xs:attribute name="since" type="xs:string" use="optional" /> + <xs:attribute name="ref" type="xs:string" use="optional" /> + <xs:attribute name="message" type="xs:string" use="optional" /> + <xs:attribute name="externalInfoUrl" type="xs:string" use="optional" /> + <xs:attribute name="class" type="xs:NMTOKEN" use="optional" /> + <xs:attribute name="dfa" type="xs:boolean" use="optional" /> <!-- rule uses dataflow analysis --> + <xs:attribute name="typeResolution" type="xs:boolean" default="false" use="optional" /> + </xs:complexType> + </xs:element> + + <xs:element name="example" type="xs:string"/> + + <!-- Default priority is the lowest --> + <xs:element name="priority" type="xs:int" default="5"/> + + <xs:element name="properties"> + <xs:complexType> + <xs:sequence> + <xs:element ref="property" minOccurs="1" maxOccurs="unbounded" /> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="property"> + <xs:complexType> + <xs:sequence> + <xs:element ref="value" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + <xs:attribute name="name" type="xs:NMTOKEN" use="required" /> + <xs:attribute name="value" type="xs:string" use="optional" /> + <xs:attribute name="description" type="xs:string" use="optional" /> + <xs:attribute name="pluginname" type="xs:NMTOKEN" use="optional" /> + </xs:complexType> + </xs:element> + + <xs:element name="value" type="xs:string"> + </xs:element> + + <xs:element name="exclude"> + <xs:complexType> + <xs:attribute name="name" type="xs:NMTOKEN" use="required" /> + </xs:complexType> + </xs:element> + +</xs:schema> diff --git a/dev/tests/static/testsuite/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Php/LiveCodeTest.php index ac6418e6a61..2795c4746ff 100644 --- a/dev/tests/static/testsuite/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Php/LiveCodeTest.php @@ -18,10 +18,9 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento - * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @category tests + * @package static + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/static/testsuite/Php/_files/phpcs/ruleset.xml b/dev/tests/static/testsuite/Php/_files/phpcs/ruleset.xml index 861def00070..9b33ba16588 100644 --- a/dev/tests/static/testsuite/Php/_files/phpcs/ruleset.xml +++ b/dev/tests/static/testsuite/Php/_files/phpcs/ruleset.xml @@ -19,9 +19,9 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @category tests + * @package static + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/static/testsuite/Php/_files/phpmd/ruleset.xml b/dev/tests/static/testsuite/Php/_files/phpmd/ruleset.xml index a77945522fb..16b04b46702 100644 --- a/dev/tests/static/testsuite/Php/_files/phpmd/ruleset.xml +++ b/dev/tests/static/testsuite/Php/_files/phpmd/ruleset.xml @@ -19,10 +19,10 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category tests - * @package static - * @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) + * @category tests + * @package static + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <ruleset name="Magento PHPMD rule set" xmlns="http://pmd.sf.net/ruleset/1.0.0" diff --git a/dev/tests/static/testsuite/Util/Classes.php b/dev/tests/static/testsuite/Util/Classes.php new file mode 100644 index 00000000000..b8e341538e3 --- /dev/null +++ b/dev/tests/static/testsuite/Util/Classes.php @@ -0,0 +1,154 @@ +<?php +/** + * A helper for handling Magento-specific class names in various use cases + * + * 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 tests + * @package static + * @copyright 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 Util_Classes +{ + /** + * Find all unique matches in specified content using specified PCRE + * + * @param string $contents + * @param string $regex + * @param array &$result + * @return array + */ + public static function getAllMatches($contents, $regex, &$result = array()) + { + preg_match_all($regex, $contents, $matches); + + array_shift($matches); + foreach ($matches as $row) { + $result = array_merge($result, $row); + } + $result = array_filter(array_unique($result), function($value) { + return !empty($value); + }); + return $result; + } + + /** + * Get XML node text values or values of specified attribute using specified xPath + * + * The node must contain specified attribute + * + * @param SimpleXMLElement $xml + * @param string $xPath + * @return array + */ + public static function getXmlNodeValues(SimpleXMLElement $xml, $xPath) + { + $result = array(); + $nodes = $xml->xpath($xPath) ?: array(); + foreach ($nodes as $node) { + $result[] = (string)$node; + } + return $result; + } + + /** + * Get XML node attribute values using specified xPath + * + * @param SimpleXMLElement $xml + * @param string $xPath + * @param string $attributeName + * @return array + */ + public static function getXmlAttributeValues(SimpleXMLElement $xml, $xPath, $attributeName) + { + $result = array(); + $nodes = $xml->xpath($xPath) ?: array(); + foreach ($nodes as $node) { + $node = (array)$node; + if (isset($node['@attributes'][$attributeName])) { + $result[] = $node['@attributes'][$attributeName]; + } + } + return $result; + } + + /** + * Extract class name from a conventional callback specification "Class::method" + * + * @param string $callbackName + * @return string + */ + public static function getCallbackClass($callbackName) + { + $class = explode('::', $callbackName); + return $class[0]; + } + + /** + * Find classes in a configuration XML-file (assumes any files under Namespace/Module/etc/*.xml) + * + * @param SimpleXMLElement $xml + * @return array + */ + public static function collectClassesInConfig(SimpleXMLElement $xml) + { + $classes = self::getXmlNodeValues($xml, ' + /config//resource_adapter | /config/*[not(name()="sections")]//class | //model + | //backend_model | //source_model | //price_model | //model_token | //writer_model | //clone_model + | //frontend_model | //admin_renderer | //renderer' + ); + $classes = array_merge($classes, self::getXmlAttributeValues($xml, '//@backend_model', 'backend_model')); + $nodes = $xml->xpath('/logging/*/expected_models/* | /logging/*/actions/*/expected_models/*') ?: array(); + foreach ($nodes as $node) { + $classes[] = $node->getName(); + } + + $classes = array_map(array('Util_Classes', 'getCallbackClass'), $classes); + $classes = array_map('trim', $classes); + $classes = array_unique($classes); + $classes = array_filter($classes, function ($value) { + return !empty($value); + }); + + return $classes; + } + + /** + * Find classes in a layout configuration XML-file + * + * @param SimpleXMLElement $xml + * @return array + */ + public static function collectLayoutClasses(SimpleXMLElement $xml) + { + $classes = self::getXmlAttributeValues($xml, '/layout//block[@type]', 'type'); + $classes = array_merge($classes, self::getXmlNodeValues($xml, + '/layout//action/attributeType | /layout//action[@method="addTab"]/content + | /layout//action[@method="addRenderer" or @method="addItemRender" or @method="addColumnRender" + or @method="addPriceBlockType" or @method="addMergeSettingsBlockType" + or @method="addInformationRenderer" or @method="addOptionRenderer" or @method="addRowItemRender" + or @method="addDatabaseBlock"]/*[2] + | /layout//action[@method="setMassactionBlockName" or @method="addProductConfigurationHelper"]/name + | /layout//action[@method="setEntityModelClass"]/code' + )); + return array_unique($classes); + } +} diff --git a/dev/tests/static/testsuite/FileDataProvider.php b/dev/tests/static/testsuite/Util/Files.php similarity index 97% rename from dev/tests/static/testsuite/FileDataProvider.php rename to dev/tests/static/testsuite/Util/Files.php index 01d302baccf..b3caf9ba871 100644 --- a/dev/tests/static/testsuite/FileDataProvider.php +++ b/dev/tests/static/testsuite/Util/Files.php @@ -1,5 +1,7 @@ <?php /** + * A helper to gather specific kinds if files in Magento application + * * Magento * * NOTICE OF LICENSE @@ -20,15 +22,10 @@ * * @category tests * @package static - * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * One time iterator to gather fiels in our system - */ -final class FileDataProvider +class Util_Files { /** * In-memory cache for the data sets @@ -95,7 +92,7 @@ final class FileDataProvider * * @param string $fileNamePattern * @param array $excludedFileNames - * @return array|bool + * @return array */ public static function getConfigFiles( $fileNamePattern = '*.xml', $excludedFileNames = array('wsdl.xml', 'wsdl2.xml', 'wsi.xml') diff --git a/dev/tests/unit/framework/bootstrap.php b/dev/tests/unit/framework/bootstrap.php index 305c19b8f0b..2231f660c22 100755 --- a/dev/tests/unit/framework/bootstrap.php +++ b/dev/tests/unit/framework/bootstrap.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/phpunit.xml.dist b/dev/tests/unit/phpunit.xml.dist index 0590ba7f8f7..9799a5ecb8f 100755 --- a/dev/tests/unit/phpunit.xml.dist +++ b/dev/tests/unit/phpunit.xml.dist @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/AllTests.php b/dev/tests/unit/testsuite/AllTests.php index 089bf36fa68..0775f1c2edd 100755 --- a/dev/tests/unit/testsuite/AllTests.php +++ b/dev/tests/unit/testsuite/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php b/dev/tests/unit/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php similarity index 76% rename from dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php rename to dev/tests/unit/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php index e54d175175a..e51e5d846f3 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php +++ b/dev/tests/unit/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 @@ class Mage_Catalog_Model_Layer_Filter_Price_AlgorithmTest extends PHPUnit_Framew */ public function testPricesSegmentation($prices, $intervalsNumber, $intervalItems) { - $this->_model->setPrices($prices); + $this->_model->setLimits()->setPrices($prices); if (!is_null($intervalsNumber)) { $this->assertEquals($intervalsNumber, $this->_model->getIntervalsNumber()); } @@ -68,4 +68,19 @@ class Mage_Catalog_Model_Layer_Filter_Price_AlgorithmTest extends PHPUnit_Framew { return include(__DIR__ . '/_files/_algorithm_data.php'); } + + public function testPriceLimits() + { + $this->_model->setLimits()->setPrices(array(5, 10, 15, 20, 50, 100, 150)); + $this->assertEquals(array( + 0 => array('from' => 0, 'to' => 20, 'count' => 3), + 1 => array('from' => 20, 'to' => '', 'count' => 4) + ), $this->_model->calculateSeparators()); + + $this->_model->setLimits(10, 100); + $this->assertEquals(array( + 0 => array('from' => 10, 'to' => 20, 'count' => 2), + 1 => array('from' => 20, 'to' => 100, 'count' => 2) + ), $this->_model->calculateSeparators()); + } } diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php b/dev/tests/unit/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php similarity index 74% rename from dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php rename to dev/tests/unit/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php index 6e186b469c4..6e262c13a0f 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php +++ b/dev/tests/unit/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 @@ $testCases = array( ), // test if best rounding factor is used array( - array(10.19, 10.21, 10.2, 10.2, 10.2), + array(10.19, 10.2, 10.2, 10.2, 10.21), 2, array( array( @@ -82,7 +82,7 @@ $testCases = array( ), // test if best rounding factor is used array( - array(10.18, 10.2, 10.19, 10.19, 10.19), + array(10.18, 10.19, 10.19, 10.19, 10.2), 2, array( array( @@ -97,9 +97,79 @@ $testCases = array( ), ) ), + // test preventing low count in interval and rounding factor to have lower priority + array( + array( + 0.01, 0.01, 0.01, 0.02, 0.02, 0.03, 0.03, 0.04, 0.04, 0.04, + 0.05, 0.05, 0.05, 0.06, 0.06, 0.06, 0.06, 0.07, 0.07, 0.08, 0.08, + 2.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 13.50, + 15.99, 41.95, 69.99, 89.99, 99.99, 99.99, 160.99, 161.94, + 199.99, 199.99, 199.99, 239.99, 329.99, 447.98, 550.00, 599.99, + 699.99, 750.00, 847.97, 1599.99, 2699.99, 4999.95 + ), 7, array( + array( + 'from' => 0, + 'to' => 0.05, + 'count' => 10, + ), + // this is important, that not 0.06 is used to prevent low count in interval + array( + 'from' => 0.05, + 'to' => 0.07, + 'count' => 7, + ), + array( + 'from' => 0.07, + 'to' => 5, + 'count' => 5, + ), + array( + 'from' => 5.99, + 'to' => 5.99, + 'count' => 9, + ), + array( + 'from' => 10, + 'to' => 100, + 'count' => 7, + ), + array( + 'from' => 100, + 'to' => 500, + 'count' => 8, + ), + array( + 'from' => 500, + 'to' => '', + 'count' => 8, + ), + ) + ), // test with large values (variance is near to zero) array( - array_merge(array(8997.71, 8997.73), array_fill(0, 291, 8997.72)), + array_merge(array(9659.57), array_fill(0, 231, 9659.58), array(9659.59)), + 10, + array( + array( + 'from' => 9659.57, + 'to' => 9659.57, + 'count' => 1, + ), + array( + 'from' => 9659.58, + 'to' => 9659.58, + 'count' => 231, + ), + array( + 'from' => 9659.59, + 'to' => 9659.59, + 'count' => 1, + ), + ) + ), + // another test with large values (variance is near to zero) + array( + array_merge(array(8997.71), array_fill(0, 291, 8997.72), array(8997.73)), 10, array( array( @@ -190,8 +260,8 @@ $testCases = array( // simple test array( array( - 199.99, 99.99, 550, 329.99, 199.99, 99.99, 599.99, 41.95, 69.99, 89.99, 239.99, - 161.94, 160.99, 699.99, 199.99, 750, 1599.99, 2699.99, 13.5, 4999.95, 447.98, 847.97 + 13.5, 41.95, 69.99, 89.99, 99.99, 99.99, 160.99, 161.94, 199.99, 199.99, 199.99, + 239.99, 329.99, 447.98, 550, 599.99, 699.99, 750, 847.97, 1599.99, 2699.99, 4999.95 ), 4, array( array( 'from' => 0, @@ -289,11 +359,11 @@ for ($i = 0; $i < 50; ++$i) { ), // one price is bigger than others array( - array_merge(array($randomPrice1), array_fill( + array_merge(array_fill( 0, $randomCount, $randomPrice - )), + ), array($randomPrice1)), null, array( array( @@ -310,14 +380,13 @@ for ($i = 0; $i < 50; ++$i) { ), // one price is less and one is bigger than others array( - array_merge(array( - $randomPrice, - $randomPrice2 - ), array_fill( - 0, - $randomCount1, - $randomPrice1 - )), + array_merge( + array($randomPrice), array_fill( + 0, + $randomCount1, + $randomPrice1 + ), array($randomPrice2) + ), null, array( array( diff --git a/dev/tests/unit/testsuite/Magento/AllTests.php b/dev/tests/unit/testsuite/Magento/AllTests.php index cbb1a964461..1549b2f6a92 100755 --- a/dev/tests/unit/testsuite/Magento/AllTests.php +++ b/dev/tests/unit/testsuite/Magento/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Autoload/Ns/TestClass.php b/dev/tests/unit/testsuite/Magento/Autoload/Ns/TestClass.php index cbfbe27d7f2..a137f1358ee 100644 --- a/dev/tests/unit/testsuite/Magento/Autoload/Ns/TestClass.php +++ b/dev/tests/unit/testsuite/Magento/Autoload/Ns/TestClass.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Autoload/TestClass.php b/dev/tests/unit/testsuite/Magento/Autoload/TestClass.php index 76c8c9a19ee..cad6cf57d86 100644 --- a/dev/tests/unit/testsuite/Magento/Autoload/TestClass.php +++ b/dev/tests/unit/testsuite/Magento/Autoload/TestClass.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Autoload/TestClassExists.php b/dev/tests/unit/testsuite/Magento/Autoload/TestClassExists.php index 05d9098a7b2..bd7d4ac74e5 100644 --- a/dev/tests/unit/testsuite/Magento/Autoload/TestClassExists.php +++ b/dev/tests/unit/testsuite/Magento/Autoload/TestClassExists.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Autoload/TestClassMapInFile.php b/dev/tests/unit/testsuite/Magento/Autoload/TestClassMapInFile.php index d708d3ba1fc..a74b13fd69b 100644 --- a/dev/tests/unit/testsuite/Magento/Autoload/TestClassMapInFile.php +++ b/dev/tests/unit/testsuite/Magento/Autoload/TestClassMapInFile.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Autoload/TestMap.php b/dev/tests/unit/testsuite/Magento/Autoload/TestMap.php index c8bb524f10e..f66b484ce87 100644 --- a/dev/tests/unit/testsuite/Magento/Autoload/TestMap.php +++ b/dev/tests/unit/testsuite/Magento/Autoload/TestMap.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/AutoloadTest.php b/dev/tests/unit/testsuite/Magento/AutoloadTest.php index 04b4899dabb..31475445fe3 100644 --- a/dev/tests/unit/testsuite/Magento/AutoloadTest.php +++ b/dev/tests/unit/testsuite/Magento/AutoloadTest.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 @@ class Magento_AutoloadTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception */ public function testAddFilesMapWrongFile() { @@ -114,7 +114,7 @@ class Magento_AutoloadTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception */ public function testAddFilesMapWrongParam() { diff --git a/dev/tests/unit/testsuite/Magento/Config/AllTests.php b/dev/tests/unit/testsuite/Magento/Config/AllTests.php index f15a4edbac3..e63a290e257 100644 --- a/dev/tests/unit/testsuite/Magento/Config/AllTests.php +++ b/dev/tests/unit/testsuite/Magento/Config/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Config/DomTest.php b/dev/tests/unit/testsuite/Magento/Config/DomTest.php index 2054f362457..82aeab87931 100644 --- a/dev/tests/unit/testsuite/Magento/Config/DomTest.php +++ b/dev/tests/unit/testsuite/Magento/Config/DomTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -67,7 +67,7 @@ class Magento_Config_DomTest extends PHPUnit_Framework_TestCase * @param string $xmlFile * @param string $newXmlFile * @dataProvider mergeExceptionDataProvider - * @expectedException Exception + * @expectedException Magento_Exception */ public function testMergeException($xmlFile, $newXmlFile) { diff --git a/dev/tests/unit/testsuite/Magento/Config/ThemeTest.php b/dev/tests/unit/testsuite/Magento/Config/ThemeTest.php index d9867349526..edd6f7a1558 100644 --- a/dev/tests/unit/testsuite/Magento/Config/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/Config/ThemeTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 +38,7 @@ class Magento_Config_ThemeTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception */ public function testConstructException() { @@ -99,7 +99,7 @@ class Magento_Config_ThemeTest extends PHPUnit_Framework_TestCase /** * @dataProvider getCompatibleVersionsExceptionDataProvider - * @expectedException Exception + * @expectedException Magento_Exception */ public function testGetCompatibleVersionsException($package, $theme) { diff --git a/dev/tests/unit/testsuite/Magento/Config/ViewTest.php b/dev/tests/unit/testsuite/Magento/Config/ViewTest.php index 987f7d69f1b..342c7b3d57a 100644 --- a/dev/tests/unit/testsuite/Magento/Config/ViewTest.php +++ b/dev/tests/unit/testsuite/Magento/Config/ViewTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Config/XsdTest.php b/dev/tests/unit/testsuite/Magento/Config/XsdTest.php index bff797f368c..738ae1d60be 100644 --- a/dev/tests/unit/testsuite/Magento/Config/XsdTest.php +++ b/dev/tests/unit/testsuite/Magento/Config/XsdTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_merged.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_merged.xml index 091f4d861ee..4fd97f1b5b7 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_merged.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_merged.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_one.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_one.xml index 091f4d861ee..4fd97f1b5b7 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_one.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_one.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_two.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_two.xml index d33ad29000d..6cec05a21f2 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_two.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_two.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_one.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_one.xml index 97dd42ad6d8..fbe1a6b73d7 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_one.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_one.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_two.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_two.xml index c342817c560..4416643a47a 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_two.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_two.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids.xml index acad2c19cb6..0bcc4e58460 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_merged.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_merged.xml index 6ad736d3cb5..0a9d5ae17ef 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_merged.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_merged.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_new.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_new.xml index 5d53c7c7b51..91ad6d7772b 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_new.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_new.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids.xml index 4a21c41a653..d573788c8bf 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_merged.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_merged.xml index eceb88cf4cc..e15f99a3c60 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_merged.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_merged.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_new.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_new.xml index 504d87e235f..7a3432cb702 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_new.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_new.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/default/theme.xml b/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/default/theme.xml index b265c884ea2..bffc8a3722f 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/default/theme.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/default/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test/theme.xml b/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test/theme.xml index 219d2e0c1df..dcb20cf5a0a 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test/theme.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test2/theme.xml b/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test2/theme.xml index 9e4adee857e..7fb5f811033 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test2/theme.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test2/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/packages/test/default/theme.xml b/dev/tests/unit/testsuite/Magento/Config/_files/packages/test/default/theme.xml index effccc4e009..675a2e4d6b1 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/packages/test/default/theme.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/packages/test/default/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/sample.xsd b/dev/tests/unit/testsuite/Magento/Config/_files/sample.xsd index 077a406d4dd..ffbdf289d60 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/sample.xsd +++ b/dev/tests/unit/testsuite/Magento/Config/_files/sample.xsd @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/theme_invalid.xml b/dev/tests/unit/testsuite/Magento/Config/_files/theme_invalid.xml index a97319f557b..38b9a6bba30 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/theme_invalid.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/theme_invalid.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/view_invalid.xml b/dev/tests/unit/testsuite/Magento/Config/_files/view_invalid.xml index a6cbe5cffd8..e58f7107f41 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/view_invalid.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/view_invalid.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/view_one.xml b/dev/tests/unit/testsuite/Magento/Config/_files/view_one.xml index c52162289b7..330dd70487f 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/view_one.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/view_one.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/view_two.xml b/dev/tests/unit/testsuite/Magento/Config/_files/view_two.xml index f3a6f8a01f5..4bba445d376 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/view_two.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/view_two.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Convert/AllTests.php b/dev/tests/unit/testsuite/Magento/Convert/AllTests.php index 42b85c03ec8..9f59d4a9b37 100644 --- a/dev/tests/unit/testsuite/Magento/Convert/AllTests.php +++ b/dev/tests/unit/testsuite/Magento/Convert/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Convert * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Convert/ExcelTest.php b/dev/tests/unit/testsuite/Magento/Convert/ExcelTest.php index a6b03d41c44..0981fc3ff8f 100644 --- a/dev/tests/unit/testsuite/Magento/Convert/ExcelTest.php +++ b/dev/tests/unit/testsuite/Magento/Convert/ExcelTest.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Crypt/_files/_cipher_info.php b/dev/tests/unit/testsuite/Magento/Crypt/_files/_cipher_info.php index da6454a7323..08c5738b025 100755 --- a/dev/tests/unit/testsuite/Magento/Crypt/_files/_cipher_info.php +++ b/dev/tests/unit/testsuite/Magento/Crypt/_files/_cipher_info.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/dev/tests/unit/testsuite/Magento/Crypt/_files/_crypt_fixtures.php b/dev/tests/unit/testsuite/Magento/Crypt/_files/_crypt_fixtures.php index c0958273809..3bab6723b5d 100755 --- a/dev/tests/unit/testsuite/Magento/Crypt/_files/_crypt_fixtures.php +++ b/dev/tests/unit/testsuite/Magento/Crypt/_files/_crypt_fixtures.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/dev/tests/unit/testsuite/Magento/CryptTest.php b/dev/tests/unit/testsuite/Magento/CryptTest.php index fa5ce95c3a8..8bc511dd95a 100755 --- a/dev/tests/unit/testsuite/Magento/CryptTest.php +++ b/dev/tests/unit/testsuite/Magento/CryptTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Crypt * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/AllTests.php b/dev/tests/unit/testsuite/Magento/Profiler/AllTests.php index b4c058044b3..3fb0c4e4941 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/AllTests.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/Output/AllTests.php b/dev/tests/unit/testsuite/Magento/Profiler/Output/AllTests.php index e10ea3ebaf8..05fdab33e08 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/Output/AllTests.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/Output/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/Output/CsvfileTest.php b/dev/tests/unit/testsuite/Magento/Profiler/Output/CsvfileTest.php index 434698f3ed3..65e660d4b4f 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/Output/CsvfileTest.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/Output/CsvfileTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/Output/FirebugTest.php b/dev/tests/unit/testsuite/Magento/Profiler/Output/FirebugTest.php index 1ec32bafc8a..afa998c77e1 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/Output/FirebugTest.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/Output/FirebugTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/Output/HtmlTest.php b/dev/tests/unit/testsuite/Magento/Profiler/Output/HtmlTest.php index b88dedbf114..7c821c42d86 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/Output/HtmlTest.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/Output/HtmlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/OutputAbstractTest.php b/dev/tests/unit/testsuite/Magento/Profiler/OutputAbstractTest.php index 1c141384684..2756284d777 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/OutputAbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/OutputAbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/_files/timers.php b/dev/tests/unit/testsuite/Magento/Profiler/_files/timers.php index d086f5f4698..08efe2c2378 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/_files/timers.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/_files/timers.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/dev/tests/unit/testsuite/Magento/ProfilerTest.php b/dev/tests/unit/testsuite/Magento/ProfilerTest.php index c7a4e7d4015..dd3e648b40a 100644 --- a/dev/tests/unit/testsuite/Magento/ProfilerTest.php +++ b/dev/tests/unit/testsuite/Magento/ProfilerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Varien/AllTests.php b/dev/tests/unit/testsuite/Varien/AllTests.php index e5e6c2a2b61..8ec15846d5a 100644 --- a/dev/tests/unit/testsuite/Varien/AllTests.php +++ b/dev/tests/unit/testsuite/Varien/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Varien * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Varien/Data/Collection/DbTest.php b/dev/tests/unit/testsuite/Varien/Data/Collection/DbTest.php index 31c970deb96..11fa0adfcec 100644 --- a/dev/tests/unit/testsuite/Varien/Data/Collection/DbTest.php +++ b/dev/tests/unit/testsuite/Varien/Data/Collection/DbTest.php @@ -21,7 +21,7 @@ * @category Varien * @package Varien_Data * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,4 +105,81 @@ class Varien_Data_Collection_DbTest extends PHPUnit_Framework_TestCase } return $adapter; } + + /** + * Test that adding field to filter builds proper sql WHERE condition + */ + public function testAddFieldToFilter() + { + $adapter =$this->_getAdapterMock( + 'Zend_Db_Adapter_Pdo_Mysql', + array('fetchAll', 'prepareSqlCondition'), + null + ); + $adapter->expects($this->any()) + ->method('prepareSqlCondition') + ->with( + $this->stringContains('is_imported'), + $this->anything() + ) + ->will($this->returnValue('is_imported = 1')); + $this->_collection->setConnection($adapter); + $select = $this->_collection->getSelect()->from('test'); + + $this->_collection->addFieldToFilter('is_imported', array('eq' => '1')); + $this->assertEquals('SELECT `test`.* FROM `test` WHERE (is_imported = 1)', $select->assemble()); + } + + /** + * Test that adding multiple fields to filter at once + * builds proper sql WHERE condition and created conditions are joined with OR + */ + public function testAddFieldToFilterWithMultipleParams() + { + $adapter = $this->_getAdapterMock( + 'Zend_Db_Adapter_Pdo_Mysql', + array('fetchAll', 'prepareSqlCondition'), + null + ); + $adapter->expects($this->at(0)) + ->method('prepareSqlCondition') + ->with( + 'weight', + array('in' => array(1,3)) + ) + ->will($this->returnValue('weight in (1, 3)')); + $adapter->expects($this->at(1)) + ->method('prepareSqlCondition') + ->with( + 'name', + array('like' => 'M%') + ) + ->will($this->returnValue("name like 'M%'")); + $this->_collection->setConnection($adapter); + $select = $this->_collection->getSelect()->from("test"); + + $this->_collection->addFieldToFilter( + array('weight', 'name'), + array(array('in' => array(1,3)), array('like' => 'M%')) + ); + + $this->assertEquals( + "SELECT `test`.* FROM `test` WHERE ((weight in (1, 3)) OR (name like 'M%'))", + $select->assemble() + ); + + $adapter->expects($this->at(0)) + ->method('prepareSqlCondition') + ->with( + 'is_imported', + $this->anything() + ) + ->will($this->returnValue('is_imported = 1')); + + $this->_collection->addFieldToFilter('is_imported', array('eq' => '1')); + $this->assertEquals( + "SELECT `test`.* FROM `test` WHERE ((weight in (1, 3)) OR (name like 'M%')) AND (is_imported = 1)", + $select->assemble() + ); + } } diff --git a/dev/tests/unit/testsuite/Varien/Db/Adapter/Pdo/MysqlTest.php b/dev/tests/unit/testsuite/Varien/Db/Adapter/Pdo/MysqlTest.php new file mode 100644 index 00000000000..9a99f813521 --- /dev/null +++ b/dev/tests/unit/testsuite/Varien/Db/Adapter/Pdo/MysqlTest.php @@ -0,0 +1,91 @@ +<?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 Varien + * @package Varien_Data + * @subpackage unit_tests + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Varien_Db_Adapter_Pdo_Mysql class test + */ +class Varien_Db_Adapter_Pdo_MysqlTest extends PHPUnit_Framework_TestCase +{ + /** + * Adapter for test + * @var Varien_Db_Adapter_Pdo_Mysql + */ + private $_adapter; + + /** + * Setup + */ + protected function setUp() + { + $this->_adapter = new Varien_Db_Adapter_Pdo_Mysql( + array( + 'dbname' => 'not_exists', + 'username' => 'not_valid', + 'password' => 'not_valid', + ) + ); + } + + /** + * Test result for bigint + * + * @dataProvider bigintResultProvider + */ + public function testPrepareColumnValueForBigint($value, $expectedResult) + { + $result = $this->_adapter->prepareColumnValue( + array('DATA_TYPE' => 'bigint'), + $value + ); + $this->assertEquals($expectedResult, $result); + } + + /** + * Data Provider for testPrepareColumnValueForBigint + */ + public function bigintResultProvider() + { + return array( + array(1, 1), + array(0, 0), + array(-1, -1), + array(1.0, 1), + array(0.0, 0), + array(-1.0, -1), + array(1e-10, 0), + array(7.9, 8), + array(PHP_INT_MAX, PHP_INT_MAX), + array(PHP_INT_MAX+1, '2147483648'), + array(9223372036854775807, '9223372036854775807'), + array(9223372036854775807.3423424234, '9223372036854775807'), + array(PHP_INT_MAX*pow(10, 10)+12, '21474836470000000012'), + array((0.099999999999999999999999995+0.2+0.3+0.4+0.5)*10, '15'), + array('21474836470000000012', '21474836470000000012'), + array(0x5468792130ABCDEF, '6082244480221302255') + ); + } +} diff --git a/dev/tests/unit/testsuite/Varien/ObjectTest.php b/dev/tests/unit/testsuite/Varien/ObjectTest.php index 4972df449b1..35892068ff0 100644 --- a/dev/tests/unit/testsuite/Varien/ObjectTest.php +++ b/dev/tests/unit/testsuite/Varien/ObjectTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tools/batch_tests/batch.php b/dev/tools/batch_tests/batch.php index 186249a1770..5f2dc16c3bc 100644 --- a/dev/tools/batch_tests/batch.php +++ b/dev/tools/batch_tests/batch.php @@ -21,7 +21,7 @@ * @category Magento * @package tools * @subpackage batch_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tools/classmap/fs_generator.php b/dev/tools/classmap/fs_generator.php index e5271b2e7b7..964da6d0496 100644 --- a/dev/tools/classmap/fs_generator.php +++ b/dev/tools/classmap/fs_generator.php @@ -20,7 +20,7 @@ * * @category Magento * @package tools - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tools/classmap/log_generator.php b/dev/tools/classmap/log_generator.php index d575f325b74..b6879ae4ea7 100644 --- a/dev/tools/classmap/log_generator.php +++ b/dev/tools/classmap/log_generator.php @@ -20,7 +20,7 @@ * * @category Magento * @package tools - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tools/classmap/logger.php b/dev/tools/classmap/logger.php index 2896343c039..e6551bb1da9 100644 --- a/dev/tools/classmap/logger.php +++ b/dev/tools/classmap/logger.php @@ -20,7 +20,7 @@ * * @category Magento * @package tools - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tools/migration/factory_names.php b/dev/tools/migration/factory_names.php new file mode 100644 index 00000000000..aba70af8c58 --- /dev/null +++ b/dev/tools/migration/factory_names.php @@ -0,0 +1,114 @@ +<?php +/** + * Automated replacement of factory names into real ones + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package tools + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +require realpath(dirname(dirname(dirname(__DIR__)))) . '/dev/tests/static/framework/bootstrap.php'; + +// PHP code +foreach (Util_Files::getPhpFiles() as $file) { + $file = array_shift($file); + $content = file_get_contents($file); + $classes = Legacy_ClassesTest::collectPhpCodeClasses($content); + $factoryNames = array_filter($classes, 'isFactoryName'); + if (!$factoryNames) { + continue; + } + $search = array(); + $replace = array(); + foreach ($factoryNames as $factoryName) { + list($module, $name) = getModuleName($factoryName); + addReplace($factoryName, $module, $name, '::getModel(%s', '_Model_', $search, $replace); + addReplace($factoryName, $module, $name, '::getSingleton(%s', '_Model_', $search, $replace); + addReplace($factoryName, $module, $name, '::getResourceModel(%s', '_Model_Resource_', $search, $replace); + addReplace($factoryName, $module, $name, '::getResourceSingleton(%s', '_Model_Resource_', $search, $replace); + addReplace($factoryName, $module, $name, 'addBlock(%s', '_Block_', $search, $replace); + addReplace($factoryName, $module, $name, 'createBlock(%s', '_Block_', $search, $replace); + addReplace($factoryName, $module, $name, 'getBlockClassName(%s', '_Block_', $search, $replace); + addReplace($factoryName, $module, $name, 'getBlockSingleton(%s', '_Block_', $search, $replace); + addReplace($factoryName, $module, $name, 'helper(%s', '_Helper_', $search, $replace); + } + $newContent = str_replace($search, $replace, $content); + if ($newContent != $content) { + echo "{$file}\n"; + print_r($factoryNames); + file_put_contents($file, $newContent); + } +} + +/** + * Whether the given class name is a factory name + * + * @param string $class + * @return bool + */ +function isFactoryName($class) +{ + return false !== strpos($class, '/') || preg_match('/^[a-z\d]+(_[A-Za-z\d]+)?$/', $class); +} + +/** + * Transform factory name into a pair of module and name + * + * @param string $factoryName + * @return array + */ +function getModuleName($factoryName) +{ + if (false !== strpos($factoryName, '/')) { + list($module, $name) = explode('/', $factoryName); + } else { + $module = $factoryName; + $name = false; + } + if (false === strpos($module, '_')) { + $module = "Mage_{$module}"; + } + return array($module, $name); +} + +/** + * Add search/replacements of factory name into real name based on a specified "sprintf()" pattern + * + * @param string $factoryName + * @param string $module + * @param string $name + * @param string $pattern + * @param string $suffix + * @param array &$search + * @param array &$replace + */ +function addReplace($factoryName, $module, $name, $pattern, $suffix, &$search, &$replace) +{ + if (empty($name)) { + if ('_Helper_' !== $suffix) { + return; + } + $name = 'data'; + } + $realName = implode('_', array_map('ucfirst', explode('_', $module . $suffix . $name))); + $search[] = sprintf($pattern, "'{$factoryName}'"); + $replace[] = sprintf($pattern, "'{$realName}'"); +} diff --git a/downloader/Maged/Connect.php b/downloader/Maged/Connect.php index 855cdb3eb32..511c84299bc 100644 --- a/downloader/Maged/Connect.php +++ b/downloader/Maged/Connect.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) */ @@ -54,17 +54,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; /** @@ -75,22 +75,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(); @@ -99,10 +106,20 @@ class Maged_Connect } /** - * 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) { @@ -112,10 +129,10 @@ class Maged_Connect } /** - * 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) { @@ -134,15 +151,19 @@ class Maged_Connect } /** - * 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; @@ -150,10 +171,10 @@ class Maged_Connect } /** - * 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) { @@ -164,30 +185,30 @@ class Maged_Connect } /** - * 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(); @@ -195,11 +216,11 @@ class Maged_Connect } /** - * 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); @@ -216,13 +237,13 @@ class Maged_Connect } /** - * 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); @@ -256,16 +277,20 @@ class Maged_Connect } } - 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 @@ -276,7 +301,7 @@ class Maged_Connect $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; } @@ -289,8 +314,9 @@ class Maged_Connect /** * 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) { @@ -317,6 +343,58 @@ class Maged_Connect } if (!$run->get('no-header')) { + $this->_consoleHeader(); + } + echo htmlspecialchars($run->get('comment')).'<br/>'; + + if ($command = $run->get('command')) { + $result = $this->run($command, $run->get('options'), $run->get('params')); + + if ($this->getFrontend()->hasErrors()) { + echo "<br/>CONNECT ERROR: "; + foreach ($this->getFrontend()->getErrors(false) as $error) { + echo nl2br($error[1]); + echo '<br/>'; + } + } + echo '<script type="text/javascript">'; + if ($this->getFrontend()->hasErrors()) { + if ($callback = $run->get('failure_callback')) { + if (is_array($callback)) { + call_user_func_array($callback, array($result)); + } else { + echo $callback; + } + } + } else { + if (!$run->get('no-footer')) { + if ($callback = $run->get('success_callback')) { + if (is_array($callback)) { + call_user_func_array($callback, array($result)); + } else { + echo $callback; + } + } + } + } + echo '</script>'; + } 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) { ?> <html><head><style type="text/css"> body { margin:0px; @@ -413,44 +491,17 @@ function clear_cache(callbacks) } </script> <?php + $this->_consoleStarted = true; } - 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 "<br/>CONNECT ERROR: "; - foreach ($this->getFrontend()->getErrors(false) as $error) { - echo nl2br($error[1]); - echo '<br/>'; - } - } - echo '<script type="text/javascript">'; - if ($this->getFrontend()->hasErrors()) { - if ($callback = $run->get('failure_callback')) { - if (is_array($callback)) { - call_user_func_array($callback, array($result)); - } else { - echo $callback; - } - } - } else { - if (!$run->get('no-footer')) { - if ($callback = $run->get('success_callback')) { - if (is_array($callback)) { - call_user_func_array($callback, array($result)); - } else { - echo $callback; - } - } - } - } - echo '</script>'; - } else { - $result = false; - } - if ($this->getFrontend()->getErrors() || !$run->get('no-footer')) { + /** + * Show HTML Console Footer + * + * @return void + */ + protected function _consoleFooter() { + if ($this->_consoleStarted) { ?> <script type="text/javascript"> if (parent && parent.disableInputs) { @@ -459,8 +510,7 @@ if (parent && parent.disableInputs) { </script> </body></html> <?php - $fe->setLogStream($oldLogStream); + $this->_consoleStarted = false; } - return $result; } } diff --git a/downloader/Maged/Connect/Frontend.php b/downloader/Maged/Connect/Frontend.php index 1546546635b..1960558d1bd 100644 --- a/downloader/Maged/Connect/Frontend.php +++ b/downloader/Maged/Connect/Frontend.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/downloader/Maged/Controller.php b/downloader/Maged/Controller.php index abf21744113..f6ea742072c 100755 --- a/downloader/Maged/Controller.php +++ b/downloader/Maged/Controller.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) */ @@ -491,7 +491,6 @@ final class Maged_Controller self::singleton()->dispatch(); } catch (Exception $e) { echo $e->getMessage(); - //echo self::singleton()->view()->set('exception', $e)->template("exception.phtml"); } } @@ -883,6 +882,18 @@ final class Maged_Controller @file_put_contents($this->_getMaintenanceFilePath(), 'maintenance'); } } + + if (!empty($_GET['archive_type'])) { + $isSuccess = $this->_createBackup($_GET['archive_type'], $_GET['backup_name']); + + if (!$isSuccess) { + $this->endInstall(); + $this->cleanCache(); + throw new Mage_Exception( + 'The installation process has been canceled because of the backup creation error' + ); + } + } } /** @@ -973,4 +984,96 @@ final class Maged_Controller 'number' => '2', ); } + + /** + * Create Backup + * + * @param string $archiveType + * @param string $archiveName + * @return bool + */ + protected function _createBackup($archiveType, $archiveName){ + /** @var $connect Maged_Connect */ + $connect = $this->model('connect', true)->connect(); + $connect->runHtmlConsole('Creating data backup...'); + + $isSuccess = false; + + try { + $type = $this->_getBackupTypeByCode($archiveType); + + $backupManager = Mage_Backup::getBackupInstance($type) + ->setBackupExtension(Mage::helper('Mage_Backup_Helper_Data')->getExtensionByType($type)) + ->setTime(time()) + ->setName($archiveName) + ->setBackupsDir(Mage::helper('Mage_Backup_Helper_Data')->getBackupsDir()); + + Mage::register('backup_manager', $backupManager); + + if ($type != Mage_Backup_Helper_Data::TYPE_DB) { + $backupManager->setRootDir(Mage::getBaseDir()) + ->addIgnorePaths(Mage::helper('Mage_Backup_Helper_Data')->getBackupIgnorePaths()); + } + $backupManager->create(); + $connect->runHtmlConsole( + $this->_getCreateBackupSuccessMessageByType($type) + ); + $isSuccess = true; + } catch (Mage_Backup_Exception_NotEnoughFreeSpace $e) { + $connect->runHtmlConsole('Not enough free space to create backup.'); + Mage::logException($e); + } catch (Mage_Backup_Exception_NotEnoughPermissions $e) { + $connect->runHtmlConsole('Not enough permissions to create backup.'); + Mage::logException($e); + } catch (Exception $e) { + $connect->runHtmlConsole('An error occurred while creating the backup.'); + Mage::logException($e); + } + + return $isSuccess; + } + + /** + * Retrieve Backup Type by Code + * + * @param int $code + * @return string + */ + protected function _getBackupTypeByCode($code) + { + $typeMap = array( + 1 => Mage_Backup_Helper_Data::TYPE_DB, + 2 => Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT, + 3 => Mage_Backup_Helper_Data::TYPE_SNAPSHOT_WITHOUT_MEDIA, + 4 => Mage_Backup_Helper_Data::TYPE_MEDIA + ); + + if (!isset($typeMap[$code])) { + Mage::throwException('Unknown backup type'); + } + + return $typeMap[$code]; + } + + /** + * Get backup create success message by backup type + * + * @param string $type + * @return string + */ + 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_MEDIA => 'Database and media backup has been created', + Mage_Backup_Helper_Data::TYPE_DB => 'Database backup has been created' + ); + + if (!isset($messagesMap[$type])) { + return ''; + } + + return $messagesMap[$type]; + } } diff --git a/downloader/Maged/Exception.php b/downloader/Maged/Exception.php index 8237000cdf4..ca1a27581db 100755 --- a/downloader/Maged/Exception.php +++ b/downloader/Maged/Exception.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/downloader/Maged/Model.php b/downloader/Maged/Model.php index 9f1bcd51373..f6a6e3333d0 100755 --- a/downloader/Maged/Model.php +++ b/downloader/Maged/Model.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/downloader/Maged/Model/Config.php b/downloader/Maged/Model/Config.php index cddc2e3805f..ba9ecbc7d7a 100644 --- a/downloader/Maged/Model/Config.php +++ b/downloader/Maged/Model/Config.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/downloader/Maged/Model/Config/Abstract.php b/downloader/Maged/Model/Config/Abstract.php index 49326f78de2..8c99c26dbf4 100644 --- a/downloader/Maged/Model/Config/Abstract.php +++ b/downloader/Maged/Model/Config/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/downloader/Maged/Model/Config/Community.php b/downloader/Maged/Model/Config/Community.php index f245ca32324..b565c294ab9 100644 --- a/downloader/Maged/Model/Config/Community.php +++ b/downloader/Maged/Model/Config/Community.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/downloader/Maged/Model/Config/Interface.php b/downloader/Maged/Model/Config/Interface.php index 73994dfbc00..286571eae1d 100644 --- a/downloader/Maged/Model/Config/Interface.php +++ b/downloader/Maged/Model/Config/Interface.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/downloader/Maged/Model/Connect.php b/downloader/Maged/Model/Connect.php index 031e9047b38..9f83ac76e64 100644 --- a/downloader/Maged/Model/Connect.php +++ b/downloader/Maged/Model/Connect.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/downloader/Maged/Model/Connect/Request.php b/downloader/Maged/Model/Connect/Request.php index 228bcce742c..b2e334e3426 100644 --- a/downloader/Maged/Model/Connect/Request.php +++ b/downloader/Maged/Model/Connect/Request.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/downloader/Maged/Model/Dowloader.php b/downloader/Maged/Model/Dowloader.php index 06a34ce36e3..976b747677e 100755 --- a/downloader/Maged/Model/Dowloader.php +++ b/downloader/Maged/Model/Dowloader.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/downloader/Maged/Model/Session.php b/downloader/Maged/Model/Session.php index e5bcb0b1d3b..980e30d1616 100644 --- a/downloader/Maged/Model/Session.php +++ b/downloader/Maged/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/downloader/Maged/View.php b/downloader/Maged/View.php index defa0f18b83..c236e446ef9 100755 --- a/downloader/Maged/View.php +++ b/downloader/Maged/View.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/downloader/index.php b/downloader/index.php index 4bc284e435a..dcc6a0c0bb9 100755 --- a/downloader/index.php +++ b/downloader/index.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/downloader/lib/Mage/Archive.php b/downloader/lib/Mage/Archive.php index 1d3cc3fe94c..d948103d5ad 100644 --- a/downloader/lib/Mage/Archive.php +++ b/downloader/lib/Mage/Archive.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,12 +157,13 @@ class Mage_Archive if ($i == 0) { $packed = rtrim($destination, DS) . DS; } else { - $packed = rtrim($destination, DS) . DS . '~tmp-'. microtime(true) . $archivers[$i-1] . '.' . $archivers[$i-1]; + $packed = rtrim($destination, DS) . DS . '~tmp-'. microtime(true) . $archivers[$i-1] . '.' + . $archivers[$i-1]; } $source = $this->_getArchiver($archivers[$i])->unpack($source, $packed); - + //var_dump($packed, $source); - + if ($clearInterm && $interimSource && $i >= 0) { unlink($interimSource); } @@ -218,5 +219,4 @@ class Mage_Archive } return false; } - -} +} \ No newline at end of file diff --git a/downloader/lib/Mage/Archive/Abstract.php b/downloader/lib/Mage/Archive/Abstract.php index 4871259695c..2aece187955 100644 --- a/downloader/lib/Mage/Archive/Abstract.php +++ b/downloader/lib/Mage/Archive/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,14 +34,16 @@ class Mage_Archive_Abstract { /** - * Write data to file. If file can't be opened, + * Write data to file. If file can't be opened - throw exception * * @param string $destination * @param string $data * @return boolean + * @throws Mage_Exception */ protected function _writeFile($destination, $data) { + $destination = trim($destination); if(false === file_put_contents($destination, $data)) { throw new Mage_Exception("Can't write to file: " . $destination); } @@ -53,6 +55,7 @@ class Mage_Archive_Abstract * * @param string $source * @return string + * @throws Mage_Exception */ protected function _readFile($source) { @@ -70,7 +73,8 @@ class Mage_Archive_Abstract * Get file name from source (URI) without last extension. * * @param string $source - * @return string + * @param bool $withExtension + * @return mixed|string */ public function getFilename($source, $withExtension=false) { @@ -80,5 +84,4 @@ class Mage_Archive_Abstract } return $file; } - } diff --git a/downloader/lib/Mage/Archive/Bz.php b/downloader/lib/Mage/Archive/Bz.php index cf5c42cd87d..052fdcb4b21 100644 --- a/downloader/lib/Mage/Archive/Bz.php +++ b/downloader/lib/Mage/Archive/Bz.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,9 +43,19 @@ class Mage_Archive_Bz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function pack($source, $destination) { - $data = $this->_readFile($source); - $bzData = bzcompress($data, 9); - $this->_writeFile($destination, $bzData); + $fileReader = new Mage_Archive_Helper_File($source); + $fileReader->open('r'); + + $archiveWriter = new Mage_Archive_Helper_File_Bz($destination); + $archiveWriter->open('w'); + + while (!$fileReader->eof()) { + $archiveWriter->write($fileReader->read()); + } + + $fileReader->close(); + $archiveWriter->close(); + return $destination; } @@ -58,21 +68,21 @@ class Mage_Archive_Bz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function unpack($source, $destination) { - $data = ''; - $bzPointer = bzopen($source, 'r' ); - if (empty($bzPointer)) { - throw new Exception('Can\'t open BZ archive : ' . $source); - } - while (!feof($bzPointer)) { - $data .= bzread($bzPointer, 131072); - } - bzclose($bzPointer); if (is_dir($destination)) { $file = $this->getFilename($source); $destination = $destination . $file; } - echo $destination; - $this->_writeFile($destination, $data); + + $archiveReader = new Mage_Archive_Helper_File_Bz($source); + $archiveReader->open('r'); + + $fileWriter = new Mage_Archive_Helper_File($destination); + $fileWriter->open('w'); + + while (!$archiveReader->eof()) { + $fileWriter->write($archiveReader->read()); + } + return $destination; } diff --git a/downloader/lib/Mage/Archive/Gz.php b/downloader/lib/Mage/Archive/Gz.php index 0e8dfd1d6b9..43a7c0d58b8 100644 --- a/downloader/lib/Mage/Archive/Gz.php +++ b/downloader/lib/Mage/Archive/Gz.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,9 +42,19 @@ class Mage_Archive_Gz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function pack($source, $destination) { - $data = $this->_readFile($source); - $gzData = gzencode($data, 9); - $this->_writeFile($destination, $gzData); + $fileReader = new Mage_Archive_Helper_File($source); + $fileReader->open('r'); + + $archiveWriter = new Mage_Archive_Helper_File_Gz($destination); + $archiveWriter->open('wb9'); + + while (!$fileReader->eof()) { + $archiveWriter->write($fileReader->read()); + } + + $fileReader->close(); + $archiveWriter->close(); + return $destination; } @@ -57,21 +67,21 @@ class Mage_Archive_Gz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function unpack($source, $destination) { - $gzPointer = gzopen($source, 'r' ); - if (empty($gzPointer)) { - throw new Mage_Exception('Can\'t open GZ archive : ' . $source); - } - $data = ''; - while (!gzeof($gzPointer)) { - $data .= gzread($gzPointer, 131072); - } - gzclose($gzPointer); if (is_dir($destination)) { $file = $this->getFilename($source); $destination = $destination . $file; } - $this->_writeFile($destination, $data); + + $archiveReader = new Mage_Archive_Helper_File_Gz($source); + $archiveReader->open('r'); + + $fileWriter = new Mage_Archive_Helper_File($destination); + $fileWriter->open('w'); + + while (!$archiveReader->eof()) { + $fileWriter->write($archiveReader->read()); + } + return $destination; } - } diff --git a/downloader/lib/Mage/Archive/Helper/File.php b/downloader/lib/Mage/Archive/Helper/File.php new file mode 100755 index 00000000000..04872633894 --- /dev/null +++ b/downloader/lib/Mage/Archive/Helper/File.php @@ -0,0 +1,274 @@ +<?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_Archive + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** +* Helper class that simplifies files stream reading and writing +* +* @category Mage +* @package Mage_Archive +* @author Magento Core Team <core@magentocommerce.com> +*/ +class Mage_Archive_Helper_File +{ + /** + * Full path to directory where file located + * + * @var string + */ + protected $_fileLocation; + + /** + * File name + * + * @var string + */ + protected $_fileName; + + /** + * Full path (directory + filename) to file + * + * @var string + */ + protected $_filePath; + + /** + * File permissions that will be set if file opened in write mode + * + * @var int + */ + protected $_chmod; + + /** + * File handler + * + * @var pointer + */ + protected $_fileHandler; + + /** + * Set file path via constructor + * + * @param string $filePath + */ + public function __construct($filePath) + { + $pathInfo = pathinfo($filePath); + + $this->_filePath = $filePath; + $this->_fileLocation = isset($pathInfo['dirname']) ? $pathInfo['dirname'] : ''; + $this->_fileName = isset($pathInfo['basename']) ? $pathInfo['basename'] : ''; + } + + /** + * Close file if it's not closed before object destruction + */ + public function __destruct() + { + if ($this->_fileHandler) { + $this->_close(); + } + } + + /** + * Open file + * + * @param string $mode + * @param int $chmod + * @throws Mage_Exception + */ + public function open($mode = 'w+', $chmod = 0666) + { + if ($this->_isWritableMode($mode)) { + if (!is_writable($this->_fileLocation)) { + throw new Mage_Exception('Permission denied to write to ' . $this->_fileLocation); + } + + if (is_file($this->_filePath) && !is_writable($this->_filePath)) { + throw new Mage_Exception("Can't open file " . $this->_fileName . " for writing. Permission denied."); + } + } + + if ($this->_isReadableMode($mode) && (!is_file($this->_filePath) || !is_readable($this->_filePath))) { + if (!is_file($this->_filePath)) { + throw new Mage_Exception('File ' . $this->_filePath . ' does not exist'); + } + + if (!is_readable($this->_filePath)) { + throw new Mage_Exception('Permission denied to read file ' . $this->_filePath); + } + } + + $this->_open($mode); + + $this->_chmod = $chmod; + } + + /** + * Write data to file + * + * @param string $data + */ + public function write($data) + { + $this->_checkFileOpened(); + $this->_write($data); + } + + /** + * Read data from file + * + * @param int $length + * @return string|boolean + */ + public function read($length = 4096) + { + $data = false; + $this->_checkFileOpened(); + if ($length > 0) { + $data = $this->_read($length); + } + + return $data; + } + + /** + * Check whether end of file reached + * + * @return boolean + */ + public function eof() + { + $this->_checkFileOpened(); + return $this->_eof(); + } + + /** + * Close file + */ + public function close() + { + $this->_checkFileOpened(); + $this->_close(); + $this->_fileHandler = false; + @chmod($this->_filePath, $this->_chmod); + } + + /** + * Implementation of file opening + * + * @param string $mode + * @throws Mage_Exception + */ + protected function _open($mode) + { + $this->_fileHandler = @fopen($this->_filePath, $mode); + + if (false === $this->_fileHandler) { + throw new Mage_Exception('Failed to open file ' . $this->_filePath); + } + } + + /** + * Implementation of writing data to file + * + * @param string $data + * @throws Mage_Exception + */ + protected function _write($data) + { + $result = @fwrite($this->_fileHandler, $data); + + if (false === $result) { + throw new Mage_Exception('Failed to write data to ' . $this->_filePath); + } + } + + /** + * Implementation of file reading + * + * @param int $length + * @throws Mage_Exception + */ + protected function _read($length) + { + $result = fread($this->_fileHandler, $length); + + if (false === $result) { + throw new Mage_Exception('Failed to read data from ' . $this->_filePath); + } + + return $result; + } + + /** + * Implementation of EOF indicator + * + * @return boolean + */ + protected function _eof() + { + return feof($this->_fileHandler); + } + + /** + * Implementation of file closing + */ + protected function _close() + { + fclose($this->_fileHandler); + } + + /** + * Check whether requested mode is writable mode + * + * @param string $mode + */ + protected function _isWritableMode($mode) + { + return preg_match('/(^[waxc])|(\+$)/', $mode); + } + + /** + * Check whether requested mode is readable mode + * + * @param string $mode + */ + protected function _isReadableMode($mode) { + return !$this->_isWritableMode($mode); + } + + /** + * Check whether file is opened + * + * @throws Mage_Exception + */ + protected function _checkFileOpened() + { + if (!$this->_fileHandler) { + throw new Mage_Exception('File not opened'); + } + } +} diff --git a/downloader/lib/Mage/Archive/Helper/File/Bz.php b/downloader/lib/Mage/Archive/Helper/File/Bz.php new file mode 100755 index 00000000000..dbddaaeb6a1 --- /dev/null +++ b/downloader/lib/Mage/Archive/Helper/File/Bz.php @@ -0,0 +1,92 @@ +<?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_Archive + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** +* Helper class that simplifies bz2 files stream reading and writing +* +* @category Mage +* @package Mage_Archive +* @author Magento Core Team <core@magentocommerce.com> +*/ +class Mage_Archive_Helper_File_Bz extends Mage_Archive_Helper_File +{ + /** + * Open bz archive file + * + * @throws Mage_Exception + * @param string $mode + */ + protected function _open($mode) + { + $this->_fileHandler = @bzopen($this->_filePath, $mode); + + if (false === $this->_fileHandler) { + throw new Mage_Exception('Failed to open file ' . $this->_filePath); + } + } + + /** + * Write data to bz archive + * + * @throws Mage_Exception + * @param $data + */ + protected function _write($data) + { + $result = @bzwrite($this->_fileHandler, $data); + + if (false === $result) { + throw new Mage_Exception('Failed to write data to ' . $this->_filePath); + } + } + + /** + * Read data from bz archive + * + * @throws Mage_Exception + * @param int $length + * @return string + */ + protected function _read($length) + { + $data = bzread($this->_fileHandler, $length); + + if (false === $data) { + throw new Mage_Exception('Failed to read data from ' . $this->_filePath); + } + + return $data; + } + + /** + * Close bz archive + */ + protected function _close() + { + bzclose($this->_fileHandler); + } +} + diff --git a/downloader/lib/Mage/Archive/Helper/File/Gz.php b/downloader/lib/Mage/Archive/Helper/File/Gz.php new file mode 100755 index 00000000000..9bf01228510 --- /dev/null +++ b/downloader/lib/Mage/Archive/Helper/File/Gz.php @@ -0,0 +1,83 @@ +<?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_Archive + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** +* Helper class that simplifies gz files stream reading and writing +* +* @category Mage +* @package Mage_Archive +* @author Magento Core Team <core@magentocommerce.com> +*/ +class Mage_Archive_Helper_File_Gz extends Mage_Archive_Helper_File +{ + /** + * @see Mage_Archive_Helper_File::_open() + */ + protected function _open($mode) + { + $this->_fileHandler = @gzopen($this->_filePath, $mode); + + if (false === $this->_fileHandler) { + throw new Mage_Exception('Failed to open file ' . $this->_filePath); + } + } + + /** + * @see Mage_Archive_Helper_File::_write() + */ + protected function _write($data) + { + $result = @gzwrite($this->_fileHandler, $data); + + if (empty($result) && !empty($data)) { + throw new Mage_Exception('Failed to write data to ' . $this->_filePath); + } + } + + /** + * @see Mage_Archive_Helper_File::_read() + */ + protected function _read($length) + { + return gzread($this->_fileHandler, $length); + } + + /** + * @see Mage_Archive_Helper_File::_eof() + */ + protected function _eof() + { + return gzeof($this->_fileHandler); + } + + /** + * @see Mage_Archive_Helper_File::_close() + */ + protected function _close() + { + gzclose($this->_fileHandler); + } +} diff --git a/downloader/lib/Mage/Archive/Interface.php b/downloader/lib/Mage/Archive/Interface.php index 8ef9af3c84e..8b3fe7c8ba3 100644 --- a/downloader/lib/Mage/Archive/Interface.php +++ b/downloader/lib/Mage/Archive/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Archive/Tar.php b/downloader/lib/Mage/Archive/Tar.php index dca45fcd3cb..e36fec58ea5 100644 --- a/downloader/lib/Mage/Archive/Tar.php +++ b/downloader/lib/Mage/Archive/Tar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,11 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Interface { /** - * Constant is used for parse tar's header. + * Tar block size + * + * @const int */ - const FORMAT_PARSE_HEADER = 'a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor/a155prefix/a12closer'; + const TAR_BLOCK_SIZE = 512; /** * Keep file or directory for packing. @@ -60,6 +62,122 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ protected $_skipRoot; + /** + * Tarball data writer + * + * @var Mage_Archive_Helper_File + */ + protected $_writer; + + /** + * Tarball data reader + * + * @var Mage_Archive_Helper_File + */ + protected $_reader; + + /** + * Path to file where tarball should be placed + * + * @var string + */ + protected $_destinationFilePath; + + /** + * Initialize tarball writer + * + * @return Mage_Archive_Tar + */ + protected function _initWriter() + { + $this->_writer = new Mage_Archive_Helper_File($this->_destinationFilePath); + $this->_writer->open('w'); + + return $this; + } + + /** + * Returns string that is used for tar's header parsing + * + * @return string + */ + protected static final function _getFormatParseHeader() + { + return 'a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2version/' + . 'a32uname/a32gname/a8devmajor/a8devminor/a155prefix/a12closer'; + } + + /** + * Destroy tarball writer + * + * @return Mage_Archive_Tar + */ + protected function _destroyWriter() + { + if ($this->_writer instanceof Mage_Archive_Helper_File) { + $this->_writer->close(); + $this->_writer = null; + } + + return $this; + } + + /** + * Get tarball writer + * + * @return Mage_Archive_Helper_File + */ + protected function _getWriter() + { + if (!$this->_writer) { + $this->_initWriter(); + } + + return $this->_writer; + } + + /** + * Initialize tarball reader + * + * @return Mage_Archive_Tar + */ + protected function _initReader() + { + $this->_reader = new Mage_Archive_Helper_File($this->_getCurrentFile()); + $this->_reader->open('r'); + + return $this; + } + + /** + * Destroy tarball reader + * + * @return Mage_Archive_Tar + */ + protected function _destroyReader() + { + if ($this->_reader instanceof Mage_Archive_Helper_File) { + $this->_reader->close(); + $this->_reader = null; + } + + return $this; + } + + /** + * Get tarball reader + * + * @return Mage_Archive_Helper_File + */ + protected function _getReader() + { + if (!$this->_reader) { + $this->_initReader(); + } + + return $this->_reader; + } + /** * Set option that define ability skip first catalog level. * @@ -80,7 +198,19 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ protected function _setCurrentFile($file) { - $this->_currentFile = $file .((is_dir($file) && substr($file, -1)!=DS)?DS:''); + $this->_currentFile = $file .((!is_link($file) && is_dir($file) && substr($file, -1) != DS) ? DS : ''); + return $this; + } + + /** + * Set path to file where tarball should be placed + * + * @param string $destinationFilePath + * @return Mage_Archive_Tar + */ + protected function _setDestinationFilePath($destinationFilePath) + { + $this->_destinationFilePath = $destinationFilePath; return $this; } @@ -124,6 +254,7 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int * Walk through directory and add to tar file or directory. * Result is packed string on TAR format. * + * @deprecated after 1.7.0.0 * @param boolean $skipRoot * @return string */ @@ -154,10 +285,74 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int return $tarData; } + /** + * Recursively walk through file tree and create tarball + * + * @param boolean $skipRoot + * @param boolean $finalize + * @throws Mage_Exception + */ + protected function _createTar($skipRoot = false, $finalize = false) + { + if (!$skipRoot) { + $this->_packAndWriteCurrentFile(); + } + + $file = $this->_getCurrentFile(); + + if (is_dir($file)) { + $dirFiles = scandir($file); + + if (false === $dirFiles) { + throw new Mage_Exception('Can\'t scan dir: ' . $file); + } + + array_shift($dirFiles); /* remove './'*/ + array_shift($dirFiles); /* remove '../'*/ + + foreach ($dirFiles as $item) { + $this->_setCurrentFile($file . $item)->_createTar(); + } + } + + if ($finalize) { + $this->_getWriter()->write(str_repeat("\0", self::TAR_BLOCK_SIZE * 12)); + } + } + + /** + * Write current file to tarball + */ + protected function _packAndWriteCurrentFile() + { + $archiveWriter = $this->_getWriter(); + $archiveWriter->write($this->_composeHeader()); + + $currentFile = $this->_getCurrentFile(); + + $fileSize = 0; + + if (is_file($currentFile) && !is_link($currentFile)) { + $fileReader = new Mage_Archive_Helper_File($currentFile); + $fileReader->open('r'); + + while (!$fileReader->eof()) { + $archiveWriter->write($fileReader->read()); + } + + $fileReader->close(); + + $fileSize = filesize($currentFile); + } + + $appendZerosCount = (self::TAR_BLOCK_SIZE - $fileSize % self::TAR_BLOCK_SIZE) % self::TAR_BLOCK_SIZE; + $archiveWriter->write(str_repeat("\0", $appendZerosCount)); + } + /** * Compose header for current file in TAR format. * If length of file's name greater 100 characters, - * method breaks header to two pieces. First conatins + * method breaks header into two pieces. First contains * header and data with long name. Second contain only header. * * @param boolean $long @@ -178,14 +373,16 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int } $header = array(); $header['100-name'] = $long?'././@LongLink':substr($nameFile, 0, 100); - $header['8-mode'] = $long?' ':str_pad(substr(sprintf("%07o", $infoFile['mode']),-4), 6, '0', STR_PAD_LEFT); + $header['8-mode'] = $long ? ' ' + : str_pad(substr(sprintf("%07o", $infoFile['mode']),-4), 6, '0', STR_PAD_LEFT); $header['8-uid'] = $long || $infoFile['uid']==0?"\0\0\0\0\0\0\0":sprintf("%07o", $infoFile['uid']); $header['8-gid'] = $long || $infoFile['gid']==0?"\0\0\0\0\0\0\0":sprintf("%07o", $infoFile['gid']); - $header['12-size'] = $long?sprintf("%011o", strlen($nameFile)):sprintf("%011o", is_dir($file) ? 0 : filesize($file)); + $header['12-size'] = $long ? sprintf("%011o", strlen($nameFile)) : sprintf("%011o", is_dir($file) + ? 0 : filesize($file)); $header['12-mtime'] = $long?'00000000000':sprintf("%011o", $infoFile['mtime']); $header['8-check'] = sprintf('% 8s', ''); - $header['1-type'] = $long?'L':(is_link($file) ? 2 : is_dir ($file) ? 5 : 0); - $header['100-symlink'] = is_link($file) == 2 ? readlink($item) : ''; + $header['1-type'] = $long ? 'L' : (is_link($file) ? 2 : (is_dir($file) ? 5 : 0)); + $header['100-symlink'] = is_link($file) ? readlink($file) : ''; $header['6-magic'] = 'ustar '; $header['2-version'] = ' '; $a=function_exists('posix_getpwuid')?posix_getpwuid (fileowner($file)):array('name'=>''); @@ -219,38 +416,63 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int * * @param string $destination path to file is unpacked * @return array list of files + * @throws Mage_Exception */ protected function _unpackCurrentTar($destination) { - $file = $this->_getCurrentFile(); - $pointer = fopen($file, 'r'); - if (empty($pointer)) { - throw new Mage_Exception('Can\'t open file: ' . $file); - } + $archiveReader = $this->_getReader(); $list = array(); - while (!feof($pointer)) { - $header = $this->_parseHeader($pointer); - if ($header) { - $currentFile = $destination . $header['name']; - if ($header['type']=='5' && @mkdir($currentFile, 0777, true)) { - $list[] = $currentFile . DS; - } elseif (in_array($header['type'], array("0",chr(0), ''))) { - $dirname = dirname($currentFile); - if(!file_exists($dirname)) { - @mkdir($dirname, 0777, true); + + while (!$archiveReader->eof()) { + $header = $this->_extractFileHeader(); + + if (!$header) { + continue; + } + + $currentFile = $destination . $header['name']; + $dirname = dirname($currentFile); + + if (in_array($header['type'], array("0",chr(0), ''))) { + + if(!file_exists($dirname)) { + $mkdirResult = @mkdir($dirname, 0777, true); + + if (false === $mkdirResult) { + throw new Mage_Exception('Failed to create directory ' . $dirname); } - $this->_writeFile($currentFile, $header['data']); - $list[] = $currentFile; + } + + $this->_extractAndWriteFile($header, $currentFile); + $list[] = $currentFile; + + } elseif ($header['type'] == '5') { + + if(!file_exists($dirname)) { + $mkdirResult = @mkdir($currentFile, $header['mode'], true); + + if (false === $mkdirResult) { + throw new Mage_Exception('Failed to create directory ' . $currentFile); + } + } + $list[] = $currentFile . DS; + } elseif ($header['type'] == '2') { + + $symlinkResult = @symlink($header['symlink'], $currentFile); + + if (false === $symlinkResult) { + throw new Mage_Exception('Failed to create symlink ' . $currentFile . ' to ' . $header['symlink']); } } } - fclose($pointer); + return $list; } /** * Get header from TAR string and unpacked it by format. * + * @deprecated after 1.7.0.0 * @param resource $pointer * @return string */ @@ -262,10 +484,9 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int return false; } - $fmt = self::FORMAT_PARSE_HEADER; + $fmt = self::_getFormatParseHeader(); $header = unpack ($fmt, $firstLine); - $header['mode']=$header['mode']+0; $header['uid']=octdec($header['uid']); $header['gid']=octdec($header['gid']); @@ -284,7 +505,7 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int } $isUstar = 'ustar' == strtolower(substr($header['magic'], 0, 5)); - + $checksumOk = $header['checksum'] == $checksum; if (isset($header['name']) && $checksumOk) { if ($header['name'] == '././@LongLink' && $header['type'] == 'L') { @@ -304,6 +525,90 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int return false; } + /** + * Read and decode file header information from tarball + * + * @return array|boolean + */ + protected function _extractFileHeader() + { + $archiveReader = $this->_getReader(); + + $headerBlock = $archiveReader->read(self::TAR_BLOCK_SIZE); + + if (strlen($headerBlock) < self::TAR_BLOCK_SIZE) { + return false; + } + + $header = unpack(self::_getFormatParseHeader(), $headerBlock); + + $header['mode'] = octdec($header['mode']); + $header['uid'] = octdec($header['uid']); + $header['gid'] = octdec($header['gid']); + $header['size'] = octdec($header['size']); + $header['mtime'] = octdec($header['mtime']); + $header['checksum'] = octdec($header['checksum']); + + if ($header['type'] == "5") { + $header['size'] = 0; + } + + $checksum = 0; + $headerBlock = substr_replace($headerBlock, ' ', 148, 8); + + for ($i = 0; $i < 512; $i++) { + $checksum += ord(substr($headerBlock, $i, 1)); + } + + $isUstar = 'ustar' == strtolower(substr($header['magic'], 0, 5)); + + $checksumOk = $header['checksum'] == $checksum; + if (isset($header['name']) && $checksumOk) { + + if (!($header['name'] == '././@LongLink' && $header['type'] == 'L')) { + return $header; + } + + $realNameBlockSize = floor(($header['size'] + self::TAR_BLOCK_SIZE - 1) / self::TAR_BLOCK_SIZE) + * self::TAR_BLOCK_SIZE; + $realNameBlock = $archiveReader->read($realNameBlockSize); + $realName = substr($realNameBlock, 0, $header['size']); + + $headerMain = $this->_extractFileHeader(); + $headerMain['name'] = $realName; + return $headerMain; + } + + return false; + } + + /** + * Extract next file from tarball by its $header information and save it to $destination + * + * @param array $fileHeader + * @param string $destination + */ + protected function _extractAndWriteFile($fileHeader, $destination) + { + $fileWriter = new Mage_Archive_Helper_File($destination); + $fileWriter->open('w', $fileHeader['mode']); + + $archiveReader = $this->_getReader(); + + $filesize = $fileHeader['size']; + $bytesExtracted = 0; + + while ($filesize > $bytesExtracted && !$archiveReader->eof()) { + $block = $archiveReader->read(self::TAR_BLOCK_SIZE); + $nonExtractedBytesCount = $filesize - $bytesExtracted; + + $data = substr($block, 0, $nonExtractedBytesCount); + $fileWriter->write($data); + + $bytesExtracted += strlen($block); + } + } + /** * Pack file to TAR (Tape Archiver). * @@ -312,14 +617,18 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int * @param boolean $skipRoot * @return string */ - public function pack($source, $destination, $skipRoot=false) + public function pack($source, $destination, $skipRoot = false) { $this->_setSkipRoot($skipRoot); $source = realpath($source); $tarData = $this->_setCurrentPath($source) - ->_setCurrentFile($source) - ->_packToTar($skipRoot); - $this->_writeFile($destination, $tarData); + ->_setDestinationFilePath($destination) + ->_setCurrentFile($source); + + $this->_initWriter(); + $this->_createTar($skipRoot, true); + $this->_destroyWriter(); + return $destination; } @@ -332,13 +641,13 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ public function unpack($source, $destination) { - $tempFile = $destination . DS . '~tmp-'.microtime(true).'.tar'; - $data = $this->_readFile($source); - $this->_writeFile($tempFile, $data); - $this->_setCurrentFile($tempFile) - ->_setCurrentPath($tempFile) - ->_unpackCurrentTar($destination); - unlink($tempFile); + $this->_setCurrentFile($source) + ->_setCurrentPath($source); + + $this->_initReader(); + $this->_unpackCurrentTar($destination); + $this->_destroyReader(); + return $destination; } @@ -352,21 +661,28 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ public function extract($file, $source, $destination) { - $pointer = fopen($source, 'r'); - if (empty($pointer)) { - throw new Mage_Exception('Can\'t open file: '.$source); - } - $list = array(); + $this->_setCurrentFile($source); + $this->_initReader(); + + $archiveReader = $this->_getReader(); $extractedFile = ''; - while (!feof($pointer)) { - $header = $this->_parseHeader($pointer); + + while (!$archiveReader->eof()) { + $header = $this->_extractFileHeader(); if ($header['name'] == $file) { $extractedFile = $destination . basename($header['name']); - $this->_writeFile($extractedFile, $header['data']); + $this->_extractAndWriteFile($header, $extractedFile); break; } + + if ($header['type'] != 5){ + $skipBytes = floor(($header['size'] + self::TAR_BLOCK_SIZE - 1) / self::TAR_BLOCK_SIZE) + * self::TAR_BLOCK_SIZE; + $archiveReader->read($skipBytes); + } } - fclose($pointer); + + $this->_destroyReader(); return $extractedFile; } } diff --git a/downloader/lib/Mage/Autoload/Simple.php b/downloader/lib/Mage/Autoload/Simple.php index 83e1a5a4f00..260b57a3759 100644 --- a/downloader/lib/Mage/Autoload/Simple.php +++ b/downloader/lib/Mage/Autoload/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Autoload - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Backup.php b/downloader/lib/Mage/Backup.php new file mode 100755 index 00000000000..88f2f48b436 --- /dev/null +++ b/downloader/lib/Mage/Backup.php @@ -0,0 +1,59 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright 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 to work with backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup +{ + /** + * List of supported a backup types + * + * @var array + */ + static protected $_allowedBackupTypes = array('db', 'snapshot', 'filesystem', 'media', 'nomedia'); + + /** + * get Backup Instance By File Name + * + * @param string $type + * @return Mage_Backup_Interface + */ + static public function getBackupInstance($type) + { + $class = 'Mage_Backup_' . $type; + + if (!in_array($type, self::$_allowedBackupTypes) || !class_exists($class, true)){ + throw new Mage_Exception('Current implementation not supported this type (' . $type . ') of backup.'); + } + + return new $class(); + } +} diff --git a/downloader/lib/Mage/Backup/Abstract.php b/downloader/lib/Mage/Backup/Abstract.php new file mode 100755 index 00000000000..340819f784b --- /dev/null +++ b/downloader/lib/Mage/Backup/Abstract.php @@ -0,0 +1,318 @@ +<?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_Backup + * @copyright 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 to work with archives + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Backup_Abstract implements Mage_Backup_Interface +{ + /** + * Backup name + * + * @var string + */ + protected $_name; + + /** + * Backup creation date + * + * @var int + */ + protected $_time; + + /** + * Backup file extension + * + * @var string + */ + protected $_backupExtension; + + /** + * Resource model + * + * @var object + */ + protected $_resourceModel; + + /** + * Magento's root directory + * + * @var string + */ + protected $_rootDir; + + /** + * Path to directory where backups stored + * + * @var string + */ + protected $_backupsDir; + + /** + * Is last operation completed successfully + * + * @var bool + */ + protected $_lastOperationSucceed = false; + + /** + * Last failed operation error message + * + * @var string + */ + protected $_lastErrorMessage; + + + /** + * Set Backup Extension + * + * @param string $backupExtension + * @return Mage_Backup_Interface + */ + public function setBackupExtension($backupExtension) + { + $this->_backupExtension = $backupExtension; + return $this; + } + + /** + * Get Backup Extension + * + * @return string + */ + public function getBackupExtension() + { + return $this->_backupExtension; + } + + /** + * Set Resource Model + * + * @param object $resourceModel + * @return Mage_Backup_Interface + */ + public function setResourceModel($resourceModel) + { + $this->_resourceModel = $resourceModel; + return $this; + } + + /** + * Get Resource Model + * + * @return object + */ + public function getResourceModel() + { + return $this->_resourceModel; + } + + /** + * Set Time + * + * @param int $time + * @return Mage_Backup_Interface + */ + public function setTime($time) + { + $this->_time = $time; + return $this; + } + + /** + * Get Time + * + * @return int + */ + public function getTime() + { + return $this->_time; + } + + /** + * Set root directory of Magento installation + * + * @param string $rootDir + * @throws Mage_Exception + * @return Mage_Backup_Interface + */ + public function setRootDir($rootDir) + { + if (!is_dir($rootDir)) { + throw new Mage_Exception('Bad root directory'); + } + + $this->_rootDir = $rootDir; + return $this; + } + + /** + * Get Magento's root directory + * @return string + */ + public function getRootDir() + { + return $this->_rootDir; + } + + /** + * Set path to directory where backups stored + * + * @param string $backupsDir + * @return Mage_Backup_Interface + */ + public function setBackupsDir($backupsDir) + { + $this->_backupsDir = $backupsDir; + return $this; + } + + /** + * Get path to directory where backups stored + * + * @return string + */ + public function getBackupsDir() + { + return $this->_backupsDir; + } + + /** + * Get path to backup + * + * @return string + */ + public function getBackupPath() + { + return $this->getBackupsDir() . DS . $this->getBackupFilename(); + } + + /** + * Get backup file name + * + * @return string + */ + public function getBackupFilename() + { + $filename = $this->getTime() . '_' . $this->getType(); + + $name = $this->getName(); + + if (!empty($name)) { + $filename .= '_' . $name; + } + + $filename .= '.' . $this->getBackupExtension(); + + return $filename; + } + + /** + * Check whether last operation completed successfully + * + * @return bool + */ + public function getIsSuccess() + { + return $this->_lastOperationSucceed; + } + + /** + * Get last error message + * + * @return string + */ + public function getErrorMessage() + { + return $this->_lastErrorMessage; + } + + /** + * Set error message + * + * @param string $errorMessage + * @return string + */ + public function setErrorMessage($errorMessage) + { + $this->_lastErrorMessage = $errorMessage; + } + + /** + * Set backup name + * + * @param string $name + * @param bool $applyFilter + * @return Mage_Backup_Interface + */ + public function setName($name, $applyFilter = true) + { + if ($applyFilter) { + $name = $this->_filterName($name); + } + $this->_name = $name; + return $this; + } + + /** + * Get backup name + * + * @return string + */ + public function getName() + { + return $this->_name; + } + + /** + * Get backup display name + * + * @return string + */ + public function getDisplayName() + { + return str_replace('_', ' ', $this->_name); + } + + /** + * Removes disallowed characters and replaces spaces with underscores + * + * @param string $name + * @return string + */ + protected function _filterName($name) + { + $name = trim(preg_replace('/[^\da-zA-Z ]/', '', $name)); + $name = preg_replace('/\s{2,}/', ' ', $name); + $name = str_replace(' ', '_', $name); + + return $name; + } +} diff --git a/downloader/lib/Mage/Backup/Archive/Tar.php b/downloader/lib/Mage/Backup/Archive/Tar.php new file mode 100644 index 00000000000..07e6c34a1e6 --- /dev/null +++ b/downloader/lib/Mage/Backup/Archive/Tar.php @@ -0,0 +1,82 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Extended version of Mage_Archive_Tar that supports filtering + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Archive_Tar extends Mage_Archive_Tar +{ + /** + * Filenames or filename parts that are used for filtering files + * + * @var array() + */ + protected $_skipFiles = array(); + + /** + * Overridden Mage_Archive_Tar::_createTar method that does the same actions as it's parent but filters + * files using Mage_Backup_Filesystem_Iterator_Filter + * + * @see Mage_Archive_Tar::_createTar() + * @param bool $skipRoot + * @param bool $finalize + */ + protected function _createTar($skipRoot = false, $finalize = false) + { + $path = $this->_getCurrentFile(); + + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $this->_skipFiles); + + foreach ($iterator as $item) { + $this->_setCurrentFile($item->getPathname()); + $this->_packAndWriteCurrentFile(); + } + + if ($finalize) { + $this->_getWriter()->write(str_repeat("\0", self::TAR_BLOCK_SIZE * 12)); + } + } + + /** + * Set files that shouldn't be added to tarball + * + * @param array $skipFiles + * @return Mage_Backup_Archive_Tar + */ + public function setSkipFiles(array $skipFiles) + { + $this->_skipFiles = $skipFiles; + return $this; + } +} diff --git a/downloader/lib/Mage/Backup/Db.php b/downloader/lib/Mage/Backup/Db.php new file mode 100755 index 00000000000..17912345396 --- /dev/null +++ b/downloader/lib/Mage/Backup/Db.php @@ -0,0 +1,129 @@ +<?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_Backup + * @copyright 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 to work with database backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Db extends Mage_Backup_Abstract +{ + /** + * Implementation Rollback functionality for Db + * + * @return bool + */ + public function rollback() + { + set_time_limit(0); + ignore_user_abort(true); + + $this->_lastOperationSucceed = false; + + $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 = ''; + } + } + fclose($file); + $this->getResourceModel()->commitTransaction(); + @unlink($source); + + $this->_lastOperationSucceed = true; + + return true; + } + + /** + * Check is line a last in sql command + * + * @param $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; + } + + /** + * Implementation Create Backup functionality for Db + * + * @return boolean + */ + public function create() + { + set_time_limit(0); + ignore_user_abort(true); + + $this->_lastOperationSucceed = false; + + $backup = Mage::getModel('Mage_Backup_Model_Backup') + ->setTime($this->getTime()) + ->setType($this->getType()) + ->setPath($this->getBackupsDir()) + ->setName($this->getName()); + + $backupDb = Mage::getModel('Mage_Backup_Model_Db'); + $backupDb->createBackup($backup); + + $this->_lastOperationSucceed = true; + + return true; + } + + /** + * Get Backup Type + * + * @return string + */ + public function getType() + { + return "db"; + } +} diff --git a/downloader/lib/Mage/Backup/Exception.php b/downloader/lib/Mage/Backup/Exception.php new file mode 100755 index 00000000000..c92f1346347 --- /dev/null +++ b/downloader/lib/Mage/Backup/Exception.php @@ -0,0 +1,36 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception extends Mage_Exception +{ +} diff --git a/downloader/lib/Mage/Backup/Exception/CantLoadSnapshot.php b/downloader/lib/Mage/Backup/Exception/CantLoadSnapshot.php new file mode 100755 index 00000000000..98ed8f6f191 --- /dev/null +++ b/downloader/lib/Mage/Backup/Exception/CantLoadSnapshot.php @@ -0,0 +1,36 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_CantLoadSnapshot extends Mage_Backup_Exception +{ +} diff --git a/downloader/lib/Mage/Backup/Exception/FtpConnectionFailed.php b/downloader/lib/Mage/Backup/Exception/FtpConnectionFailed.php new file mode 100755 index 00000000000..cd6aa9b6905 --- /dev/null +++ b/downloader/lib/Mage/Backup/Exception/FtpConnectionFailed.php @@ -0,0 +1,36 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_FtpConnectionFailed extends Mage_Backup_Exception +{ +} diff --git a/downloader/lib/Mage/Backup/Exception/FtpValidationFailed.php b/downloader/lib/Mage/Backup/Exception/FtpValidationFailed.php new file mode 100755 index 00000000000..acc4c9e72a8 --- /dev/null +++ b/downloader/lib/Mage/Backup/Exception/FtpValidationFailed.php @@ -0,0 +1,36 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_FtpValidationFailed extends Mage_Backup_Exception +{ +} diff --git a/downloader/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php b/downloader/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php new file mode 100755 index 00000000000..21e56a19911 --- /dev/null +++ b/downloader/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php @@ -0,0 +1,36 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_NotEnoughFreeSpace extends Mage_Backup_Exception +{ +} diff --git a/downloader/lib/Mage/Backup/Exception/NotEnoughPermissions.php b/downloader/lib/Mage/Backup/Exception/NotEnoughPermissions.php new file mode 100755 index 00000000000..001d1a907aa --- /dev/null +++ b/downloader/lib/Mage/Backup/Exception/NotEnoughPermissions.php @@ -0,0 +1,36 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_NotEnoughPermissions extends Mage_Backup_Exception +{ +} diff --git a/downloader/lib/Mage/Backup/Filesystem.php b/downloader/lib/Mage/Backup/Filesystem.php new file mode 100755 index 00000000000..b366f762b03 --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem.php @@ -0,0 +1,283 @@ +<?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_Backup + * @copyright 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 to work with filesystem backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem extends Mage_Backup_Abstract +{ + /** + * Paths that ignored when creating or rolling back snapshot + * + * @var array + */ + protected $_ignorePaths = array(); + + /** + * Whether use ftp account for rollback procedure + * + * @var bool + */ + protected $_useFtp = false; + + /** + * Ftp host + * + * @var string + */ + protected $_ftpHost; + + /** + * Ftp username + * + * @var string + */ + protected $_ftpUser; + + /** + * Password to ftp account + * + * @var string + */ + protected $_ftpPass; + + /** + * Ftp path to Magento installation + * + * @var string + */ + protected $_ftpPath; + + /** + * Implementation Rollback functionality for Filesystem + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $this->_lastOperationSucceed = false; + + set_time_limit(0); + ignore_user_abort(true); + + $rollbackWorker = $this->_useFtp ? new Mage_Backup_Filesystem_Rollback_Ftp($this) + : new Mage_Backup_Filesystem_Rollback_Fs($this); + $rollbackWorker->run(); + + $this->_lastOperationSucceed = true; + } + + /** + * Implementation Create Backup functionality for Filesystem + * + * @throws Mage_Exception + * @return boolean + */ + public function create() + { + set_time_limit(0); + ignore_user_abort(true); + + $this->_lastOperationSucceed = false; + + $this->_checkBackupsDir(); + + $fsHelper = new Mage_Backup_Filesystem_Helper(); + + $filesInfo = $fsHelper->getInfo( + $this->getRootDir(), + Mage_Backup_Filesystem_Helper::INFO_READABLE | Mage_Backup_Filesystem_Helper::INFO_SIZE, + $this->getIgnorePaths() + ); + + if (!$filesInfo['readable']) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Not enough permissions to read files for backup'); + } + + $freeSpace = disk_free_space($this->getBackupsDir()); + + if (2 * $filesInfo['size'] > $freeSpace) { + throw new Mage_Backup_Exception_NotEnoughFreeSpace('Not enough free space to create backup'); + } + + $tarTmpPath = $this->_getTarTmpPath(); + + $tarPacker = new Mage_Backup_Archive_Tar(); + $tarPacker->setSkipFiles($this->getIgnorePaths()) + ->pack($this->getRootDir(), $tarTmpPath, true); + + if (!is_file($tarTmpPath) || filesize($tarTmpPath) == 0) { + throw new Mage_Exception('Failed to create backup'); + } + + $backupPath = $this->getBackupPath(); + + $gzPacker = new Mage_Archive_Gz(); + $gzPacker->pack($tarTmpPath, $backupPath); + + if (!is_file($backupPath) || filesize($backupPath) == 0) { + throw new Mage_Exception('Failed to create backup'); + } + + @unlink($tarTmpPath); + + $this->_lastOperationSucceed = true; + } + + /** + * Force class to use ftp for rollback procedure + * + * @param string $host + * @param string $username + * @param string $password + * @param string $path + * @return Mage_Backup_Filesystem + */ + public function setUseFtp($host, $username, $password, $path) + { + $this->_useFtp = true; + $this->_ftpHost = $host; + $this->_ftpUser = $username; + $this->_ftpPass = $password; + $this->_ftpPath = $path; + return $this; + } + + /** + * Get backup type + * + * @see Mage_Backup_Interface::getType() + * @return string + */ + public function getType() + { + return 'filesystem'; + } + + /** + * Add path that should be ignoring when creating or rolling back backup + * + * @param string|array $paths + * @return Mage_Backup_Filesystem + */ + public function addIgnorePaths($paths) + { + if (is_string($paths)) { + if (!in_array($paths, $this->_ignorePaths)) { + $this->_ignorePaths[] = $paths; + } + } + else if (is_array($paths)) { + foreach ($paths as $path) { + $this->addIgnorePaths($path); + } + } + + return $this; + } + + /** + * Get paths that should be ignored while creating or rolling back backup procedure + * + * @return array + */ + public function getIgnorePaths() + { + return $this->_ignorePaths; + } + + /** + * Set directory where backups saved and add it to ignore paths + * + * @see Mage_Backup_Abstract::setBackupsDir() + * @param string $backupsDir + * @return Mage_Backup_Filesystem + */ + public function setBackupsDir($backupsDir) + { + parent::setBackupsDir($backupsDir); + $this->addIgnorePaths($backupsDir); + return $this; + } + + /** + * getter for $_ftpPath variable + * + * @return string + */ + public function getFtpPath() + { + return $this->_ftpPath; + } + + /** + * Get ftp connection string + * + * @return string + */ + public function getFtpConnectString() + { + return 'ftp://' . $this->_ftpUser . ':' . $this->_ftpPass . '@' . $this->_ftpHost . $this->_ftpPath; + } + + /** + * Check backups directory existance and whether it's writeable + * + * @throws Mage_Exception + */ + protected function _checkBackupsDir() + { + $backupsDir = $this->getBackupsDir(); + + if (!is_dir($backupsDir)) { + $backupsDirParentDirectory = basename($backupsDir); + + if (!is_writeable($backupsDirParentDirectory)) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Cant create backups directory'); + } + + mkdir($backupsDir); + chmod($backupsDir, 0777); + } + + if (!is_writable($backupsDir)) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Backups directory is not writeable'); + } + } + + /** + * Generate tmp name for tarball + */ + protected function _getTarTmpPath() + { + $tmpName = '~tmp-'. microtime(true) . '.tar'; + return $this->getBackupsDir() . DS . $tmpName; + } +} diff --git a/downloader/lib/Mage/Backup/Filesystem/Helper.php b/downloader/lib/Mage/Backup/Filesystem/Helper.php new file mode 100755 index 00000000000..c62c4a0adf7 --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem/Helper.php @@ -0,0 +1,137 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Filesystem helper for Mage_Backup library + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Helper +{ + /** + * Constant can be used in getInfo() function as second parameter. + * Check whether directory and all files/sub directories are writable + * + * @const int + */ + const INFO_WRITABLE = 1; + + /** + * Constant can be used in getInfo() function as second parameter. + * Check whether directory and all files/sub directories are readable + * + * @const int + */ + const INFO_READABLE = 2; + + /** + * Constant can be used in getInfo() function as second parameter. + * Get directory size + * + * @const int + */ + const INFO_SIZE = 4; + + /** + * Constant can be used in getInfo() function as second parameter. + * Combination of INFO_WRITABLE, INFO_READABLE, INFO_SIZE + * + * @const int + */ + const INFO_ALL = 7; + + /** + * Recursively delete $path + * + * @param string $path + * @param array $skipPaths + * @param bool $removeRoot + * @throws Mage_Exception + */ + public function rm($path, $skipPaths = array(), $removeRoot = false) + { + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::CHILD_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $skipPaths); + + foreach ($iterator as $item) { + $item->isDir() ? @rmdir($item->__toString()) : @unlink($item->__toString()); + } + + if ($removeRoot && is_dir($path)) { + @rmdir($path); + } + } + + /** + * Get information (readable, writable, size) about $path + * + * @param string $path + * @param int $infoOptions + * @param array $skipFiles + */ + public function getInfo($path, $infoOptions = self::INFO_ALL, $skipFiles = array()) + { + $info = array(); + if ($infoOptions & self::INFO_READABLE) { + $info['readable'] = true; + } + + if ($infoOptions & self::INFO_WRITABLE) { + $info['writable'] = true; + } + + if ($infoOptions & self::INFO_SIZE) { + $info['size'] = 0; + } + + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::CHILD_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $skipFiles); + + foreach ($iterator as $item) { + if (($infoOptions & self::INFO_WRITABLE) && !$item->isWritable()) { + $info['writable'] = false; + } + + if (($infoOptions & self::INFO_READABLE) && !$item->isReadable()) { + $info['readable'] = false; + } + + if ($infoOptions & self::INFO_SIZE && !$item->isDir()) { + $info['size'] += $item->getSize(); + } + } + + return $info; + } +} diff --git a/downloader/lib/Mage/Backup/Filesystem/Iterator/Filter.php b/downloader/lib/Mage/Backup/Filesystem/Iterator/Filter.php new file mode 100755 index 00000000000..40ae6f053ba --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem/Iterator/Filter.php @@ -0,0 +1,77 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Filter Iterator + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Iterator_Filter extends FilterIterator +{ + /** + * Array that is used for filtering + * + * @var array + */ + protected $_filters; + + /** + * Constructor + * + * @param Iterator $iterator + * @param array $skipFiles + */ + public function __construct(Iterator $iterator, array $filters) + { + parent::__construct($iterator); + $this->_filters = $filters; + } + + /** + * Check whether the current element of the iterator is acceptable + * + * @return bool + */ + public function accept() + { + $current = $this->current()->__toString(); + $currentFilename = $this->current()->getFilename(); + + if ($currentFilename == '.' || $currentFilename == '..') { + return false; + } + + foreach ($this->_filters as $filter) { + if (false !== strpos($current, $filter)) { + return false; + } + } + + return true; + } +} diff --git a/downloader/lib/Mage/Backup/Filesystem/Rollback/Abstract.php b/downloader/lib/Mage/Backup/Filesystem/Rollback/Abstract.php new file mode 100755 index 00000000000..134b5fdb698 --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem/Rollback/Abstract.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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Filesystem rollback workers abstract class + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Backup_Filesystem_Rollback_Abstract +{ + /** + * Snapshot object + * + * @var Mage_Backup_Filesystem + */ + protected $_snapshot; + + /** + * Default worker constructor + * + * @param Mage_Backup_Filesystem $snapshotObject + */ + public function __construct(Mage_Backup_Filesystem $snapshotObject) + { + $this->_snapshot = $snapshotObject; + } + + /** + * Main worker's function that makes files rollback + */ + abstract public function run(); +} diff --git a/downloader/lib/Mage/Backup/Filesystem/Rollback/Fs.php b/downloader/lib/Mage/Backup/Filesystem/Rollback/Fs.php new file mode 100755 index 00000000000..a98b89e687b --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem/Rollback/Fs.php @@ -0,0 +1,78 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Rollback worker for rolling back via local filesystem + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Rollback_Fs extends Mage_Backup_Filesystem_Rollback_Abstract +{ + /** + * Files rollback implementation via local filesystem + * + * @see Mage_Backup_Filesystem_Rollback_Abstract::run() + * @throws Mage_Exception + */ + public function run() + { + $snapshotPath = $this->_snapshot->getBackupPath(); + + if (!is_file($snapshotPath) || !is_readable($snapshotPath)) { + throw new Mage_Backup_Exception_CantLoadSnapshot('Cant load snapshot archive'); + } + + $fsHelper = new Mage_Backup_Filesystem_Helper(); + + $filesInfo = $fsHelper->getInfo( + $this->_snapshot->getRootDir(), + Mage_Backup_Filesystem_Helper::INFO_WRITABLE, + $this->_snapshot->getIgnorePaths() + ); + + if (!$filesInfo['writable']) { + throw new Mage_Backup_Exception_NotEnoughPermissions( + 'Unable to make rollback because not all files are writable' + ); + } + + $archiver = new Mage_Archive(); + + /** + * we need these fake initializations because all magento's files in filesystem will be deleted and autoloader + * wont be able to load classes that we need for unpacking + */ + new Mage_Archive_Tar(); + new Mage_Archive_Gz(); + new Mage_Archive_Helper_File(''); + new Mage_Archive_Helper_File_Gz(''); + + $fsHelper->rm($this->_snapshot->getRootDir(), $this->_snapshot->getIgnorePaths()); + $archiver->unpack($snapshotPath, $this->_snapshot->getRootDir()); + } +} diff --git a/downloader/lib/Mage/Backup/Filesystem/Rollback/Ftp.php b/downloader/lib/Mage/Backup/Filesystem/Rollback/Ftp.php new file mode 100755 index 00000000000..5a1806742c2 --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem/Rollback/Ftp.php @@ -0,0 +1,194 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Rollback worker for rolling back via ftp + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Rollback_Ftp extends Mage_Backup_Filesystem_Rollback_Abstract +{ + /** + * Ftp client + * + * @var Mage_System_Ftp + */ + protected $_ftpClient; + + /** + * Files rollback implementation via ftp + * + * @see Mage_Backup_Filesystem_Rollback_Abstract::run() + * @throws Mage_Exception + */ + public function run() + { + $snapshotPath = $this->_snapshot->getBackupPath(); + + if (!is_file($snapshotPath) || !is_readable($snapshotPath)) { + throw new Mage_Backup_Exception_CantLoadSnapshot('Cant load snapshot archive'); + } + + $this->_initFtpClient(); + $this->_validateFtp(); + + $tmpDir = $this->_createTmpDir(); + $this->_unpackSnapshot($tmpDir); + + $fsHelper = new Mage_Backup_Filesystem_Helper(); + + $this->_cleanupFtp(); + $this->_uploadBackupToFtp($tmpDir); + + $fsHelper->rm($tmpDir, array(), true); + } + + /** + * Initialize ftp client and connect to ftp + * + * @throws Mage_Backup_Exception_FtpConnectionFailed + */ + protected function _initFtpClient() + { + try { + $this->_ftpClient = new Mage_System_Ftp(); + $this->_ftpClient->connect($this->_snapshot->getFtpConnectString()); + } catch (Exception $e) { + throw new Mage_Backup_Exception_FtpConnectionFailed($e->getMessage()); + } + } + + /** + * Perform ftp validation. Check whether ftp account provided points to current magento installation + * + * @throws Mage_Exception + */ + protected function _validateFtp() + { + $validationFilename = '~validation-' . microtime(true) . '.tmp'; + $validationFilePath = $this->_snapshot->getBackupsDir() . DS . $validationFilename; + + $fh = @fopen($validationFilePath, 'w'); + @fclose($fh); + + if (!is_file($validationFilePath)) { + throw new Mage_Exception('Unable to validate ftp account'); + } + + $rootDir = $this->_snapshot->getRootDir(); + $ftpPath = $this->_snapshot->getFtpPath() . DS . str_replace($rootDir, '', $validationFilePath); + + $fileExistsOnFtp = $this->_ftpClient->fileExists($ftpPath); + @unlink($validationFilePath); + + if (!$fileExistsOnFtp) { + throw new Mage_Backup_Exception_FtpValidationFailed('Failed to validate ftp account'); + } + } + + /** + * Unpack snapshot + * + * @param string $tmpDir + */ + protected function _unpackSnapshot($tmpDir) + { + $snapshotPath = $this->_snapshot->getBackupPath(); + + $archiver = new Mage_Archive(); + $archiver->unpack($snapshotPath, $tmpDir); + } + + /** + * @throws Mage_Exception + * @return string + */ + protected function _createTmpDir() + { + $tmpDir = $this->_snapshot->getBackupsDir() . DS . '~tmp-' . microtime(true); + + $result = @mkdir($tmpDir); + + if (false === $result) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Failed to create directory ' . $tmpDir); + } + + return $tmpDir; + } + + /** + * Delete magento and all files from ftp + */ + protected function _cleanupFtp() + { + $rootDir = $this->_snapshot->getRootDir(); + + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($rootDir), RecursiveIteratorIterator::CHILD_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $this->_snapshot->getIgnorePaths()); + + foreach ($iterator as $item) { + $ftpPath = $this->_snapshot->getFtpPath() . DS . str_replace($rootDir, '', $item->__toString()); + $ftpPath = str_replace(DS, '/', $ftpPath); + + $this->_ftpClient->delete($ftpPath); + } + } + + /** + * Perform files rollback + * + * @param string $tmpDir + * @throws Mage_Exception + */ + protected function _uploadBackupToFtp($tmpDir) + { + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($tmpDir), RecursiveIteratorIterator::SELF_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $this->_snapshot->getIgnorePaths()); + + foreach ($filesystemIterator as $item) { + $ftpPath = $this->_snapshot->getFtpPath() . DS . str_replace($tmpDir, '', $item->__toString()); + $ftpPath = str_replace(DS, '/', $ftpPath); + + if ($item->isDir()) { + $this->_ftpClient->mkdirRecursive($ftpPath); + } else { + $result = $this->_ftpClient->put($ftpPath, $item->__toString()); + if (false === $result) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Failed to upload file ' + . $item->__toString() . ' to ftp'); + } + } + } + } +} diff --git a/downloader/lib/Mage/Backup/Interface.php b/downloader/lib/Mage/Backup/Interface.php new file mode 100755 index 00000000000..46cf6eeaac7 --- /dev/null +++ b/downloader/lib/Mage/Backup/Interface.php @@ -0,0 +1,88 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Interface for work with archives + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +interface Mage_Backup_Interface +{ + /** + * Create Backup + * + * @return boolean + */ + public function create(); + + /** + * Rollback Backup + * + * @return boolean + */ + public function rollback(); + + /** + * Set Backup Extension + * + * @param string $backupExtension + * @return Mage_Backup_Interface + */ + public function setBackupExtension($backupExtension); + + /** + * Set Resource Model + * + * @param object $resourceModel + * @return Mage_Backup_Interface + */ + public function setResourceModel($resourceModel); + + /** + * Set Time + * + * @param int $time + * @return Mage_Backup_Interface + */ + public function setTime($time); + + /** + * Get Backup Type + * + * @return string + */ + public function getType(); + + /** + * Set path to directory where backups stored + * + * @param string $backupsDir + * @return Mage_Backup_Interface + */ + public function setBackupsDir($backupsDir); +} diff --git a/downloader/lib/Mage/Backup/Media.php b/downloader/lib/Mage/Backup/Media.php new file mode 100644 index 00000000000..a6014d44c80 --- /dev/null +++ b/downloader/lib/Mage/Backup/Media.php @@ -0,0 +1,99 @@ +<?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_Backup + * @copyright 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 to work media folder and database backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Media extends Mage_Backup_Snapshot +{ + /** + * Implementation Rollback functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $this->_prepareIgnoreList(); + return parent::rollback(); + } + + /** + * Implementation Create Backup functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function create() + { + $this->_prepareIgnoreList(); + return parent::create(); + } + + /** + * Overlap getType + * + * @return string + * @see Mage_Backup_Interface::getType() + */ + public function getType() + { + return 'media'; + } + + /** + * Add all folders and files except media and db backup to ignore list + * + * @return Mage_Backup_Media + */ + protected function _prepareIgnoreList() + { + $iterator = new DirectoryIterator($this->getRootDir()); + + foreach ($iterator as $item) { + $filename = $item->getFilename(); + if (!in_array($filename, array('media', 'var'))) { + $this->addIgnorePaths($item->getPathname()); + } + } + + $iterator = new DirectoryIterator($this->getRootDir() . DS . 'var'); + $dbBackupFilename = $this->_getDbBackupManager()->getBackupFilename(); + + foreach ($iterator as $item) { + $filename = $item->getFilename(); + if ($filename != $dbBackupFilename) { + $this->addIgnorePaths($item->getPathname()); + } + } + + return $this; + } +} diff --git a/downloader/lib/Mage/Backup/Nomedia.php b/downloader/lib/Mage/Backup/Nomedia.php new file mode 100755 index 00000000000..81c48565603 --- /dev/null +++ b/downloader/lib/Mage/Backup/Nomedia.php @@ -0,0 +1,82 @@ +<?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_Backup + * @copyright 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 to work system backup that excludes media folder + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Nomedia extends Mage_Backup_Snapshot +{ + /** + * Implementation Rollback functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $this->_prepareIgnoreList(); + return parent::rollback(); + } + + /** + * Implementation Create Backup functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function create() + { + $this->_prepareIgnoreList(); + return parent::create(); + } + + /** + * Overlap getType + * + * @return string + * @see Mage_Backup_Interface::getType() + */ + public function getType() + { + return 'nomedia'; + } + + /** + * Add media folder to ignore list + * + * @return Mage_Backup_Media + */ + protected function _prepareIgnoreList() + { + $this->addIgnorePaths($this->getRootDir() . DS . 'media'); + + return $this; + } +} \ No newline at end of file diff --git a/downloader/lib/Mage/Backup/Snapshot.php b/downloader/lib/Mage/Backup/Snapshot.php new file mode 100755 index 00000000000..8b539b791b8 --- /dev/null +++ b/downloader/lib/Mage/Backup/Snapshot.php @@ -0,0 +1,140 @@ +<?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_Backup + * @copyright 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 to work with full filesystem and database backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Snapshot extends Mage_Backup_Filesystem +{ + /** + * Database backup manager + * + * @var Mage_Backup_Db + */ + protected $_dbBackupManager; + + /** + * Implementation Rollback functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $result = parent::rollback(); + + $this->_lastOperationSucceed = false; + + try { + $this->_getDbBackupManager()->rollback(); + } catch (Exception $e) { + $this->_removeDbBackup(); + throw $e; + } + + $this->_removeDbBackup(); + $this->_lastOperationSucceed = true; + + return $result; + } + + /** + * Implementation Create Backup functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function create() + { + $this->_getDbBackupManager()->create(); + + try { + $result = parent::create(); + } catch (Exception $e) { + $this->_removeDbBackup(); + throw $e; + } + + $this->_lastOperationSucceed = false; + $this->_removeDbBackup(); + $this->_lastOperationSucceed = true; + + return $result; + } + + /** + * Overlap getType + * + * @return string + * @see Mage_Backup_Interface::getType() + */ + public function getType() + { + return 'snapshot'; + } + + /** + * Create Db Instance + * + * @return Mage_Backup_Interface + */ + protected function _createDbBackupInstance() + { + return Mage_Backup::getBackupInstance(Mage_Backup_Helper_Data::TYPE_DB) + ->setBackupExtension(Mage::helper('Mage_Backup_Helper_Data')->getExtensionByType(Mage_Backup_Helper_Data::TYPE_DB)) + ->setTime($this->getTime()) + ->setBackupsDir(Mage::getBaseDir("var")) + ->setResourceModel($this->getResourceModel()); + } + + /** + * Get database backup manager + * + * @return Mage_Backup_Db + */ + protected function _getDbBackupManager() + { + if (is_null($this->_dbBackupManager)) { + $this->_dbBackupManager = $this->_createDbBackupInstance(); + } + + return $this->_dbBackupManager; + } + + /** + * Remove Db backup after added it to the snapshot + * + * @return Mage_Backup_Snapshot + */ + protected function _removeDbBackup(){ + @unlink($this->_getDbBackupManager()->getBackupPath()); + return $this; + } +} diff --git a/downloader/lib/Mage/Connect/Channel/Generator.php b/downloader/lib/Mage/Connect/Channel/Generator.php index 73563fc62d8..8870dc046e8 100644 --- a/downloader/lib/Mage/Connect/Channel/Generator.php +++ b/downloader/lib/Mage/Connect/Channel/Generator.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/downloader/lib/Mage/Connect/Channel/Parser.php b/downloader/lib/Mage/Connect/Channel/Parser.php index f9e05c347ec..faa86fc9582 100644 --- a/downloader/lib/Mage/Connect/Channel/Parser.php +++ b/downloader/lib/Mage/Connect/Channel/Parser.php @@ -20,6 +20,6 @@ * * @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/downloader/lib/Mage/Connect/Channel/VO.php b/downloader/lib/Mage/Connect/Channel/VO.php index 165ea6ee70e..9ad4160b266 100644 --- a/downloader/lib/Mage/Connect/Channel/VO.php +++ b/downloader/lib/Mage/Connect/Channel/VO.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/downloader/lib/Mage/Connect/Command.php b/downloader/lib/Mage/Connect/Command.php index e8090ecc38d..191fb2e605b 100644 --- a/downloader/lib/Mage/Connect/Command.php +++ b/downloader/lib/Mage/Connect/Command.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/downloader/lib/Mage/Connect/Command/Channels.php b/downloader/lib/Mage/Connect/Command/Channels.php index 483a8559925..1ed6edfea9c 100644 --- a/downloader/lib/Mage/Connect/Command/Channels.php +++ b/downloader/lib/Mage/Connect/Command/Channels.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/downloader/lib/Mage/Connect/Command/Channels_Header.php b/downloader/lib/Mage/Connect/Command/Channels_Header.php index dba6b6bec3f..69d03141239 100644 --- a/downloader/lib/Mage/Connect/Command/Channels_Header.php +++ b/downloader/lib/Mage/Connect/Command/Channels_Header.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/downloader/lib/Mage/Connect/Command/Config.php b/downloader/lib/Mage/Connect/Command/Config.php index f7023e1323a..2f4972c8d74 100644 --- a/downloader/lib/Mage/Connect/Command/Config.php +++ b/downloader/lib/Mage/Connect/Command/Config.php @@ -20,19 +20,26 @@ * * @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) */ - -class Mage_Connect_Command_Config -extends Mage_Connect_Command - +/** + * Configuration command callbacks + * + * @throws Exception + * @category Mage + * @package Mage_Connect + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Connect_Command_Config extends Mage_Connect_Command { + /** + * Parameters constants + */ const PARAM_KEY = 0; const PARAM_VAL = 1; - /** * Show config variable * @param string $command @@ -70,7 +77,6 @@ extends Mage_Connect_Command } } - /** * Set config variable * @param string $command @@ -207,7 +213,4 @@ extends Mage_Connect_Command return $this->doError($command, $e->getMessage()); } } - } - - diff --git a/downloader/lib/Mage/Connect/Command/Config_Header.php b/downloader/lib/Mage/Connect/Command/Config_Header.php index c812b30079e..c763068dca1 100644 --- a/downloader/lib/Mage/Connect/Command/Config_Header.php +++ b/downloader/lib/Mage/Connect/Command/Config_Header.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/downloader/lib/Mage/Connect/Command/Install.php b/downloader/lib/Mage/Connect/Command/Install.php index 4253781bf88..bfaf88acd87 100644 --- a/downloader/lib/Mage/Connect/Command/Install.php +++ b/downloader/lib/Mage/Connect/Command/Install.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) */ final class Mage_Connect_Command_Install extends Mage_Connect_Command @@ -28,9 +28,11 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command /** * Install action callback * + * @throws Exception * @param string $command * @param array $options * @param array $params + * @param array $objects * @return array|null */ public function doInstall($command, $options, $params, $objects = array()) @@ -46,7 +48,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $packager = $this->getPackager(); /** @var $cache Mage_Connect_Singleconfig */ /** @var $config Mage_Connect_Config */ - if($ftp) { + if ($ftp) { list($cache, $config, $ftpObj) = $packager->getRemoteConf($ftp); } else { $cache = $this->getSconfig(); @@ -65,7 +67,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $channelAuth = isset($options['auth'])?$options['auth']:array(); $rest = $this->rest(); - if(empty($config->magento_root)){ + if (empty($config->magento_root)) { $config->magento_root=dirname(dirname($_SERVER['SCRIPT_FILENAME'])); } chdir($config->magento_root); @@ -74,7 +76,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $dirTmp = DIRECTORY_SEPARATOR . Mage_Connect_Package_Reader::PATH_TO_TEMPORARY_DIRECTORY; $dirMedia = DIRECTORY_SEPARATOR . 'media'; $isWritable = true; - if($ftp) { + if ($ftp) { $cwd=$ftpObj->getcwd(); $ftpObj->mkdirRecursive($cwd . $dirCache,0777); $ftpObj->chdir($cwd); @@ -97,25 +99,25 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $isWritable = $isWritable && is_writable($config->magento_root . $dirMedia) && is_writable($config->magento_root . $dirCache) && is_writable($config->magento_root . $dirTmp); - if(!$isWritable){ + if (!$isWritable) { $this->doError($command, $err); throw new Exception( 'Your Magento folder does not have sufficient write permissions, which downloader requires.' ); } - if(!empty($channelAuth)){ + if (!empty($channelAuth)) { $rest->getLoader()->setCredentials($channelAuth['username'], $channelAuth['password']); } - if($installFileMode) { - if(count($params) < 1) { + if ($installFileMode) { + if (count($params) < 1) { throw new Exception("Argument should be: filename"); } $filename = $params[0]; - if(!@file_exists($filename)) { + if (!@file_exists($filename)) { throw new Exception("File '{$filename}' not found"); } - if(!@is_readable($filename)) { + if (!@is_readable($filename)) { throw new Exception("File '{$filename}' is not readable"); } @@ -123,8 +125,8 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $package->setConfig($config); $package->validate(); $errors = $package->getErrors(); - if(count($errors)) { - throw new Exception("Package file is invalid\n".implode("\n", $errors)); + if (count($errors)) { + throw new Exception("Package file is invalid\n" . implode("\n", $errors)); } $pChan = $package->getChannel(); @@ -138,20 +140,20 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $conflicts = $cache->hasConflicts($pChan, $pName, $pVer); - if(false !== $conflicts) { + if (false !== $conflicts) { $conflicts = implode(", ",$conflicts); - if($forceMode) { - $this->doError($command, "Package {$pChan}/{$pName} {$pVer} conflicts with: ".$conflicts); + if ($forceMode) { + $this->doError($command, "Package {$pChan}/{$pName} {$pVer} conflicts with: " . $conflicts); } else { - throw new Exception("Package {$pChan}/{$pName} {$pVer} conflicts with: ".$conflicts); + throw new Exception("Package {$pChan}/{$pName} {$pVer} conflicts with: " . $conflicts); } } $conflicts = $package->checkPhpDependencies(); - if(true !== $conflicts) { - $confilcts = implode(",",$conflicts); - $err = "Package {$pChan}/{$pName} {$pVer} depends on PHP extensions: ".$conflicts; - if($forceMode) { + if (true !== $conflicts) { + $conflicts = implode(",",$conflicts); + $err = "Package {$pChan}/{$pName} {$pVer} depends on PHP extensions: " . $conflicts; + if ($forceMode) { $this->doError($command, $err); } else { throw new Exception($err); @@ -159,17 +161,17 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command } $conflicts = $package->checkPhpVersion(); - if(true !== $conflicts) { - $err = "Package {$pChan}/{$pName} {$pVer}: ".$conflicts; - if($forceMode) { + if (true !== $conflicts) { + $err = "Package {$pChan}/{$pName} {$pVer}: " . $conflicts; + if ($forceMode) { $this->doError($command, $err); } else { throw new Exception($err); } } - if(!$noFilesInstall) { - if($ftp) { + if (!$noFilesInstall) { + if ($ftp) { $packager->processInstallPackageFtp($package, $filename, $config, $ftpObj); } else { $packager->processInstallPackage($package, $filename, $config); @@ -184,7 +186,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $title = isset($options['title']) ? $options['title'] : "Package installed: "; $out = array($command => array('data'=>$installedDeps, 'assoc'=>$installedDepsAssoc, 'title'=>$title)); - if($ftp) { + if ($ftp) { $packager->writeToRemoteCache($cache, $ftpObj); @unlink($config->getFilename()); } @@ -193,8 +195,8 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command return $out[$command]['data']; } - if(!$upgradeAllMode) { - if(count($params) < 2) { + if (!$upgradeAllMode) { + if (count($params) < 2) { throw new Exception("Argument should be: channelName packageName"); } $channel = $params[0]; @@ -211,37 +213,37 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command /* * process 'failed' results */ - if(count($packagesToInstall['failed'])) { + if (count($packagesToInstall['failed'])) { $showError=!count($packagesToInstall['result']); - foreach($packagesToInstall['failed'] as $failed){ - $msg="Package {$failed['channel']}/{$failed['name']} failed: ".$failed['reason']; - if($showError){ + foreach ($packagesToInstall['failed'] as $failed) { + $msg="Package {$failed['channel']}/{$failed['name']} failed: " . $failed['reason']; + if ($showError) { $this->doError($command, $msg); - }else{ + } else { $this->ui()->output($msg); } } } $packagesToInstall = $packagesToInstall['result']; } else { - if(empty($params[0])) { + if (empty($params[0])) { $channels = $cache->getChannelNames(); } else { $channel = $params[0]; - if(!$cache->isChannel($channel)) { + if (!$cache->isChannel($channel)) { throw new Exception("'{$channel}' is not existant channel name / valid uri"); } $channels = $cache->chanName($channel); } $packagesToInstall = array(); $neededToUpgrade = $packager->getUpgradesList($channels, $cache, $config, $rest); - foreach($neededToUpgrade as $chan=>$packages) { - foreach($packages as $name=>$data) { + foreach ($neededToUpgrade as $chan=>$packages) { + foreach ($packages as $name=>$data) { $versionTo = $data['to']; $tmp = $packager->getDependenciesList($chan, $name, $cache, $config, $versionTo, $versionTo, $withDepsMode, false, $rest ); - if(count($tmp['result'])) { + if (count($tmp['result'])) { $packagesToInstall = array_merge($packagesToInstall, $tmp['result']); } } @@ -254,7 +256,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $installedDeps = array(); $installedDepsAssoc = array(); - foreach($packagesToInstall as $package) { + foreach ($packagesToInstall as $package) { try { $pName = $package['name']; $pChan = $package['channel']; @@ -272,7 +274,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command continue; } - if('incompartible' == $pInstallState) { + if ('incompartible' == $pInstallState) { $this->ui()->output( "Package incompartible with installed Magento: {$pChan}/{$pName} {$pVer}, skipping" ); @@ -281,12 +283,12 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $conflicts = $cache->hasConflicts($pChan, $pName, $pVer); - if(false !== $conflicts) { + if (false !== $conflicts) { $conflicts = implode(", ",$conflicts); - if($forceMode) { - $this->doError($command, "Package {$pChan}/{$pName} {$pVer} conflicts with: ".$conflicts); + if ($forceMode) { + $this->doError($command, "Package {$pChan}/{$pName} {$pVer} conflicts with: " . $conflicts); } else { - throw new Exception("Package {$pChan}/{$pName} {$pVer} conflicts with: ".$conflicts); + throw new Exception("Package {$pChan}/{$pName} {$pVer} conflicts with: " . $conflicts); } } @@ -294,7 +296,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command * Modifications */ if (($upgradeMode || ($pInstallState == 'upgrade')) && !$ignoreModifiedMode) { - if($ftp) { + if ($ftp) { $modifications = $packager->getRemoteModifiedFiles($pChan, $pName, $cache, $config, $ftp); } else { $modifications = $packager->getLocalModifiedFiles($pChan, $pName, $cache, $config); @@ -302,8 +304,8 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command if (count($modifications) > 0) { $this->ui()->output('Changed locally: '); foreach ($modifications as $row) { - if(!$ftp) { - $this->ui()->output($config->magento_root.DS.$row); + if (!$ftp) { + $this->ui()->output($config->magento_root . DS . $row); } else { $this->ui()->output($row); } @@ -311,7 +313,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command } } - if($ftp) { + if ($ftp) { $cwd=$ftpObj->getcwd(); $dir=$cwd . DIRECTORY_SEPARATOR .$config->downloader_path . DIRECTORY_SEPARATOR . Mage_Connect_Config::DEFAULT_CACHE_PATH . DIRECTORY_SEPARATOR . trim( $pChan, "\\/"); @@ -322,9 +324,9 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command @mkdir($dir, 0777, true); } $dir = $config->getChannelCacheDir($pChan); - $packageFileName = $pName."-".$pVer.".tgz"; - $file = $dir.DIRECTORY_SEPARATOR.$packageFileName; - if(!@file_exists($file)) { + $packageFileName = $pName . "-" . $pVer . ".tgz"; + $file = $dir . DIRECTORY_SEPARATOR . $packageFileName; + if (!@file_exists($file)) { $this->ui()->output("Starting to download $packageFileName ..."); $rest->downloadPackageFileOfRelease($pName, $pVer, $file); $this->ui()->output(sprintf("...done: %s bytes", number_format(filesize($file)))); @@ -352,10 +354,10 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command } $conflicts = $package->checkPhpDependencies(); - if(true !== $conflicts) { - $confilcts = implode(",",$conflicts); - $err = "Package {$pChan}/{$pName} {$pVer} depends on PHP extensions: ".$conflicts; - if($forceMode) { + if (true !== $conflicts) { + $conflicts = implode(",",$conflicts); + $err = "Package {$pChan}/{$pName} {$pVer} depends on PHP extensions: " . $conflicts; + if ($forceMode) { $this->doError($command, $err); } else { throw new Exception($err); @@ -363,18 +365,18 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command } $conflicts = $package->checkPhpVersion(); - if(true !== $conflicts) { - $err = "Package {$pChan}/{$pName} {$pVer}: ".$conflicts; - if($forceMode) { + if (true !== $conflicts) { + $err = "Package {$pChan}/{$pName} {$pVer}: " . $conflicts; + if ($forceMode) { $this->doError($command, $err); } else { throw new Exception($err); } } - if(!$noFilesInstall) { + if (!$noFilesInstall) { $this->ui()->output("Installing package {$pChan}/{$pName} {$pVer}"); - if($ftp) { + if ($ftp) { $packager->processInstallPackageFtp($package, $file, $config, $ftpObj); } else { $packager->processInstallPackage($package, $file, $config); @@ -394,7 +396,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $title = isset($options['title']) ? $options['title'] : "Package installed: "; $out = array($command => array('data'=>$installedDeps, 'assoc'=>$installedDepsAssoc, 'title'=>$title)); - if($ftp) { + if ($ftp) { $packager->writeToRemoteCache($cache, $ftpObj); @unlink($config->getFilename()); } @@ -402,7 +404,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $this->ui()->output($out); return $out[$command]['data']; } catch (Exception $e) { - if($ftp) { + if ($ftp) { $packager->writeToRemoteCache($cache, $ftpObj); @unlink($config->getFilename()); } @@ -444,14 +446,14 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command * @param string $command * @param array $options * @param array $params - * @return null + * @return array|null */ public function doUninstall($command, $options, $params) { $this->cleanupParams($params); try { - if(count($params) != 2) { + if (count($params) != 2) { throw new Exception("Argument count should be = 2"); } @@ -466,7 +468,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command /** @var $cache Mage_Connect_Singleconfig */ /** @var $config Mage_Connect_Config */ /** @var $ftpObj Mage_Connect_Ftp */ - if($ftp) { + if ($ftp) { list($cache, $config, $ftpObj) = $packager->getRemoteConf($ftp); } else { $cache = $this->getSconfig(); @@ -474,47 +476,47 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command } $channel = $cache->chanName($channel); - if(!$cache->hasPackage($channel, $package)) { + if (!$cache->hasPackage($channel, $package)) { throw new Exception("Package is not installed"); } $deletedPackages = array(); $list = $packager->getUninstallList($channel, $package, $cache, $config, $withDepsMode); - foreach($list['list'] as $packageData) { + foreach ($list['list'] as $packageData) { try { $reqd = $cache->requiredByOtherPackages( $packageData['channel'], $packageData['name'], $list['list'] ); - if(count($reqd)) { + if (count($reqd)) { $errMessage = "{$packageData['channel']}/{$packageData['name']} " . "{$packageData['version']} is required by: "; $t = array(); - foreach($reqd as $r) { - $t[] = $r['channel']."/".$r['name']. " ".$r['version']; + foreach ($reqd as $r) { + $t[] = $r['channel'] . "/" . $r['name'] . " " . $r['version']; } $errMessage .= implode(", ", $t); - if($forceMode) { - $this->ui()->output("Warning: ".$errMessage); + if ($forceMode) { + $this->ui()->output("Warning: " . $errMessage); } else { throw new Exception($errMessage); } } } catch(Exception $e) { - if($forceMode) { + if ($forceMode) { $this->doError($command, $e->getMessage()); } else { throw new Exception($e->getMessage()); } } } - foreach($list['list'] as $packageData) { + foreach ($list['list'] as $packageData) { try { list($chan, $pack) = array($packageData['channel'], $packageData['name']); $packageName = $packageData['channel'] . "/" . $packageData['name']; $this->ui()->output("Starting to uninstall $packageName "); - if($ftp) { + if ($ftp) { $packager->processUninstallPackageFtp($chan, $pack, $cache, $ftpObj); } else { $packager->processUninstallPackage($chan, $pack, $cache, $config); @@ -523,19 +525,20 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $deletedPackages[] = array($chan, $pack); $this->ui()->output("Package {$packageName} uninstalled"); } catch(Exception $e) { - if($forceMode) { + if ($forceMode) { $this->doError($command, $e->getMessage()); } else { throw new Exception($e->getMessage()); } } } - if($ftp) { + if ($ftp) { $packager->writeToRemoteCache($cache, $ftpObj); @unlink($config->getFilename()); } $out = array($command=>array('data'=>$deletedPackages, 'title'=>'Package deleted: ')); $this->ui()->output($out); + return $out[$command]['data']; } catch (Exception $e) { return $this->doError($command, $e->getMessage()); } diff --git a/downloader/lib/Mage/Connect/Command/Install_Header.php b/downloader/lib/Mage/Connect/Command/Install_Header.php index 75e07ffcd33..12e004d22cf 100644 --- a/downloader/lib/Mage/Connect/Command/Install_Header.php +++ b/downloader/lib/Mage/Connect/Command/Install_Header.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/downloader/lib/Mage/Connect/Command/Package.php b/downloader/lib/Mage/Connect/Command/Package.php index 3516bdc0ef1..0f0efe3f014 100644 --- a/downloader/lib/Mage/Connect/Command/Package.php +++ b/downloader/lib/Mage/Connect/Command/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/downloader/lib/Mage/Connect/Command/Package_Header.php b/downloader/lib/Mage/Connect/Command/Package_Header.php index f738ba800d0..6c0a05d2641 100644 --- a/downloader/lib/Mage/Connect/Command/Package_Header.php +++ b/downloader/lib/Mage/Connect/Command/Package_Header.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/downloader/lib/Mage/Connect/Command/Registry.php b/downloader/lib/Mage/Connect/Command/Registry.php index f2fc850733d..2577c1c5b74 100644 --- a/downloader/lib/Mage/Connect/Command/Registry.php +++ b/downloader/lib/Mage/Connect/Command/Registry.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/downloader/lib/Mage/Connect/Command/Registry_Header.php b/downloader/lib/Mage/Connect/Command/Registry_Header.php index 410625e3c47..4b77ee170c6 100644 --- a/downloader/lib/Mage/Connect/Command/Registry_Header.php +++ b/downloader/lib/Mage/Connect/Command/Registry_Header.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/downloader/lib/Mage/Connect/Command/Remote.php b/downloader/lib/Mage/Connect/Command/Remote.php index d2a39a03f70..7d8c879c845 100644 --- a/downloader/lib/Mage/Connect/Command/Remote.php +++ b/downloader/lib/Mage/Connect/Command/Remote.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/downloader/lib/Mage/Connect/Command/Remote_Header.php b/downloader/lib/Mage/Connect/Command/Remote_Header.php index dcfd359eea1..79793670cb2 100644 --- a/downloader/lib/Mage/Connect/Command/Remote_Header.php +++ b/downloader/lib/Mage/Connect/Command/Remote_Header.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/downloader/lib/Mage/Connect/Config.php b/downloader/lib/Mage/Connect/Config.php index 22136a2d80c..c964de14ecc 100644 --- a/downloader/lib/Mage/Connect/Config.php +++ b/downloader/lib/Mage/Connect/Config.php @@ -20,9 +20,30 @@ * * @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) */ + +/** + * Magento Connect Config + * + * @property string php_ini + * @property string protocol + * @property string preferred_state + * @property string use_custom_permissions_mode + * @property string global_dir_mode + * @property string global_file_mode + * @property string downloader_path + * @property string magento_root + * @property string root_channel_uri + * @property string root_channel + * @property string remote_config + * @property string sync_pear + * + * @category Mage + * @package Mage_Connect + * @author Magento Core Team <core@magentocommerce.com> + */ class Mage_Connect_Config implements Iterator { /** @@ -53,11 +74,28 @@ class Mage_Connect_Config implements Iterator */ protected $_configError = ''; + /** + * Header string + */ const HEADER = "::ConnectConfig::v::1.0::"; + + /** + * Default paths + */ const DEFAULT_DOWNLOADER_PATH = "downloader"; const DEFAULT_CACHE_PATH = ".cache"; + /** + * Array of default properties + * @var array + */ protected $defaultProperties = array(); + + /** + * Array of properties + * + * @var array + */ protected $properties = array(); /** @@ -71,6 +109,11 @@ class Mage_Connect_Config implements Iterator $this->load(); } + /** + * Initialise Properties and Default Properties + * + * @return void + */ protected function initProperties() { $this->defaultProperties = array ( @@ -162,22 +205,43 @@ class Mage_Connect_Config implements Iterator $this->properties = $this->defaultProperties; } + /** + * Retrieve Downloader Path + * + * @return string + */ public function getDownloaderPath() { return $this->magento_root . DIRECTORY_SEPARATOR . $this->downloader_path; } + /** + * Retrieve Packages Cache Directory + * + * @return string + */ public function getPackagesCacheDir() { return $this->getDownloaderPath() . DIRECTORY_SEPARATOR . self::DEFAULT_CACHE_PATH; } + /** + * Retrieve Channel Cache Directory + * + * @param string $channel + * @return string + */ public function getChannelCacheDir($channel) { $channel = trim( $channel, "\\/"); return $this->getPackagesCacheDir(). DIRECTORY_SEPARATOR . $channel; } + /** + * Get Config file name + * + * @return string + */ public function getFilename() { return $this->_configFile; @@ -211,7 +275,7 @@ class Mage_Connect_Config implements Iterator clearstatcache(); $size = filesize($this->_configFile); - if(!$size) { + if (!$size) { $this->_configError = "Wrong config file size {$this->_configFile} please save Settings again"; return false; } @@ -219,7 +283,7 @@ class Mage_Connect_Config implements Iterator $headerLen = strlen(self::HEADER); try { $contents = fread($f, $headerLen); - if(self::HEADER != $contents) { + if (self::HEADER != $contents) { $this->_configError = "Wrong configuration file {$this->_configFile} please save Settings again"; return false; } @@ -232,7 +296,7 @@ class Mage_Connect_Config implements Iterator return false; } $data = @unserialize($contents); - if($data === false) { + if ($data === false) { $this->_configError = "Wrong configuration file {$this->_configFile} please save Settings again"; return false; } @@ -241,6 +305,7 @@ class Mage_Connect_Config implements Iterator } @fclose($f); $this->_configLoaded=true; + return true; } /** @@ -301,83 +366,158 @@ class Mage_Connect_Config implements Iterator return $result; } + /** + * Validate value for configuration key + * + * @param string $key + * @param mixed $val + * @return bool + */ public function validate($key, $val) { $rules = $this->extractField($key, 'rules'); - if(null === $rules) { + if (null === $rules) { return true; - } elseif( is_array($rules) ) { + } elseif ( is_array($rules) ) { return in_array($val, $rules); } return false; } + /** + * Get possible values for configuration key + * + * @param string $key + * @return null|string + */ public function possible($key) { $data = $this->getKey($key); - if(! $data) { + if (! $data) { return null; } - if('set' == $data['type']) { + if ('set' == $data['type']) { return implode("|", $data['rules']); } - if(!empty($data['possible'])) { + if (!empty($data['possible'])) { return $data['possible']; } - return "<".$data['type'].">"; + return "<" . $data['type'] . ">"; } + /** + * Get type of key + * + * @param string $key + * @return mixed|null + */ public function type($key) { return $this->extractField($key, 'type'); } + /** + * Get documentation information + * + * @param string $key + * @return mixed|null + */ public function doc($key) { return $this->extractField($key, 'doc'); } + /** + * Get property of key + * + * @param $key + * @param $field + * @return mixed|null + */ public function extractField($key, $field) { - if(!isset($this->properties[$key][$field])) { + if (!isset($this->properties[$key][$field])) { return null; } return $this->properties[$key][$field]; } + /** + * Check Key exists in properties array + * + * @param string $fld + * @return bool + */ public function hasKey($fld) { return isset($this->properties[$fld]); } + /** + * Get all Key properties + * + * @param $fld + * @return null + */ public function getKey($fld) { - if($this->hasKey($fld)) { + if ($this->hasKey($fld)) { return $this->properties[$fld]; } return null; } + /** + * Set the internal pointer of the Properties array to its first element + * + * @return void + */ public function rewind() { reset($this->properties); } + /** + * Validate current property + * + * @return bool + */ public function valid() { return current($this->properties) !== false; } + /** + * Get Key of current property + * + * @return mixed + */ public function key() { return key($this->properties); } + /** + * Get current Property + * + * @return mixed + */ public function current() { return current($this->properties); } + /** + * Advance the internal array pointer of the Properties array + * + * @return void + */ public function next() { next($this->properties); } + /** + * Retrieve value of property + * + * @param string $var + * @return null + */ public function __get($var) { if (isset($this->properties[$var]['value'])) { @@ -386,6 +526,13 @@ class Mage_Connect_Config implements Iterator return null; } + /** + * Set value of property + * + * @param string $var + * @param mixed $value + * @return void + */ public function __set($var, $value) { if (is_string($value)) { @@ -395,17 +542,23 @@ class Mage_Connect_Config implements Iterator if ($value === null) { $value = ''; } - if($this->properties[$var]['value'] !== $value) { + if ($this->properties[$var]['value'] !== $value) { $this->properties[$var]['value'] = $value; $this->store(); } } } + /** + * Prepare Array of class properties + * + * @param bool $withRules + * @return array + */ public function toArray($withRules = false) { $out = array(); - foreach($this as $k=>$v) { + foreach ($this as $k=>$v) { $out[$k] = $withRules ? $v : $v['value']; } return $out; diff --git a/downloader/lib/Mage/Connect/Converter.php b/downloader/lib/Mage/Connect/Converter.php index c2286686908..46c3152b792 100644 --- a/downloader/lib/Mage/Connect/Converter.php +++ b/downloader/lib/Mage/Connect/Converter.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/downloader/lib/Mage/Connect/Frontend.php b/downloader/lib/Mage/Connect/Frontend.php index 4ebaf7b14f2..2cd9358e5a3 100644 --- a/downloader/lib/Mage/Connect/Frontend.php +++ b/downloader/lib/Mage/Connect/Frontend.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) */ class Mage_Connect_Frontend diff --git a/downloader/lib/Mage/Connect/Frontend/CLI.php b/downloader/lib/Mage/Connect/Frontend/CLI.php index a0d0c4b88f8..1212c7f80d4 100644 --- a/downloader/lib/Mage/Connect/Frontend/CLI.php +++ b/downloader/lib/Mage/Connect/Frontend/CLI.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/downloader/lib/Mage/Connect/Ftp.php b/downloader/lib/Mage/Connect/Ftp.php index ffb71e37137..65d3700efd1 100644 --- a/downloader/lib/Mage/Connect/Ftp.php +++ b/downloader/lib/Mage/Connect/Ftp.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/downloader/lib/Mage/Connect/Loader.php b/downloader/lib/Mage/Connect/Loader.php index f622fcc206b..78ebc35fe36 100644 --- a/downloader/lib/Mage/Connect/Loader.php +++ b/downloader/lib/Mage/Connect/Loader.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) */ @@ -33,11 +33,11 @@ */ class Mage_Connect_Loader { - /** * Factory for HTTP client - * @param string/false $protocol 'curl'/'socket' or false for auto-detect - * @return Mage_HTTP_Client/Mage_Connect_Loader_Ftp + * + * @param string|false $protocol 'curl'/'socket' or false for auto-detect + * @return Mage_HTTP_IClient|Mage_Connect_Loader_Ftp */ public static function getInstance($protocol='') { @@ -47,5 +47,4 @@ class Mage_Connect_Loader return Mage_HTTP_Client::getInstance(); } } - } diff --git a/downloader/lib/Mage/Connect/Loader/Ftp.php b/downloader/lib/Mage/Connect/Loader/Ftp.php index c410bde3977..d74ae20f883 100644 --- a/downloader/lib/Mage/Connect/Loader/Ftp.php +++ b/downloader/lib/Mage/Connect/Loader/Ftp.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/downloader/lib/Mage/Connect/Package.php b/downloader/lib/Mage/Connect/Package.php index d031edbac3c..d785876165e 100644 --- a/downloader/lib/Mage/Connect/Package.php +++ b/downloader/lib/Mage/Connect/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/downloader/lib/Mage/Connect/Package/Hotfix.php b/downloader/lib/Mage/Connect/Package/Hotfix.php index 3c1ba941367..b0f436d3bee 100644 --- a/downloader/lib/Mage/Connect/Package/Hotfix.php +++ b/downloader/lib/Mage/Connect/Package/Hotfix.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/downloader/lib/Mage/Connect/Package/Reader.php b/downloader/lib/Mage/Connect/Package/Reader.php index 3776698d1d0..5b38949e041 100644 --- a/downloader/lib/Mage/Connect/Package/Reader.php +++ b/downloader/lib/Mage/Connect/Package/Reader.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/downloader/lib/Mage/Connect/Package/Target.php b/downloader/lib/Mage/Connect/Package/Target.php index 435d7c79077..ac162d39933 100644 --- a/downloader/lib/Mage/Connect/Package/Target.php +++ b/downloader/lib/Mage/Connect/Package/Target.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/downloader/lib/Mage/Connect/Package/VO.php b/downloader/lib/Mage/Connect/Package/VO.php index 0a31198dd85..880fc6bd705 100644 --- a/downloader/lib/Mage/Connect/Package/VO.php +++ b/downloader/lib/Mage/Connect/Package/VO.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/downloader/lib/Mage/Connect/Package/Writer.php b/downloader/lib/Mage/Connect/Package/Writer.php index 2018e3c9ae7..79006feb300 100644 --- a/downloader/lib/Mage/Connect/Package/Writer.php +++ b/downloader/lib/Mage/Connect/Package/Writer.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/downloader/lib/Mage/Connect/Packager.php b/downloader/lib/Mage/Connect/Packager.php index 899b95378b5..ec6ed49e717 100644 --- a/downloader/lib/Mage/Connect/Packager.php +++ b/downloader/lib/Mage/Connect/Packager.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) */ @@ -261,7 +261,7 @@ class Mage_Connect_Packager $contents = $package->getContents(); $targetPath = rtrim($configObj->magento_root, "\\/"); - foreach($contents as $file) { + foreach ($contents as $file) { $fileName = basename($file); $filePath = dirname($file); $dest = $targetPath . DIRECTORY_SEPARATOR . $filePath . DIRECTORY_SEPARATOR . $fileName; @@ -290,7 +290,7 @@ class Mage_Connect_Packager $ftpDir = $ftp->getcwd(); $package = $cacheObj->getPackageObject($chanName, $package); $contents = $package->getContents(); - foreach($contents as $file) { + foreach ($contents as $file) { $ftp->delete($file); $this->removeEmptyDirectory(dirname($file), $ftp); } @@ -317,7 +317,7 @@ class Mage_Connect_Packager /** * Return correct global dir mode in octal representation * - * @param Maged_Model_Config $config + * @param Mage_Connect_Config $config * @return int */ protected function _getDirMode($config) @@ -332,7 +332,7 @@ class Mage_Connect_Packager /** * Return global file mode in octal representation * - * @param Maged_Model_Config $config + * @param Mage_Connect_Config $config * @return int */ protected function _getFileMode($config) @@ -360,7 +360,7 @@ class Mage_Connect_Packager * * @param Mage_Connect_Package $package * @param string $file - * @param Maged_Model_Config $configObj + * @param Mage_Connect_Config $configObj * @param Mage_Connect_Ftp $ftp * @return void */ @@ -369,13 +369,13 @@ class Mage_Connect_Packager $ftpDir = $ftp->getcwd(); $contents = $package->getContents(); $arc = $this->getArchiver(); - $target = dirname($file).DS.$package->getReleaseFilename(); + $target = dirname($file) . DS . $package->getReleaseFilename(); @mkdir($target, 0777, true); $tar = $arc->unpack($file, $target); $modeFile = $this->_getFileMode($configObj); $modeDir = $this->_getDirMode($configObj); - foreach($contents as $file) { - $source = $tar.DS.$file; + foreach ($contents as $file) { + $source = $tar . DS . $file; if (file_exists($source) && is_file($source)) { $args = array(ltrim($file,"/"), $source); if($modeDir||$modeFile) { @@ -401,23 +401,23 @@ class Mage_Connect_Packager * * @param Mage_Connect_Package $package * @param string $file + * @param Mage_Connect_Config $configObj * @return void - * @throws Exception */ public function processInstallPackage($package, $file, $configObj) { $contents = $package->getContents(); $arc = $this->getArchiver(); - $target = dirname($file).DS.$package->getReleaseFilename(); + $target = dirname($file) . DS . $package->getReleaseFilename(); @mkdir($target, 0777, true); $tar = $arc->unpack($file, $target); $modeFile = $this->_getFileMode($configObj); $modeDir = $this->_getDirMode($configObj); $targetPath = rtrim($configObj->magento_root, "\\/"); - foreach($contents as $file) { + foreach ($contents as $file) { $fileName = basename($file); $filePath = dirname($file); - $source = $tar.DS.$file; + $source = $tar . DS . $file; @mkdir($targetPath. DS . $filePath, $modeDir, true); $dest = $targetPath . DS . $filePath . DS . $fileName; if (is_file($source)) { @@ -496,8 +496,9 @@ class Mage_Connect_Packager /** * Get upgrades list * - * @param string/array $channels + * @param string|array $channels * @param Mage_Connect_Singleconfig $cacheObject + * @param Mage_Connect_Config $configObj * @param Mage_Connect_Rest $restObj optional * @param bool $checkConflicts * @return array @@ -513,7 +514,7 @@ class Mage_Connect_Packager } $updates = array(); - foreach($channels as $chan) { + foreach ($channels as $chan) { if(!$cacheObject->isChannel($chan)) { continue; @@ -536,14 +537,14 @@ class Mage_Connect_Packager */ $state = $configObj->preferred_state ? $configObj->preferred_state : "stable"; - foreach($localPackages as $localName=>$localData) { + foreach ($localPackages as $localName=>$localData) { if(!isset($remotePackages[$localName])) { continue; } $package = $remotePackages[$localName]; $neededToUpgrade = false; $remoteVersion = $localVersion = trim($localData[Mage_Connect_Singleconfig::K_VER]); - foreach($package as $version => $s) { + foreach ($package as $version => $s) { if($cacheObject->compareStabilities($s, $state) < 0) { continue; @@ -581,7 +582,7 @@ class Mage_Connect_Packager * @param Mage_Connect_Singleconfig $cache * @param Mage_Connect_Config $config * @param bool $withDepsRecursive - * @return array + * @return array|null */ public function getUninstallList($chanName, $package, $cache, $config, $withDepsRecursive = true) { @@ -599,7 +600,7 @@ class Mage_Connect_Packager $hash = array(); return array('list'=>array()); } - return; + return null; } $dependencies = $cache->getPackageDependencies($chanName, $package); $data = $cache->getPackage($chanName, $package); @@ -614,14 +615,14 @@ class Mage_Connect_Packager if($withDepsRecursive) { $fields = array('name','channel','min','max'); - foreach($dependencies as $row) { + foreach ($dependencies as $row) { /** * Converts an array to variables * @var $pChannel string Channel Name * @var $pName string Package Name */ - foreach($fields as $key) { - $varName = "p".ucfirst($key); + foreach ($fields as $key) { + $varName = "p" . ucfirst($key); $$varName = $row[$key]; } $method = __FUNCTION__; @@ -642,6 +643,8 @@ class Mage_Connect_Packager $hash = array(); return array('list'=>$out); } + + return null; } /** @@ -656,7 +659,7 @@ class Mage_Connect_Packager * @param string $versionMax Required package maximum version * @param string $installState Package install state * @param string $message Package install message - * @param array $dependencies Package dependencies + * @param array|string $dependencies Package dependencies * @return bool */ private function addHashData(&$hash, $name, $channel, $downloaded_version = '', $stability = '', $versionMin = '', @@ -677,7 +680,7 @@ class Mage_Connect_Packager 'max' => $versionMax, 'install_state' => $installState, 'message' => (isset($this->installStates[$installState]) ? - $this->installStates[$installState] : '').$message, + $this->installStates[$installState] : '') . $message, 'packages' => $dependencies, ); return true; @@ -713,7 +716,7 @@ class Mage_Connect_Packager try { $chanName = $cache->chanName($chanName); - if (!$rest){ + if (!$rest) { $rest = new Mage_Connect_Rest($config->protocol); } $rest->setChannel($cache->chanUrl($chanName)); @@ -739,6 +742,7 @@ class Mage_Connect_Packager if (!$version) { $versionState = $cache->detectVersionFromRestArray($releases, $versionMin, $versionMax); if ($versionState) { + /** @var $packageInfo Mage_Connect_Package */ $packageInfo = $rest->getPackageReleaseInfo($package, $versionState); if (false !== $packageInfo) { $stability = $packageInfo->getStability(); @@ -758,7 +762,7 @@ class Mage_Connect_Packager * check is package already installed */ if ($installedPackage = $cache->isPackageInstalled($package)) { - if ($chanName == $installedPackage['channel']){ + if ($chanName == $installedPackage['channel']) { /** * check versions */ @@ -808,7 +812,7 @@ class Mage_Connect_Packager if ($withDepsRecursive && self::INSTALL_STATE_INCOMPATIBLE != $install_state) { $flds = array('name','channel','min','max'); - foreach($dependencies as $row) { + foreach ($dependencies as $row) { /** * Converts an array to variables * @var $pChannel string Channel Name @@ -816,13 +820,13 @@ class Mage_Connect_Packager * @var $pMax string Maximum version number * @var $pMin string Minimum version number */ - foreach($flds as $key) { - $varName = "p".ucfirst($key); + foreach ($flds as $key) { + $varName = "p" . ucfirst($key); $$varName = $row[$key]; } $method = __FUNCTION__; /** - * @todo When we are building dependencies tree we should base this calculations not on full key as + * When we are building dependencies tree we should base this calculations not on full key as * on a unique value but check it by parts. First part which should be checked is EXTENSION_NAME * also this part should be unique globally not per channel. */ @@ -844,7 +848,7 @@ class Mage_Connect_Packager } $names = array("pMin","pMax","hasMin","hasMax"); - for($i=0, $c=count($names); $i<$c; $i++) { + for ($i=0, $c=count($names); $i<$c; $i++) { if(!isset($$names[$i])) { continue; } @@ -896,8 +900,9 @@ class Mage_Connect_Packager $_failed = array(); return array('deps' => $deps, 'result' => $out, 'failed'=> $failed); } - } + return null; + } /** * Process dependencies hash. Makes topological sorting and gives operation order list @@ -911,8 +916,7 @@ class Mage_Connect_Packager $nodes = array(); $graph = new Mage_Connect_Structures_Graph(); - foreach($depsHash as $key=>$data) { - $packages = $data['packages']; + foreach ($depsHash as $key=>$data) { $node = new Mage_Connect_Structures_Node(); $nodes[$key] =& $node; unset($data['packages']); @@ -921,12 +925,12 @@ class Mage_Connect_Packager unset($node); } - if(count($nodes) > 1) { - foreach($depsHash as $key=>$data) { + if (count($nodes) > 1) { + foreach ($depsHash as $key=>$data) { $packages = $data['packages']; - foreach($packages as $pdata) { + foreach ($packages as $pdata) { $pName = $pdata['name']; - if(isset($nodes[$key], $nodes[$pName])) { + if (isset($nodes[$key], $nodes[$pName])) { $nodes[$key]->connectTo($nodes[$pName]); } } @@ -940,8 +944,9 @@ class Mage_Connect_Packager $result = $graph->topologicalSort(); $sortReverse ? krsort($result) : ksort($result); $out = array(); - foreach($result as $nodes) { - foreach($nodes as $n) { + foreach ($result as $nodes) { + foreach ($nodes as $n) { + /** @var $n Mage_Connect_Structures_Node */ $out[] = $n->getData(); } } diff --git a/downloader/lib/Mage/Connect/Rest.php b/downloader/lib/Mage/Connect/Rest.php index 4ec1ad88948..ab24c264dc7 100644 --- a/downloader/lib/Mage/Connect/Rest.php +++ b/downloader/lib/Mage/Connect/Rest.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) */ @@ -31,10 +31,11 @@ * @package Mage_Connect * @author Magento Core Team <core@magentocommerce.com> */ - class Mage_Connect_Rest { - + /** + * Paths for xml config files + */ const CHANNELS_XML = "channels.xml"; const CHANNEL_XML = "channel.xml"; const PACKAGES_XML = "packages.xml"; @@ -48,28 +49,38 @@ class Mage_Connect_Rest */ protected $_loader = null; - /** * XML parser + * * @var Mage_Xml_Parser */ protected $_parser = null; /** * Channel URI + * * @var string */ protected $_chanUri = ''; /** - * Protocol HTTP or FTP - * - * @var string http or ftp - */ + * Protocol HTTP or FTP + * + * @var string http or ftp + */ protected $_protocol = ''; /** - * Constructor + * States interpretation + * + * @var array + */ + protected $states = array('b'=>'beta', 'd'=>'dev', 's'=>'stable', 'a'=>'alpha'); + + /** + * Constructor sets default protocol + * + * @param string $protocol */ public function __construct($protocol="http") { @@ -87,10 +98,10 @@ class Mage_Connect_Rest } /** - * Set channel info + * Set channel URI * * @param string $uri - * @param sting $name + * @return void */ public function setChannel($uri) { @@ -99,17 +110,17 @@ class Mage_Connect_Rest /** * Get HTTP loader - * @return Mage_Connect_Loader + * + * @return Mage_HTTP_IClient|Mage_Connect_Loader_Ftp */ public function getLoader() { - if(is_null($this->_loader)) { + if (is_null($this->_loader)) { $this->_loader = Mage_Connect_Loader::getInstance($this->_protocol); } return $this->_loader; } - /** * Get parser * @@ -117,7 +128,7 @@ class Mage_Connect_Rest */ protected function getParser() { - if(is_null($this->_parser)) { + if (is_null($this->_parser)) { $this->_parser = new Mage_Xml_Parser(); } return $this->_parser; @@ -125,15 +136,16 @@ class Mage_Connect_Rest /** * Load URI response - * @param string $uri + * + * @param string $uriSuffix + * @return bool|string */ protected function loadChannelUri($uriSuffix) { - $url = $this->_chanUri."/".$uriSuffix; - //print $url."\n"; + $url = $this->_chanUri . "/" . $uriSuffix; $this->getLoader()->get($url); $statusCode = $this->getLoader()->getStatus(); - if($statusCode != 200) { + if ($statusCode != 200) { return false; } return $this->getLoader()->getBody(); @@ -141,79 +153,82 @@ class Mage_Connect_Rest /** * Get channels list of URI + * * @return array */ public function getChannelInfo() { $out = $this->loadChannelUri(self::CHANNEL_XML); $statusCode = $this->getLoader()->getStatus(); - if($statusCode != 200) { + if ($statusCode != 200) { throw new Exception("Invalid server response for {$this->_chanUri}"); } $parser = $this->getParser(); $out = $parser->loadXML($out)->xmlToArray(); - // TODO: add channel validator $vo = new Mage_Connect_Channel_VO(); $vo->fromArray($out['channel']); - if(!$vo->validate()) { + if (!$vo->validate()) { throw new Exception("Invalid channel.xml file"); } return $vo; } - /** * Get packages list of channel + * * @return array */ public function getPackages() { $out = $this->loadChannelUri(self::PACKAGES_XML); $statusCode = $this->getLoader()->getStatus(); - if($statusCode != 200) { + if ($statusCode != 200) { return false; } $parser = $this->getParser(); $out = $parser->loadXML($out)->xmlToArray(); - - if(!isset($out['data']['p'])) { + if (!isset($out['data']['p'])) { return array(); } - if(isset($out['data']['p'][0])) { + if (isset($out['data']['p'][0])) { return $out['data']['p']; } - if(is_array($out['data']['p'])) { + if (is_array($out['data']['p'])) { return array($out['data']['p']); } return array(); } - + /** + * Return Channel Packages loaded from Channel Server + * + * @return array|bool|string + */ public function getPackagesHashed() { $out = $this->loadChannelUri(self::PACKAGES_XML); $statusCode = $this->getLoader()->getStatus(); - if($statusCode != 200) { + if ($statusCode != 200) { return false; } $parser = $this->getParser(); $out = $parser->loadXML($out)->xmlToArray(); $return = array(); - if(!isset($out['data']['p'])) { + if (!isset($out['data']['p'])) { return $return; } - if(isset($out['data']['p'][0])) { + if (isset($out['data']['p'][0])) { $return = $out['data']['p']; - }elseif(is_array($out['data']['p'])) { + } elseif (is_array($out['data']['p'])) { $return = array($out['data']['p']); } - $c = count($return); - if($c) { + $c = count($return); + if ($c) { $output = array(); - for($i=0; $i<$c; $i++) { + for ($i=0; $i<$c; $i++) { $element = $return[$i]; $output[$element['n']] = $element['r']; } @@ -221,7 +236,7 @@ class Mage_Connect_Rest } $out = array(); - foreach($return as $name=>$package) { + foreach ($return as $name=>$package) { $stabilities = array_map(array($this, 'shortStateToLong'), array_keys($package)); $versions = array_map('trim', array_values($package)); $package = array_combine($versions, $stabilities); @@ -233,6 +248,7 @@ class Mage_Connect_Rest /** * Stub + * * @param $n * @return unknown_type */ @@ -243,22 +259,24 @@ class Mage_Connect_Rest /** * Get releases list of package on current channel + * * @param string $package package name + * @return array|bool */ public function getReleases($package) { - $out = $this->loadChannelUri($this->escapePackageName($package)."/".self::RELEASES_XML); + $out = $this->loadChannelUri($this->escapePackageName($package) . "/" . self::RELEASES_XML); $statusCode = $this->getLoader()->getStatus(); - if($statusCode != 200) { + if ($statusCode != 200) { return false; } $parser = $this->getParser(); $out = $parser->loadXML($out)->xmlToArray(); - if(!isset($out['releases']['r'])) { + if (!isset($out['releases']['r'])) { return array(); } $src = $out['releases']['r']; - if(!array_key_exists(0, $src)) { + if (!array_key_exists(0, $src)) { return array($src); } $this->sortReleases($src); @@ -267,6 +285,7 @@ class Mage_Connect_Rest /** * Sort releases + * * @param array $releases * @return void */ @@ -278,6 +297,7 @@ class Mage_Connect_Rest /** * Sort releases callback + * * @param string $a * @param srting $b * @return int @@ -295,23 +315,24 @@ class Mage_Connect_Rest */ public function getPackageInfo($package) { - $out = $this->loadChannelUri($this->escapePackageName($package)."/".self::PACKAGE_XML); - if(false === $out) { + $out = $this->loadChannelUri($this->escapePackageName($package) . "/" . self::PACKAGE_XML); + if (false === $out) { return false; } return new Mage_Connect_Package($out); } /** + * Retrieve information on Package Release from the Channel Server * * @param $package * @param $version - * @return Mage_Connect_Package + * @return Mage_Connect_Package|bool */ public function getPackageReleaseInfo($package, $version) { - $out = $this->loadChannelUri($this->escapePackageName($package)."/".$version."/".self::PACKAGE_XML); - if(false === $out) { + $out = $this->loadChannelUri($this->escapePackageName($package) . "/" . $version . "/" . self::PACKAGE_XML); + if (false === $out) { return false; } return new Mage_Connect_Package($out); @@ -319,48 +340,51 @@ class Mage_Connect_Rest /** * Get package archive file of release + * + * @throws Exception * @param string $package package name - * @param string $version version + * @param string $version package version + * @param string $targetFile + * @return bool */ public function downloadPackageFileOfRelease($package, $version, $targetFile) { $package = $this->escapePackageName($package); $version = $this->escapePackageName($version); - - if(file_exists($targetFile)) { - $chksum = $this->loadChannelUri($package."/".$version."/checksum"); + if (file_exists($targetFile)) { + $chksum = $this->loadChannelUri($package . "/" . $version . "/checksum"); $statusCode = $this->getLoader()->getStatus(); - if($statusCode == 200) { - if(md5_file($targetFile) == $chksum) { + if ($statusCode == 200) { + if (md5_file($targetFile) == $chksum) { return true; } } } - - $out = $this->loadChannelUri($package."/".$version."/".$package."-".$version.".".self::EXT); + $out = $this->loadChannelUri($package . "/" . $version . "/" . $package . "-" . $version . "." . self::EXT); $statusCode = $this->getLoader()->getStatus(); - if($statusCode != 200) { + if ($statusCode != 200) { throw new Exception("Package not found: {$package} {$version}"); } $dir = dirname($targetFile); @mkdir($dir, 0777, true); $result = @file_put_contents($targetFile, $out); - if(false === $result) { + if (false === $result) { throw new Exception("Cannot write to file {$targetFile}"); } return true; } - protected $states = array('b'=>'beta', 'd'=>'dev', 's'=>'stable', 'a'=>'alpha'); - + /** + * Decode state + * + * @param string $s + * @return string + */ public function shortStateToLong($s) { return isset($this->states[$s]) ? $this->states[$s] : 'dev'; } - - } - diff --git a/downloader/lib/Mage/Connect/Singleconfig.php b/downloader/lib/Mage/Connect/Singleconfig.php index c02cd4a4099..9766e9218d0 100644 --- a/downloader/lib/Mage/Connect/Singleconfig.php +++ b/downloader/lib/Mage/Connect/Singleconfig.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/downloader/lib/Mage/Connect/Structures/Graph.php b/downloader/lib/Mage/Connect/Structures/Graph.php index 8bcb9d73e89..6e9410cde52 100644 --- a/downloader/lib/Mage/Connect/Structures/Graph.php +++ b/downloader/lib/Mage/Connect/Structures/Graph.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/downloader/lib/Mage/Connect/Structures/Node.php b/downloader/lib/Mage/Connect/Structures/Node.php index 4abae479028..10265904d72 100644 --- a/downloader/lib/Mage/Connect/Structures/Node.php +++ b/downloader/lib/Mage/Connect/Structures/Node.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/downloader/lib/Mage/Connect/Validator.php b/downloader/lib/Mage/Connect/Validator.php index ebebefc14f8..0310a2e2080 100644 --- a/downloader/lib/Mage/Connect/Validator.php +++ b/downloader/lib/Mage/Connect/Validator.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) */ @@ -31,50 +31,56 @@ * @package Mage_Connect * @author Magento Core Team <core@magentocommerce.com> */ - class Mage_Connect_Validator { + /** + * Array of stability variants + * + * @var array + */ protected static $_stability = array(0=>'devel',1=>'alpha',2=>'beta',3=>'stable'); - + /** + * Get array of Stability variants + * + * @static + * @return array + */ public static function getStabilities() { return self::$_stability; } - - /** * Compare stabilities. Returns: * * -1 if the first stability is lower than the second * 0 if they are equal * 1 if the second is lower. - * @param $s1 - * @param $s2 - * @return int + * + * @param int|string $s1 + * @param int|string $s2 + * @return int|null */ public function compareStabilities($s1, $s2) { $list = $this->getStabilities(); $tmp = array_combine(array_values($list),array_keys($list)); - if(!isset($tmp[$s1], $tmp[$s2])) { + if (!isset($tmp[$s1], $tmp[$s2])) { throw new Exception("Invalid stability in compareStabilities argument"); } - - // 'stable' turns to 3 - // 'devel' turns to 0 $s1 = $tmp[$s1]; $s2 = $tmp[$s2]; - if($s1 === $s2) { + if ($s1 === $s2) { return 0; - } elseif($s1 > $s2) { + } elseif ($s1 > $s2) { return 1; - } elseif($s1 < $s2) { + } elseif ($s1 < $s2) { return -1; } + return null; } /** @@ -87,6 +93,7 @@ class Mage_Connect_Validator /** * Validate max len of string + * * @param string $str * @param int $maxLen * @return bool @@ -123,94 +130,103 @@ class Mage_Connect_Validator /** * Validate compatible data + * * @param array $data * @return bool */ public function validateCompatible(array $data) { - if(!count($data)) { + if (!count($data)) { /** * Allow empty */ return true; } $count = 0; - foreach($data as $k=>$v) { - foreach(array('name','channel','min','max') as $fld) { + foreach ($data as $v) { + /** + * Converts an array to variables + * @var $channel string Channel Name + * @var $name string Package Name + * @var $max string Maximum version number + * @var $min string Minimum version number + */ + foreach (array('name','channel','min','max') as $fld) { $$fld = trim($v[$fld]); - } - $count++; - - $res = $this->validateUrl($channel) && strlen($channel); - if(!$res) { - $this->addError("Invalid or empty channel in compat. #{$count}"); - } + } + $count++; - $res = $this->validatePackageName($name) && strlen($name); - if(!$res) { - $this->addError("Invalid or empty name in compat. #{$count}"); - } - $res1 = $this->validateVersion($min); - if(!$res1) { - $this->addError("Invalid or empty minVersion in compat. #{$count}"); - } - $res2 = $this->validateVersion($max); - if(!$res2) { - $this->addError("Invalid or empty maxVersion in compat. #{$count}"); - } - if($res1 && $res2 && $this->versionLower($max, $min)) { - $this->addError("Max version is lower than min in compat #{$count}"); - } + $res = $this->validateUrl($channel) && strlen($channel); + if (!$res) { + $this->addError("Invalid or empty channel in compatibility #{$count}"); + } + $res = $this->validatePackageName($name) && strlen($name); + if (!$res) { + $this->addError("Invalid or empty name in compatibility #{$count}"); + } + $res1 = $this->validateVersion($min); + if (!$res1) { + $this->addError("Invalid or empty minVersion in compatibility #{$count}"); + } + $res2 = $this->validateVersion($max); + if (!$res2) { + $this->addError("Invalid or empty maxVersion in compatibility #{$count}"); + } + if ($res1 && $res2 && $this->versionLower($max, $min)) { + $this->addError("Max version is lower than min in compatibility #{$count}"); + } } - return ! $this->hasErrors(); + return !$this->hasErrors(); } /** * Validate authors of package + * * @param array $authors * @return bool */ public function validateAuthors(array $authors) { - if(!count($authors)) { + if (!count($authors)) { $this->addError('Empty authors section'); return false; } $count = 0; - foreach($authors as $k=>$v) { + foreach ($authors as $v) { $count++; array_map('trim', $v); $name = $v['name']; $login = $v['user']; $email = $v['email']; $res = $this->validateMaxLen($name, 256) && strlen($name); - if(!$res) { + if (!$res) { $this->addError("Invalid or empty name for author #{$count}"); } - $res = $this->validatePackageName($login) && strlen($login); - if(!$res) { + $res = $this->validateAuthorName($login) && strlen($login); + if (!$res) { $this->addError("Invalid or empty login for author #{$count}"); } $res = $this->validateEmail($email); - if(!$res) { + if (!$res) { $this->addError("Invalid or empty email for author #{$count}"); } } - return ! $this->hasErrors(); + return !$this->hasErrors(); } - /** * Validator errors + * * @var array */ private $_errors = array(); /** * Add error + * * @param string $err - * @return + * @return void */ private function addError($err) { @@ -219,10 +235,10 @@ class Mage_Connect_Validator /** * Set validator errors + * * @param array $err - * @return + * @return void */ - private function setErrors(array $err) { $this->_errors = $err; @@ -230,7 +246,8 @@ class Mage_Connect_Validator /** * Clear validator errors - * @return + * + * @return void */ private function clearErrors() { @@ -239,23 +256,24 @@ class Mage_Connect_Validator /** * Check if there are validator errors set - * @return unknown_type + * + * @return int */ public function hasErrors() { return count($this->_errors) != 0; } - /** * Get errors + * * @param bool $clear if true after this call erros will be cleared * @return array */ public function getErrors($clear = true) { $out = $this->_errors; - if($clear) { + if ($clear) { $this->clearErrors(); } return $out; @@ -263,6 +281,7 @@ class Mage_Connect_Validator /** * Validate URL + * * @param string $str * @return bool */ @@ -274,9 +293,9 @@ class Mage_Connect_Validator return preg_match($regex, $str); } - /** * Validates package stability + * * @param string $str * @return bool */ @@ -287,6 +306,7 @@ class Mage_Connect_Validator /** * Validate date format + * * @param $date * @return bool */ @@ -294,13 +314,12 @@ class Mage_Connect_Validator { $subs = null; $check1 = preg_match("/^([\d]{4})-([\d]{2})-([\d]{2})$/i", $date, $subs); - if(!$check1) { + if (!$check1) { return false; } return checkdate($subs[2], $subs[3], $subs[1]); } - /** * Validate email * @param string $email @@ -321,8 +340,20 @@ class Mage_Connect_Validator return preg_match("/^[a-zA-Z0-9_]+$/i", $name); } + /** + * Validate author name + * + * @param string $name + * @return bool + */ + public function validateAuthorName($name) + { + return preg_match("/^[a-zA-Z0-9_-]+$/i", $name); + } + /** * Validate version number + * * @param string $version * @return bool */ @@ -333,6 +364,7 @@ class Mage_Connect_Validator /** * Check versions are equal + * * @param string $v1 * @param string $v2 * @return bool @@ -344,6 +376,7 @@ class Mage_Connect_Validator /** * Check version $v1 <= $v2 + * * @param string $v1 * @param string $v2 * @return bool @@ -353,9 +386,9 @@ class Mage_Connect_Validator return version_compare($v1, $v2, "le"); } - /** * Check if version $v1 lower than $v2 + * * @param string $v1 * @param string $v2 * @return bool @@ -367,6 +400,7 @@ class Mage_Connect_Validator /** * Check version $v1 >= $v2 + * * @param string $v1 * @param string $v2 * @return bool @@ -376,9 +410,9 @@ class Mage_Connect_Validator return version_compare($v1, $v2, "ge"); } - /** * Generic regex validation + * * @param string $str * @param string $regex * @return bool @@ -388,9 +422,9 @@ class Mage_Connect_Validator return preg_match($regex, $str); } - /** * Check if PHP extension loaded + * * @param string $name Extension name * @return bool */ @@ -399,15 +433,22 @@ class Mage_Connect_Validator return extension_loaded($name); } - + /** + * Validate PHP version + * + * @param string $min + * @param string $max + * @param string $ver + * @return bool + */ public function validatePHPVersion($min, $max, $ver = PHP_VERSION) { $minAccepted = true; - if($min) { + if ($min) { $minAccepted = version_compare($ver, $min, ">="); } $maxAccepted = true; - if($max) { + if ($max) { $maxAccepted = version_compare($ver, $max, "<="); } return (bool) $minAccepted && $maxAccepted; diff --git a/downloader/lib/Mage/DB/Exception.php b/downloader/lib/Mage/DB/Exception.php index 14038cfcdf5..36d72fe7d1b 100644 --- a/downloader/lib/Mage/DB/Exception.php +++ b/downloader/lib/Mage/DB/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_DB - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/DB/Mysqli.php b/downloader/lib/Mage/DB/Mysqli.php index 7871e92f64d..5f7a4a683df 100644 --- a/downloader/lib/Mage/DB/Mysqli.php +++ b/downloader/lib/Mage/DB/Mysqli.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_DB - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Exception.php b/downloader/lib/Mage/Exception.php index 0f91be1c6da..87698fe6587 100644 --- a/downloader/lib/Mage/Exception.php +++ b/downloader/lib/Mage/Exception.php @@ -19,8 +19,8 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_Exception - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @package Mage + * @copyright 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,4 +32,4 @@ * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Exception extends Exception -{} +{} \ No newline at end of file diff --git a/downloader/lib/Mage/HTTP/Client.php b/downloader/lib/Mage/HTTP/Client.php index 797b9f627a7..5fa2d8cae90 100644 --- a/downloader/lib/Mage/HTTP/Client.php +++ b/downloader/lib/Mage/HTTP/Client.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_HTTP - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,10 +31,8 @@ * @package Mage_Connect * @author Magento Core Team <core@magentocommerce.com> */ - class Mage_HTTP_Client { - /** * Disallow to instantiate - pvt constructor */ @@ -43,24 +41,24 @@ class Mage_HTTP_Client } - /** * Factory for HTTP client - * @param string/false $frontend 'curl'/'socket' or false for auto-detect + * + * @static + * @throws Exception + * @param string|bool $frontend 'curl'/'socket' or false for auto-detect * @return Mage_HTTP_IClient */ public static function getInstance($frontend = false) { - if(false === $frontend) - { + if (false === $frontend) { $frontend = self::detectFrontend(); } - if(false === $frontend) - { + if (false === $frontend) { throw new Exception("Cannot find frontend automatically, set it manually"); } - $class = __CLASS__."_".str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $frontend))); + $class = __CLASS__ . "_" . str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $frontend))); $obj = new $class(); return $obj; } @@ -73,10 +71,10 @@ class Mage_HTTP_Client */ protected static function detectFrontend() { - if(function_exists("curl_init")) { + if (function_exists("curl_init")) { return "curl"; } - if(function_exists("fsockopen")) { + if (function_exists("fsockopen")) { return "socket"; } return false; diff --git a/downloader/lib/Mage/HTTP/Client/Curl.php b/downloader/lib/Mage/HTTP/Client/Curl.php index 0840f185007..7ac2d0c912a 100644 --- a/downloader/lib/Mage/HTTP/Client/Curl.php +++ b/downloader/lib/Mage/HTTP/Client/Curl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_HTTP - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/HTTP/Client/Socket.php b/downloader/lib/Mage/HTTP/Client/Socket.php index 6a428f5f71c..5b3ef0a9842 100644 --- a/downloader/lib/Mage/HTTP/Client/Socket.php +++ b/downloader/lib/Mage/HTTP/Client/Socket.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_HTTP - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/HTTP/IClient.php b/downloader/lib/Mage/HTTP/IClient.php index 1d351b88e5d..90e92b5f45e 100644 --- a/downloader/lib/Mage/HTTP/IClient.php +++ b/downloader/lib/Mage/HTTP/IClient.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_HTTP - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/System/Args.php b/downloader/lib/Mage/System/Args.php index 3dd4442a4b3..416113b951f 100644 --- a/downloader/lib/Mage/System/Args.php +++ b/downloader/lib/Mage/System/Args.php @@ -19,8 +19,8 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_System - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @package Mage_Connect + * @copyright 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,7 +59,7 @@ class Mage_System_Args { $this->flags = array(); $this->filtered = array(); - + if(false === $source) { $argv = $GLOBALS['argv']; array_shift($argv); @@ -89,7 +89,7 @@ class Mage_System_Args } elseif(strlen($str) == 2 && $str[0] == '-') // -a { - $this->flags[$str[1]] = true; + $this->flags[$str[1]] = true; if(isset($argv[$i + 1]) && preg_match('/^--?.+/', $argv[$i + 1]) == 0) { $this->flags[$str[1]] = $argv[$i + 1]; $argv[$i + 1] = null; @@ -99,4 +99,4 @@ class Mage_System_Args } } } -} +} \ No newline at end of file diff --git a/downloader/lib/Mage/System/Dirs.php b/downloader/lib/Mage/System/Dirs.php index 866cf4c793c..e6fee86becc 100644 --- a/downloader/lib/Mage/System/Dirs.php +++ b/downloader/lib/Mage/System/Dirs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_System - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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_System_Dirs @@ -35,12 +35,12 @@ class Mage_System_Dirs if (!@file_exists($dirname)) { return false; } - + // Simple delete for a file if (@is_file($dirname) || @is_link($dirname)) { return unlink($dirname); } - + // Create and iterate stack $stack = array($dirname); while ($entry = array_pop($stack)) { @@ -49,12 +49,12 @@ class Mage_System_Dirs @unlink($entry); continue; } - + // Attempt to remove the directory if (@rmdir($entry)) { continue; } - + // Otherwise add it to the stack $stack[] = $entry; $dh = opendir($entry); @@ -62,7 +62,7 @@ class Mage_System_Dirs // Ignore pointers if ($child === '.' || $child === '..') { continue; - } + } // Unlink files and add directories to stack $child = $entry . DIRECTORY_SEPARATOR . $child; if (is_dir($child) && !is_link($child)) { @@ -72,33 +72,33 @@ class Mage_System_Dirs } } @closedir($dh); - } + } return true; - } - - + } + + public static function mkdirStrict($path, $recursive = true, $mode = 0777) { - $exists = file_exists($path); + $exists = file_exists($path); if($exists && is_dir($path)) { return true; } if($exists && !is_dir($path)) { throw new Exception("'{$path}' already exists, should be a dir, not a file!"); - } - $out = @mkdir($path, $mode, $recursive); + } + $out = @mkdir($path, $mode, $recursive); if(false === $out) { throw new Exception("Can't create dir: '{$path}'"); - } + } return true; } - + public static function copyFileStrict($source, $dest) { $exists = file_exists($source); if(!$exists) { throw new Exception('No file exists: '.$exists); } - + } -} +} \ No newline at end of file diff --git a/downloader/lib/Mage/System/Ftp.php b/downloader/lib/Mage/System/Ftp.php new file mode 100755 index 00000000000..d348981626e --- /dev/null +++ b/downloader/lib/Mage/System/Ftp.php @@ -0,0 +1,509 @@ +<?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_System + * @copyright 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 to work with remote FTP server + * + * @category Mage + * @package Mage_System + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_System_Ftp +{ + + /** + * Connection object + * + * @var resource + */ + protected $_conn = false; + + /** + * Check connected, throw exception if not + * + * @throws Exception + * @return void + */ + protected function checkConnected() + { + if(!$this->_conn) { + throw new Exception(__CLASS__." - no connection established with server"); + } + } + + /** + * ftp_mkdir wrapper + * + * @param sting $name + * @return unknown_type + */ + public function mdkir($name) + { + $this->checkConnected(); + return @ftp_mkdir($this->_conn, $name); + } + + /** + * Make dir recursive + * + * @param string $path + * @param int $mode + * @return bool + */ + public function mkdirRecursive($path, $mode = 0777) + { + $this->checkConnected(); + $dir = explode("/", $path); + $path= ""; + $ret = true; + for ($i=0; $i < count($dir); $i++) { + $path .= "/" .$dir[$i]; + if(!@ftp_chdir($this->_conn, $path)) { + @ftp_chdir($this->_conn,"/"); + if(!@ftp_mkdir($this->_conn,$path)) { + $ret=false; + break; + } else { + @ftp_chmod($this->_conn, $mode, $path); + } + } + } + return $ret; + } + + /** + * Try to login to server + * + * @param string $login + * @param string $password + * @throws Exception on invalid login credentials + * @return bool + */ + public function login($login = "anonymous", $password = "") + { + $this->checkConnected(); + $res = @ftp_login($this->_conn, $login, $password); + if(!$res) { + throw new Exception("Invalid login credentials"); + } + return $res; + } + + /** + * Validate connection string + * + * @param string $string + * @throws Exception + * @return string + */ + public function validateConnectionString($string) + { + $data = @parse_url($string); + if(false === $data) { + throw new Exception("Connection string invalid: '{$string}'"); + } + if($data['scheme'] != 'ftp') { + throw new Exception("Support for scheme unsupported: '{$data['scheme']}'"); + } + return $data; + } + + /** + * Connect to server using connect string + * Connection string: ftp://user:pass@server:port/path + * user,pass,port,path are optional parts + * + * @param string $string + * @param int $timeout + */ + public function connect($string, $timeout = 900) + { + $params = $this->validateConnectionString($string); + $port = isset($params['port']) ? intval($params['port']) : 21; + + $this->_conn = ftp_connect($params['host'], $port, $timeout); + + if(!$this->_conn) { + throw new Exception("Cannot connect to host: {$params['host']}"); + } + if(isset($params['user']) && isset($params['pass'])) { + $this->login($params['user'], $params['pass']); + } else { + $this->login(); + } + if(isset($params['path'])) { + if(!$this->chdir($params['path'])) { + throw new Exception ("Cannot chdir after login to: {$params['path']}"); + } + } + } + + /** + * ftp_fput wrapper + * + * @param string $remoteFile + * @param resource $handle + * @param int $mode FTP_BINARY | FTP_ASCII + * @param int $startPos + * @return bool + */ + public function fput($remoteFile, $handle, $mode = FTP_BINARY, $startPos = 0) + { + $this->checkConnected(); + return @ftp_fput($this->_conn, $remoteFile, $handle, $mode, $startPos); + } + + /** + * ftp_put wrapper + * + * @param string $remoteFile + * @param string $localFile + * @param int $mode FTP_BINARY | FTP_ASCII + * @param int $startPos + * @return bool + */ + public function put($remoteFile, $localFile, $mode = FTP_BINARY, $startPos = 0) + { + $this->checkConnected(); + return ftp_put($this->_conn, $remoteFile, $localFile, $mode, $startPos); + } + + /** + * Get current working directory + * + * @return mixed + */ + public function getcwd() + { + $d = $this->raw("pwd"); + $data = explode(" ", $d[0], 3); + if(empty($data[1])) { + return false; + } + if(intval($data[0]) != 257) { + return false; + } + $out = trim($data[1], '"'); + if($out !== "/") { + $out = rtrim($out, "/"); + } + return $out; + } + + /** + * ftp_raw wrapper + * + * @param string $cmd + * @return mixed + */ + public function raw($cmd) + { + $this->checkConnected(); + return @ftp_raw($this->_conn, $cmd); + } + + /** + * Upload local file to remote + * + * Can be used for relative and absoulte remote paths + * Relative: use chdir before calling this + * + * @param srting $remote + * @param string $local + * @param int $dirMode + * @param int $ftpMode + * @return unknown_type + */ + public function upload($remote, $local, $dirMode = 0777, $ftpMode = FTP_BINARY) + { + $this->checkConnected(); + + if(!file_exists($local)) { + throw new Exception("Local file doesn't exist: {$localFile}"); + } + if(!is_readable($local)) { + throw new Exception("Local file is not readable: {$localFile}"); + } + if(is_dir($local)) { + throw new Exception("Directory given instead of file: {$localFile}"); + } + + $globalPathMode = substr($remote, 0, 1) == "/"; + $dirname = dirname($remote); + $cwd = $this->getcwd(); + if(false === $cwd) { + throw new Exception("Server returns something awful on PWD command"); + } + + if(!$globalPathMode) { + $dirname = $cwd."/".$dirname; + $remote = $cwd."/".$remote; + } + $res = $this->mkdirRecursive($dirname, $dirMode); + $this->chdir($cwd); + + if(!$res) { + return false; + } + return $this->put($remote, $local, $ftpMode); + } + + /** + * Download remote file to local machine + * + * @param string $remote + * @param string $local + * @param int $ftpMode FTP_BINARY|FTP_ASCII + * @return bool + */ + public function download($remote, $local, $ftpMode = FTP_BINARY) + { + $this->checkConnected(); + return $this->get($local, $remote, $ftpMode); + } + + /** + * ftp_pasv wrapper + * + * @param bool $pasv + * @return bool + */ + public function pasv($pasv) + { + $this->checkConnected(); + return @ftp_pasv($this->_conn, (bool) $pasv); + } + + /** + * Close FTP connection + * + * @return void + */ + public function close() + { + if($this->_conn) { + @ftp_close($this->_conn); + } + } + + /** + * ftp_chmod wrapper + * + * @param $mode + * @param $remoteFile + * @return bool + */ + public function chmod($mode, $remoteFile) + { + $this->checkConnected(); + return @ftp_chmod($this->_conn, $mode, $remoteFile); + } + + /** + * ftp_chdir wrapper + * + * @param string $dir + * @return bool + */ + public function chdir($dir) + { + $this->checkConnected(); + return @ftp_chdir($this->_conn, $dir); + } + + /** + * ftp_cdup wrapper + * + * @return bool + */ + public function cdup() + { + $this->checkConnected(); + return @ftp_cdup($this->_conn); + } + + /** + * ftp_get wrapper + * + * @param string $localFile + * @param string $remoteFile + * @param int $fileMode FTP_BINARY | FTP_ASCII + * @param int $resumeOffset + * @return bool + */ + public function get($localFile, $remoteFile, $fileMode = FTP_BINARY, $resumeOffset = 0) + { + $remoteFile = $this->correctFilePath($remoteFile); + $this->checkConnected(); + return @ftp_get($this->_conn, $localFile, $remoteFile, $fileMode, $resumeOffset); + } + + /** + * ftp_nlist wrapper + * + * @param string $dir + * @return bool + */ + public function nlist($dir = "/") + { + $this->checkConnected(); + $dir = $this->correctFilePath($dir); + return @ftp_nlist($this->_conn, $dir); + } + + /** + * ftp_rawlist wrapper + * + * @param string $dir + * @param bool $recursive + * @return mixed + */ + public function rawlist( $dir = "/", $recursive = false ) + { + $this->checkConnected(); + $dir = $this->correctFilePath($dir); + return @ftp_rawlist($this->_conn, $dir, $recursive); + } + + /** + * Convert byte count to float KB/MB format + * + * @param int $bytes + * @return string + */ + public static function byteconvert($bytes) + { + $symbol = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); + $exp = floor( log($bytes) / log(1024) ); + return sprintf( '%.2f ' . $symbol[ $exp ], ($bytes / pow(1024, floor($exp))) ); + } + + /** + * Chmod string "-rwxrwxrwx" to "777" converter + * + * @param string $chmod + * @return string + */ + public static function chmodnum($chmod) + { + $trans = array('-' => '0', 'r' => '4', 'w' => '2', 'x' => '1'); + $chmod = substr(strtr($chmod, $trans), 1); + $array = str_split($chmod, 3); + return array_sum(str_split($array[0])) . array_sum(str_split($array[1])) . array_sum(str_split($array[2])); + } + + /** + * Check whether file exists + * + * @param string $path + * @param bool $excludeIfIsDir + * @return bool + */ + public function fileExists($path, $excludeIfIsDir = true) + { + $path = $this->correctFilePath($path); + $globalPathMode = substr($path, 0, 1) == "/"; + + $file = basename($path); + $dir = $globalPathMode ? dirname($path) : $this->getcwd()."/".$path; + $data = $this->ls($dir); + foreach($data as $row) { + if($file == $row['name']) { + if($excludeIfIsDir && $row['dir']) { + continue; + } + return true; + } + } + return false; + } + + /** + * Get directory contents in PHP array + * + * @param string $dir + * @param bool $recursive + * @return array + */ + public function ls($dir = "/", $recursive = false) + { + $dir= $this->correctFilePath($dir); + $rawfiles = (array) $this->rawlist($dir, $recursive); + $structure = array(); + $arraypointer = &$structure; + foreach ($rawfiles as $rawfile) { + if ($rawfile[0] == '/') { + $paths = array_slice(explode('/', str_replace(':', '', $rawfile)), 1); + $arraypointer = &$structure; + foreach ($paths as $path) { + foreach ($arraypointer as $i => $file) { + if ($file['name'] == $path) { + $arraypointer = &$arraypointer[ $i ]['children']; + break; + } + } + } + } elseif(!empty($rawfile)) { + $info = preg_split("/[\s]+/", $rawfile, 9); + $arraypointer[] = array( + 'name' => $info[8], + 'dir' => $info[0]{0} == 'd', + 'size' => (int) $info[4], + 'chmod' => self::chmodnum($info[0]), + 'rawdata' => $info, + 'raw' => $rawfile + ); + } + } + return $structure; + } + + /** + * Correct file path + * + * @param string $str + * @return string + */ + public function correctFilePath($str) + { + $str = str_replace("\\", "/", $str); + $str = preg_replace("/^.\//", "", $str); + return $str; + } + + /** + * Delete file + * + * @param string $file + * @return bool + */ + public function delete($file) + { + $this->checkConnected(); + $file = $this->correctFilePath($file); + return @ftp_delete($this->_conn, $file); + } +} diff --git a/downloader/lib/Mage/Xml/Generator.php b/downloader/lib/Mage/Xml/Generator.php index 79eb709eba0..a66f73c1206 100644 --- a/downloader/lib/Mage/Xml/Generator.php +++ b/downloader/lib/Mage/Xml/Generator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Xml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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_Xml_Generator diff --git a/downloader/lib/Mage/Xml/Parser.php b/downloader/lib/Mage/Xml/Parser.php index 5411c2d7abf..31912941a3e 100644 --- a/downloader/lib/Mage/Xml/Parser.php +++ b/downloader/lib/Mage/Xml/Parser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Xml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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_Xml_Parser diff --git a/downloader/mage.php b/downloader/mage.php index eaf65a78e0f..13a68d59417 100644 --- a/downloader/mage.php +++ b/downloader/mage.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/downloader/skin/boxes.css b/downloader/skin/boxes.css index f35d2366471..e17bc0fdfc9 100644 --- a/downloader/skin/boxes.css +++ b/downloader/skin/boxes.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* diff --git a/downloader/skin/ie7boxes.css b/downloader/skin/ie7boxes.css index 01b21b645bb..9e845a2fb8b 100644 --- a/downloader/skin/ie7boxes.css +++ b/downloader/skin/ie7boxes.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ .main { height:auto !important; } diff --git a/downloader/skin/ieboxes.css b/downloader/skin/ieboxes.css index 13c0deef26a..363647beab7 100644 --- a/downloader/skin/ieboxes.css +++ b/downloader/skin/ieboxes.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ button, .form-button { filter:chroma(color=#000000); overflow:visible; width:auto; } diff --git a/downloader/skin/install/boxes.css b/downloader/skin/install/boxes.css index eef0413bcd4..4a68125f861 100644 --- a/downloader/skin/install/boxes.css +++ b/downloader/skin/install/boxes.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/downloader/skin/install/clears.css b/downloader/skin/install/clears.css index 4edc49323a2..6faf5a2c906 100644 --- a/downloader/skin/install/clears.css +++ b/downloader/skin/install/clears.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/downloader/skin/install/ie7minus.css b/downloader/skin/install/ie7minus.css index fbe2dc3afb3..387afa1f8b8 100644 --- a/downloader/skin/install/ie7minus.css +++ b/downloader/skin/install/ie7minus.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/downloader/skin/install/iestyles.css b/downloader/skin/install/iestyles.css index 7154566a320..753e7905634 100644 --- a/downloader/skin/install/iestyles.css +++ b/downloader/skin/install/iestyles.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ .col2-set, diff --git a/downloader/skin/install/reset.css b/downloader/skin/install/reset.css index 177f95b6985..9c54b4e305d 100644 --- a/downloader/skin/install/reset.css +++ b/downloader/skin/install/reset.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /******************************************/ diff --git a/downloader/target.xml b/downloader/target.xml index a40d45a4f80..1ccf13fef8e 100644 --- a/downloader/target.xml +++ b/downloader/target.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/downloader/template/connect/iframe.phtml b/downloader/template/connect/iframe.phtml index a20161c48c7..2a03f4bbb09 100644 --- a/downloader/template/connect/iframe.phtml +++ b/downloader/template/connect/iframe.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,11 @@ function confirmExit() function onSubmit(formObj) { - if(formObj)formObj.action = addParamToUrl(formObj.action, 'maintenance', (top.$('maintenance').checked === true ? '1' : '0')); + if(formObj){ + formObj.action = addParamToUrl(formObj.action, 'maintenance', (top.$('maintenance').checked === true ? '1' : '0')); + formObj.action = addParamToUrl(formObj.action, 'archive_type', top.$('is_backup').checked === true ? top.$('archive_type').value:0); + formObj.action = addParamToUrl(formObj.action, 'backup_name', top.$('backup_name').value); + } top.$('connect_iframe_success').style.display = 'none'; top.$('connect_iframe_failure').style.display = 'none'; top.$('connect_iframe_container').style.display = ''; diff --git a/downloader/template/connect/packages.phtml b/downloader/template/connect/packages.phtml index 459feb098aa..a0a3d812d9e 100644 --- a/downloader/template/connect/packages.phtml +++ b/downloader/template/connect/packages.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,17 +30,54 @@ <h4>Settings</h4> </div> <ul class="bare-list"> -<li><input type="checkbox" id="maintenance" value="1" checked="checked" /> -<label for="maintenance">Put store on the maintenance mode while installing/upgrading</label> -</li> + <li> + <input type="checkbox" id="maintenance" value="1" checked="checked" /> + <label for="maintenance">Put store on the maintenance mode while installing/upgrading/backup creating</label> + </li> + <li> + <table cellpadding="0" cellspacing="0"> + <tr> + <td rowspan="2" valign="top"> + <input type="checkbox" id="is_backup" value="1" /> + </td> + <td> + <label for="is_backup">Create Backup</label> + </td> + <td> + <select id="archive_type" style="width: 320px;"> + <option value="1">Database</option> + <option value="4">Database and Media</option> + <option value="2">System</option> + <option value="3">System (excluding Media)</option> + </select> + </td> + </tr> + <tr id="backup-name-container" style="display: none; margin-top: 5px;"> + <td> + <label for="backup_name">Backup Name</label> + </td> + <td> + <input type="text" name="backup_name" id="backup_name" style="width: 320px; margin-top:8px;"/> + </td> + </tr> + </table> + </li> </ul> - <div class="bar-head"> <h4>Install New Extensions</h4> </div> <script type="text/javascript"> <!-- - function connectPrepare(form) { +changeAvailableArchiveStatus = function (){ + $('archive_type').disabled = !$('is_backup').checked; + $('is_backup').checked ? $('backup-name-container').show() : $('backup-name-container').hide(); + $('backup_name').value = ''; +} + +Event.observe('is_backup', 'change', changeAvailableArchiveStatus); +Event.observe(window, 'load', changeAvailableArchiveStatus); + +function connectPrepare(form) { new Ajax.Request(form.action, { method:'post', parameters: {install_package_id: form.install_package_id.value}, diff --git a/downloader/template/connect/packages_prepare.phtml b/downloader/template/connect/packages_prepare.phtml index 36d2198d9c1..f9370b3646d 100644 --- a/downloader/template/connect/packages_prepare.phtml +++ b/downloader/template/connect/packages_prepare.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/exception.phtml b/downloader/template/exception.phtml index c961fa45be3..000c3e21e2d 100644 --- a/downloader/template/exception.phtml +++ b/downloader/template/exception.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/footer.phtml b/downloader/template/footer.phtml index 0733e19cf5f..372e7e15cfb 100755 --- a/downloader/template/footer.phtml +++ b/downloader/template/footer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/header.phtml b/downloader/template/header.phtml index 0f4fc494dfe..e48fab01db8 100644 --- a/downloader/template/header.phtml +++ b/downloader/template/header.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/index.phtml b/downloader/template/index.phtml index 5a6c59b911e..fc7b1ea57ff 100755 --- a/downloader/template/index.phtml +++ b/downloader/template/index.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/install/download.phtml b/downloader/template/install/download.phtml index 488e7147f54..2099c14b184 100644 --- a/downloader/template/install/download.phtml +++ b/downloader/template/install/download.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,13 +41,13 @@ <button class="form-button" type="button" onclick="location.href='<?php echo $this->mageUrl() ?>'"><span>Continue Magento installation</span></button> <br/><br/><br/> <p>Alternatively, you could proceed with Re-Downloading all packages</p> - <?php echo($this->get('channel_notice')); ?> + <?php echo($this->get('channel_notice')); ?> <form id="reinstall_all" method="post" action="<?php echo $this->url('connectInstallAll') ?>&force=1" target="connect_iframe" onsubmit="return installAll(true)"> <fieldset class="fieldset-download"> <?php endif; ?> <table cellspacing="0" class="form-list"> - <tr> + <tr> <td class="label">Magento Connect Channel Protocol:</td> <td class="value"> <select id="protocol" name="protocol"> @@ -55,8 +55,18 @@ <option value="ftp" <?php if ($this->get('protocol')=='ftp'):?>selected="selected"<?php endif ?>>Ftp</option> </select> </td> - </tr> - <?php echo($this->get('channel_protocol_fields')); ?> + </tr> + <?php echo($this->get('channel_protocol_fields')); ?> + <tr> + <td class="label">Magento Version Stability:</td> + <td class="value"> + <select id="preferred_state" name="preferred_state"> + <option value="stable" <?php if ($this->get('preferred_state') == 'stable'):?>selected="selected"<?php endif ?>>stable</option> + <option value="beta" <?php if ($this->get('preferred_state') == 'beta'):?>selected="selected"<?php endif ?>>beta</option> + <option value="alpha" <?php if ($this->get('preferred_state') == 'alpha'):?>selected="selected"<?php endif ?>>alpha</option> + </select> + </td> + </tr> <tr> <td class="label">Use Custom Permissions:</td> <td class="value"> @@ -71,13 +81,13 @@ <tr> <td class="label">Folders:</td> <td class="value"> - <input id="mkdir_mode" name="mkdir_mode" value="<?php echo($this->get('mkdir_mode'));?>" type="text" class="input-text"></input> + <input id="mkdir_mode" name="mkdir_mode" value="<?php echo($this->get('mkdir_mode'));?>" type="text" class="input-text"/> </td> </tr> <tr> <td class="label">Files:</td> <td class="value"> - <input id="chmod_file_mode" name="chmod_file_mode" value="<?php echo($this->get('chmod_file_mode'));?>" type="text" class="input-text"></input> + <input id="chmod_file_mode" name="chmod_file_mode" value="<?php echo($this->get('chmod_file_mode'));?>" type="text" class="input-text"/> </td> </tr> </table> diff --git a/downloader/template/install/footer.phtml b/downloader/template/install/footer.phtml index 9c7e422c9c7..385246b378c 100644 --- a/downloader/template/install/footer.phtml +++ b/downloader/template/install/footer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/install/header.phtml b/downloader/template/install/header.phtml index 07c92673c4d..c259f1a659a 100644 --- a/downloader/template/install/header.phtml +++ b/downloader/template/install/header.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/install/writable.phtml b/downloader/template/install/writable.phtml index 30c0bd88e01..38809447e5f 100644 --- a/downloader/template/install/writable.phtml +++ b/downloader/template/install/writable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/login.phtml b/downloader/template/login.phtml index 5221b245246..71fdffb92f3 100755 --- a/downloader/template/login.phtml +++ b/downloader/template/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/messages.phtml b/downloader/template/messages.phtml index 4a0cf4dcb31..ec5acdbf120 100755 --- a/downloader/template/messages.phtml +++ b/downloader/template/messages.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/noroute.phtml b/downloader/template/noroute.phtml index 3c88a577160..fd34843b4b2 100755 --- a/downloader/template/noroute.phtml +++ b/downloader/template/noroute.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/settings.phtml b/downloader/template/settings.phtml index 61ea08db4fa..d05a3dfd677 100755 --- a/downloader/template/settings.phtml +++ b/downloader/template/settings.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/writable.phtml b/downloader/template/writable.phtml index 9572eb5389c..556b28dbfb0 100755 --- a/downloader/template/writable.phtml +++ b/downloader/template/writable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/index.php b/index.php index 645fec8f1a7..65f5ca00090 100644 --- a/index.php +++ b/index.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/index.php.sample b/index.php.sample index e15c51c5097..763066a3f28 100644 --- a/index.php.sample +++ b/index.php.sample @@ -20,7 +20,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Archive.php b/lib/Mage/Archive.php index 7685b2668a9..99dcd09c6b1 100644 --- a/lib/Mage/Archive.php +++ b/lib/Mage/Archive.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -143,7 +143,8 @@ class Mage_Archive * * @param string $source * @param string $destination - * @param boolean $tillTar + * @param bool $tillTar + * @param bool $clearInterm * @return string Path to file */ public function unpack($source, $destination='.', $tillTar=false, $clearInterm = true) @@ -160,9 +161,7 @@ class Mage_Archive $packed = rtrim($destination, DS) . DS . '~tmp-'. microtime(true) . $archivers[$i-1] . '.' . $archivers[$i-1]; } $source = $this->_getArchiver($archivers[$i])->unpack($source, $packed); - - //var_dump($packed, $source); - + if ($clearInterm && $interimSource && $i >= 0) { unlink($interimSource); } @@ -218,5 +217,4 @@ class Mage_Archive } return false; } - -} \ No newline at end of file +} diff --git a/lib/Mage/Archive/Abstract.php b/lib/Mage/Archive/Abstract.php index ec8ccf0a606..2aece187955 100644 --- a/lib/Mage/Archive/Abstract.php +++ b/lib/Mage/Archive/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,14 +34,16 @@ class Mage_Archive_Abstract { /** - * Write data to file. If file can't be opened, + * Write data to file. If file can't be opened - throw exception * * @param string $destination * @param string $data * @return boolean + * @throws Mage_Exception */ protected function _writeFile($destination, $data) { + $destination = trim($destination); if(false === file_put_contents($destination, $data)) { throw new Mage_Exception("Can't write to file: " . $destination); } @@ -53,6 +55,7 @@ class Mage_Archive_Abstract * * @param string $source * @return string + * @throws Mage_Exception */ protected function _readFile($source) { @@ -70,7 +73,8 @@ class Mage_Archive_Abstract * Get file name from source (URI) without last extension. * * @param string $source - * @return string + * @param bool $withExtension + * @return mixed|string */ public function getFilename($source, $withExtension=false) { @@ -80,5 +84,4 @@ class Mage_Archive_Abstract } return $file; } - -} \ No newline at end of file +} diff --git a/lib/Mage/Archive/Bz.php b/lib/Mage/Archive/Bz.php index 21c5c7e9963..c76b62049ef 100644 --- a/lib/Mage/Archive/Bz.php +++ b/lib/Mage/Archive/Bz.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,9 +43,19 @@ class Mage_Archive_Bz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function pack($source, $destination) { - $data = $this->_readFile($source); - $bzData = bzcompress($data, 9); - $this->_writeFile($destination, $bzData); + $fileReader = new Mage_Archive_Helper_File($source); + $fileReader->open('r'); + + $archiveWriter = new Mage_Archive_Helper_File_Bz($destination); + $archiveWriter->open('w'); + + while (!$fileReader->eof()) { + $archiveWriter->write($fileReader->read()); + } + + $fileReader->close(); + $archiveWriter->close(); + return $destination; } @@ -58,21 +68,21 @@ class Mage_Archive_Bz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function unpack($source, $destination) { - $data = ''; - $bzPointer = bzopen($source, 'r' ); - if (empty($bzPointer)) { - throw new Exception('Can\'t open BZ archive : ' . $source); - } - while (!feof($bzPointer)) { - $data .= bzread($bzPointer, 131072); - } - bzclose($bzPointer); if (is_dir($destination)) { $file = $this->getFilename($source); $destination = $destination . $file; } - echo $destination; - $this->_writeFile($destination, $data); + + $archiveReader = new Mage_Archive_Helper_File_Bz($source); + $archiveReader->open('r'); + + $fileWriter = new Mage_Archive_Helper_File($destination); + $fileWriter->open('w'); + + while (!$archiveReader->eof()) { + $fileWriter->write($archiveReader->read()); + } + return $destination; } diff --git a/lib/Mage/Archive/Gz.php b/lib/Mage/Archive/Gz.php index 4600d5f643e..6c213543d0d 100644 --- a/lib/Mage/Archive/Gz.php +++ b/lib/Mage/Archive/Gz.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,9 +42,19 @@ class Mage_Archive_Gz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function pack($source, $destination) { - $data = $this->_readFile($source); - $gzData = gzencode($data, 9); - $this->_writeFile($destination, $gzData); + $fileReader = new Mage_Archive_Helper_File($source); + $fileReader->open('r'); + + $archiveWriter = new Mage_Archive_Helper_File_Gz($destination); + $archiveWriter->open('wb9'); + + while (!$fileReader->eof()) { + $archiveWriter->write($fileReader->read()); + } + + $fileReader->close(); + $archiveWriter->close(); + return $destination; } @@ -57,21 +67,21 @@ class Mage_Archive_Gz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function unpack($source, $destination) { - $gzPointer = gzopen($source, 'r' ); - if (empty($gzPointer)) { - throw new Mage_Exception('Can\'t open GZ archive : ' . $source); - } - $data = ''; - while (!gzeof($gzPointer)) { - $data .= gzread($gzPointer, 131072); - } - gzclose($gzPointer); if (is_dir($destination)) { $file = $this->getFilename($source); $destination = $destination . $file; } - $this->_writeFile($destination, $data); + + $archiveReader = new Mage_Archive_Helper_File_Gz($source); + $archiveReader->open('r'); + + $fileWriter = new Mage_Archive_Helper_File($destination); + $fileWriter->open('w'); + + while (!$archiveReader->eof()) { + $fileWriter->write($archiveReader->read()); + } + return $destination; } - } \ No newline at end of file diff --git a/lib/Mage/Archive/Helper/File.php b/lib/Mage/Archive/Helper/File.php new file mode 100644 index 00000000000..04872633894 --- /dev/null +++ b/lib/Mage/Archive/Helper/File.php @@ -0,0 +1,274 @@ +<?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_Archive + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** +* Helper class that simplifies files stream reading and writing +* +* @category Mage +* @package Mage_Archive +* @author Magento Core Team <core@magentocommerce.com> +*/ +class Mage_Archive_Helper_File +{ + /** + * Full path to directory where file located + * + * @var string + */ + protected $_fileLocation; + + /** + * File name + * + * @var string + */ + protected $_fileName; + + /** + * Full path (directory + filename) to file + * + * @var string + */ + protected $_filePath; + + /** + * File permissions that will be set if file opened in write mode + * + * @var int + */ + protected $_chmod; + + /** + * File handler + * + * @var pointer + */ + protected $_fileHandler; + + /** + * Set file path via constructor + * + * @param string $filePath + */ + public function __construct($filePath) + { + $pathInfo = pathinfo($filePath); + + $this->_filePath = $filePath; + $this->_fileLocation = isset($pathInfo['dirname']) ? $pathInfo['dirname'] : ''; + $this->_fileName = isset($pathInfo['basename']) ? $pathInfo['basename'] : ''; + } + + /** + * Close file if it's not closed before object destruction + */ + public function __destruct() + { + if ($this->_fileHandler) { + $this->_close(); + } + } + + /** + * Open file + * + * @param string $mode + * @param int $chmod + * @throws Mage_Exception + */ + public function open($mode = 'w+', $chmod = 0666) + { + if ($this->_isWritableMode($mode)) { + if (!is_writable($this->_fileLocation)) { + throw new Mage_Exception('Permission denied to write to ' . $this->_fileLocation); + } + + if (is_file($this->_filePath) && !is_writable($this->_filePath)) { + throw new Mage_Exception("Can't open file " . $this->_fileName . " for writing. Permission denied."); + } + } + + if ($this->_isReadableMode($mode) && (!is_file($this->_filePath) || !is_readable($this->_filePath))) { + if (!is_file($this->_filePath)) { + throw new Mage_Exception('File ' . $this->_filePath . ' does not exist'); + } + + if (!is_readable($this->_filePath)) { + throw new Mage_Exception('Permission denied to read file ' . $this->_filePath); + } + } + + $this->_open($mode); + + $this->_chmod = $chmod; + } + + /** + * Write data to file + * + * @param string $data + */ + public function write($data) + { + $this->_checkFileOpened(); + $this->_write($data); + } + + /** + * Read data from file + * + * @param int $length + * @return string|boolean + */ + public function read($length = 4096) + { + $data = false; + $this->_checkFileOpened(); + if ($length > 0) { + $data = $this->_read($length); + } + + return $data; + } + + /** + * Check whether end of file reached + * + * @return boolean + */ + public function eof() + { + $this->_checkFileOpened(); + return $this->_eof(); + } + + /** + * Close file + */ + public function close() + { + $this->_checkFileOpened(); + $this->_close(); + $this->_fileHandler = false; + @chmod($this->_filePath, $this->_chmod); + } + + /** + * Implementation of file opening + * + * @param string $mode + * @throws Mage_Exception + */ + protected function _open($mode) + { + $this->_fileHandler = @fopen($this->_filePath, $mode); + + if (false === $this->_fileHandler) { + throw new Mage_Exception('Failed to open file ' . $this->_filePath); + } + } + + /** + * Implementation of writing data to file + * + * @param string $data + * @throws Mage_Exception + */ + protected function _write($data) + { + $result = @fwrite($this->_fileHandler, $data); + + if (false === $result) { + throw new Mage_Exception('Failed to write data to ' . $this->_filePath); + } + } + + /** + * Implementation of file reading + * + * @param int $length + * @throws Mage_Exception + */ + protected function _read($length) + { + $result = fread($this->_fileHandler, $length); + + if (false === $result) { + throw new Mage_Exception('Failed to read data from ' . $this->_filePath); + } + + return $result; + } + + /** + * Implementation of EOF indicator + * + * @return boolean + */ + protected function _eof() + { + return feof($this->_fileHandler); + } + + /** + * Implementation of file closing + */ + protected function _close() + { + fclose($this->_fileHandler); + } + + /** + * Check whether requested mode is writable mode + * + * @param string $mode + */ + protected function _isWritableMode($mode) + { + return preg_match('/(^[waxc])|(\+$)/', $mode); + } + + /** + * Check whether requested mode is readable mode + * + * @param string $mode + */ + protected function _isReadableMode($mode) { + return !$this->_isWritableMode($mode); + } + + /** + * Check whether file is opened + * + * @throws Mage_Exception + */ + protected function _checkFileOpened() + { + if (!$this->_fileHandler) { + throw new Mage_Exception('File not opened'); + } + } +} diff --git a/lib/Mage/Archive/Helper/File/Bz.php b/lib/Mage/Archive/Helper/File/Bz.php new file mode 100644 index 00000000000..3cce1ad126a --- /dev/null +++ b/lib/Mage/Archive/Helper/File/Bz.php @@ -0,0 +1,92 @@ +<?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_Archive + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** +* Helper class that simplifies bz2 files stream reading and writing +* +* @category Mage +* @package Mage_Archive +* @author Magento Core Team <core@magentocommerce.com> +*/ +class Mage_Archive_Helper_File_Bz extends Mage_Archive_Helper_File +{ + /** + * Open bz archive file + * + * @throws Mage_Exception + * @param string $mode + */ + protected function _open($mode) + { + $this->_fileHandler = @bzopen($this->_filePath, $mode); + + if (false === $this->_fileHandler) { + throw new Mage_Exception('Failed to open file ' . $this->_filePath); + } + } + + /** + * Write data to bz archive + * + * @throws Mage_Exception + * @param $data + */ + protected function _write($data) + { + $result = @bzwrite($this->_fileHandler, $data); + + if (false === $result) { + throw new Mage_Exception('Failed to write data to ' . $this->_filePath); + } + } + + /** + * Read data from bz archive + * + * @throws Mage_Exception + * @param int $length + * @return string + */ + protected function _read($length) + { + $data = bzread($this->_fileHandler, $length); + + if (false === $data) { + throw new Mage_Exception('Failed to read data from ' . $this->_filePath); + } + + return $data; + } + + /** + * Close bz archive + */ + protected function _close() + { + bzclose($this->_fileHandler); + } +} + diff --git a/lib/Mage/Archive/Helper/File/Gz.php b/lib/Mage/Archive/Helper/File/Gz.php new file mode 100644 index 00000000000..9bf01228510 --- /dev/null +++ b/lib/Mage/Archive/Helper/File/Gz.php @@ -0,0 +1,83 @@ +<?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_Archive + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** +* Helper class that simplifies gz files stream reading and writing +* +* @category Mage +* @package Mage_Archive +* @author Magento Core Team <core@magentocommerce.com> +*/ +class Mage_Archive_Helper_File_Gz extends Mage_Archive_Helper_File +{ + /** + * @see Mage_Archive_Helper_File::_open() + */ + protected function _open($mode) + { + $this->_fileHandler = @gzopen($this->_filePath, $mode); + + if (false === $this->_fileHandler) { + throw new Mage_Exception('Failed to open file ' . $this->_filePath); + } + } + + /** + * @see Mage_Archive_Helper_File::_write() + */ + protected function _write($data) + { + $result = @gzwrite($this->_fileHandler, $data); + + if (empty($result) && !empty($data)) { + throw new Mage_Exception('Failed to write data to ' . $this->_filePath); + } + } + + /** + * @see Mage_Archive_Helper_File::_read() + */ + protected function _read($length) + { + return gzread($this->_fileHandler, $length); + } + + /** + * @see Mage_Archive_Helper_File::_eof() + */ + protected function _eof() + { + return gzeof($this->_fileHandler); + } + + /** + * @see Mage_Archive_Helper_File::_close() + */ + protected function _close() + { + gzclose($this->_fileHandler); + } +} diff --git a/lib/Mage/Archive/Interface.php b/lib/Mage/Archive/Interface.php index 8badba4f49a..9122b2f5c7c 100644 --- a/lib/Mage/Archive/Interface.php +++ b/lib/Mage/Archive/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Archive/Tar.php b/lib/Mage/Archive/Tar.php index dca45fcd3cb..e36fec58ea5 100644 --- a/lib/Mage/Archive/Tar.php +++ b/lib/Mage/Archive/Tar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,11 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Interface { /** - * Constant is used for parse tar's header. + * Tar block size + * + * @const int */ - const FORMAT_PARSE_HEADER = 'a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor/a155prefix/a12closer'; + const TAR_BLOCK_SIZE = 512; /** * Keep file or directory for packing. @@ -60,6 +62,122 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ protected $_skipRoot; + /** + * Tarball data writer + * + * @var Mage_Archive_Helper_File + */ + protected $_writer; + + /** + * Tarball data reader + * + * @var Mage_Archive_Helper_File + */ + protected $_reader; + + /** + * Path to file where tarball should be placed + * + * @var string + */ + protected $_destinationFilePath; + + /** + * Initialize tarball writer + * + * @return Mage_Archive_Tar + */ + protected function _initWriter() + { + $this->_writer = new Mage_Archive_Helper_File($this->_destinationFilePath); + $this->_writer->open('w'); + + return $this; + } + + /** + * Returns string that is used for tar's header parsing + * + * @return string + */ + protected static final function _getFormatParseHeader() + { + return 'a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2version/' + . 'a32uname/a32gname/a8devmajor/a8devminor/a155prefix/a12closer'; + } + + /** + * Destroy tarball writer + * + * @return Mage_Archive_Tar + */ + protected function _destroyWriter() + { + if ($this->_writer instanceof Mage_Archive_Helper_File) { + $this->_writer->close(); + $this->_writer = null; + } + + return $this; + } + + /** + * Get tarball writer + * + * @return Mage_Archive_Helper_File + */ + protected function _getWriter() + { + if (!$this->_writer) { + $this->_initWriter(); + } + + return $this->_writer; + } + + /** + * Initialize tarball reader + * + * @return Mage_Archive_Tar + */ + protected function _initReader() + { + $this->_reader = new Mage_Archive_Helper_File($this->_getCurrentFile()); + $this->_reader->open('r'); + + return $this; + } + + /** + * Destroy tarball reader + * + * @return Mage_Archive_Tar + */ + protected function _destroyReader() + { + if ($this->_reader instanceof Mage_Archive_Helper_File) { + $this->_reader->close(); + $this->_reader = null; + } + + return $this; + } + + /** + * Get tarball reader + * + * @return Mage_Archive_Helper_File + */ + protected function _getReader() + { + if (!$this->_reader) { + $this->_initReader(); + } + + return $this->_reader; + } + /** * Set option that define ability skip first catalog level. * @@ -80,7 +198,19 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ protected function _setCurrentFile($file) { - $this->_currentFile = $file .((is_dir($file) && substr($file, -1)!=DS)?DS:''); + $this->_currentFile = $file .((!is_link($file) && is_dir($file) && substr($file, -1) != DS) ? DS : ''); + return $this; + } + + /** + * Set path to file where tarball should be placed + * + * @param string $destinationFilePath + * @return Mage_Archive_Tar + */ + protected function _setDestinationFilePath($destinationFilePath) + { + $this->_destinationFilePath = $destinationFilePath; return $this; } @@ -124,6 +254,7 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int * Walk through directory and add to tar file or directory. * Result is packed string on TAR format. * + * @deprecated after 1.7.0.0 * @param boolean $skipRoot * @return string */ @@ -154,10 +285,74 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int return $tarData; } + /** + * Recursively walk through file tree and create tarball + * + * @param boolean $skipRoot + * @param boolean $finalize + * @throws Mage_Exception + */ + protected function _createTar($skipRoot = false, $finalize = false) + { + if (!$skipRoot) { + $this->_packAndWriteCurrentFile(); + } + + $file = $this->_getCurrentFile(); + + if (is_dir($file)) { + $dirFiles = scandir($file); + + if (false === $dirFiles) { + throw new Mage_Exception('Can\'t scan dir: ' . $file); + } + + array_shift($dirFiles); /* remove './'*/ + array_shift($dirFiles); /* remove '../'*/ + + foreach ($dirFiles as $item) { + $this->_setCurrentFile($file . $item)->_createTar(); + } + } + + if ($finalize) { + $this->_getWriter()->write(str_repeat("\0", self::TAR_BLOCK_SIZE * 12)); + } + } + + /** + * Write current file to tarball + */ + protected function _packAndWriteCurrentFile() + { + $archiveWriter = $this->_getWriter(); + $archiveWriter->write($this->_composeHeader()); + + $currentFile = $this->_getCurrentFile(); + + $fileSize = 0; + + if (is_file($currentFile) && !is_link($currentFile)) { + $fileReader = new Mage_Archive_Helper_File($currentFile); + $fileReader->open('r'); + + while (!$fileReader->eof()) { + $archiveWriter->write($fileReader->read()); + } + + $fileReader->close(); + + $fileSize = filesize($currentFile); + } + + $appendZerosCount = (self::TAR_BLOCK_SIZE - $fileSize % self::TAR_BLOCK_SIZE) % self::TAR_BLOCK_SIZE; + $archiveWriter->write(str_repeat("\0", $appendZerosCount)); + } + /** * Compose header for current file in TAR format. * If length of file's name greater 100 characters, - * method breaks header to two pieces. First conatins + * method breaks header into two pieces. First contains * header and data with long name. Second contain only header. * * @param boolean $long @@ -178,14 +373,16 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int } $header = array(); $header['100-name'] = $long?'././@LongLink':substr($nameFile, 0, 100); - $header['8-mode'] = $long?' ':str_pad(substr(sprintf("%07o", $infoFile['mode']),-4), 6, '0', STR_PAD_LEFT); + $header['8-mode'] = $long ? ' ' + : str_pad(substr(sprintf("%07o", $infoFile['mode']),-4), 6, '0', STR_PAD_LEFT); $header['8-uid'] = $long || $infoFile['uid']==0?"\0\0\0\0\0\0\0":sprintf("%07o", $infoFile['uid']); $header['8-gid'] = $long || $infoFile['gid']==0?"\0\0\0\0\0\0\0":sprintf("%07o", $infoFile['gid']); - $header['12-size'] = $long?sprintf("%011o", strlen($nameFile)):sprintf("%011o", is_dir($file) ? 0 : filesize($file)); + $header['12-size'] = $long ? sprintf("%011o", strlen($nameFile)) : sprintf("%011o", is_dir($file) + ? 0 : filesize($file)); $header['12-mtime'] = $long?'00000000000':sprintf("%011o", $infoFile['mtime']); $header['8-check'] = sprintf('% 8s', ''); - $header['1-type'] = $long?'L':(is_link($file) ? 2 : is_dir ($file) ? 5 : 0); - $header['100-symlink'] = is_link($file) == 2 ? readlink($item) : ''; + $header['1-type'] = $long ? 'L' : (is_link($file) ? 2 : (is_dir($file) ? 5 : 0)); + $header['100-symlink'] = is_link($file) ? readlink($file) : ''; $header['6-magic'] = 'ustar '; $header['2-version'] = ' '; $a=function_exists('posix_getpwuid')?posix_getpwuid (fileowner($file)):array('name'=>''); @@ -219,38 +416,63 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int * * @param string $destination path to file is unpacked * @return array list of files + * @throws Mage_Exception */ protected function _unpackCurrentTar($destination) { - $file = $this->_getCurrentFile(); - $pointer = fopen($file, 'r'); - if (empty($pointer)) { - throw new Mage_Exception('Can\'t open file: ' . $file); - } + $archiveReader = $this->_getReader(); $list = array(); - while (!feof($pointer)) { - $header = $this->_parseHeader($pointer); - if ($header) { - $currentFile = $destination . $header['name']; - if ($header['type']=='5' && @mkdir($currentFile, 0777, true)) { - $list[] = $currentFile . DS; - } elseif (in_array($header['type'], array("0",chr(0), ''))) { - $dirname = dirname($currentFile); - if(!file_exists($dirname)) { - @mkdir($dirname, 0777, true); + + while (!$archiveReader->eof()) { + $header = $this->_extractFileHeader(); + + if (!$header) { + continue; + } + + $currentFile = $destination . $header['name']; + $dirname = dirname($currentFile); + + if (in_array($header['type'], array("0",chr(0), ''))) { + + if(!file_exists($dirname)) { + $mkdirResult = @mkdir($dirname, 0777, true); + + if (false === $mkdirResult) { + throw new Mage_Exception('Failed to create directory ' . $dirname); } - $this->_writeFile($currentFile, $header['data']); - $list[] = $currentFile; + } + + $this->_extractAndWriteFile($header, $currentFile); + $list[] = $currentFile; + + } elseif ($header['type'] == '5') { + + if(!file_exists($dirname)) { + $mkdirResult = @mkdir($currentFile, $header['mode'], true); + + if (false === $mkdirResult) { + throw new Mage_Exception('Failed to create directory ' . $currentFile); + } + } + $list[] = $currentFile . DS; + } elseif ($header['type'] == '2') { + + $symlinkResult = @symlink($header['symlink'], $currentFile); + + if (false === $symlinkResult) { + throw new Mage_Exception('Failed to create symlink ' . $currentFile . ' to ' . $header['symlink']); } } } - fclose($pointer); + return $list; } /** * Get header from TAR string and unpacked it by format. * + * @deprecated after 1.7.0.0 * @param resource $pointer * @return string */ @@ -262,10 +484,9 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int return false; } - $fmt = self::FORMAT_PARSE_HEADER; + $fmt = self::_getFormatParseHeader(); $header = unpack ($fmt, $firstLine); - $header['mode']=$header['mode']+0; $header['uid']=octdec($header['uid']); $header['gid']=octdec($header['gid']); @@ -284,7 +505,7 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int } $isUstar = 'ustar' == strtolower(substr($header['magic'], 0, 5)); - + $checksumOk = $header['checksum'] == $checksum; if (isset($header['name']) && $checksumOk) { if ($header['name'] == '././@LongLink' && $header['type'] == 'L') { @@ -304,6 +525,90 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int return false; } + /** + * Read and decode file header information from tarball + * + * @return array|boolean + */ + protected function _extractFileHeader() + { + $archiveReader = $this->_getReader(); + + $headerBlock = $archiveReader->read(self::TAR_BLOCK_SIZE); + + if (strlen($headerBlock) < self::TAR_BLOCK_SIZE) { + return false; + } + + $header = unpack(self::_getFormatParseHeader(), $headerBlock); + + $header['mode'] = octdec($header['mode']); + $header['uid'] = octdec($header['uid']); + $header['gid'] = octdec($header['gid']); + $header['size'] = octdec($header['size']); + $header['mtime'] = octdec($header['mtime']); + $header['checksum'] = octdec($header['checksum']); + + if ($header['type'] == "5") { + $header['size'] = 0; + } + + $checksum = 0; + $headerBlock = substr_replace($headerBlock, ' ', 148, 8); + + for ($i = 0; $i < 512; $i++) { + $checksum += ord(substr($headerBlock, $i, 1)); + } + + $isUstar = 'ustar' == strtolower(substr($header['magic'], 0, 5)); + + $checksumOk = $header['checksum'] == $checksum; + if (isset($header['name']) && $checksumOk) { + + if (!($header['name'] == '././@LongLink' && $header['type'] == 'L')) { + return $header; + } + + $realNameBlockSize = floor(($header['size'] + self::TAR_BLOCK_SIZE - 1) / self::TAR_BLOCK_SIZE) + * self::TAR_BLOCK_SIZE; + $realNameBlock = $archiveReader->read($realNameBlockSize); + $realName = substr($realNameBlock, 0, $header['size']); + + $headerMain = $this->_extractFileHeader(); + $headerMain['name'] = $realName; + return $headerMain; + } + + return false; + } + + /** + * Extract next file from tarball by its $header information and save it to $destination + * + * @param array $fileHeader + * @param string $destination + */ + protected function _extractAndWriteFile($fileHeader, $destination) + { + $fileWriter = new Mage_Archive_Helper_File($destination); + $fileWriter->open('w', $fileHeader['mode']); + + $archiveReader = $this->_getReader(); + + $filesize = $fileHeader['size']; + $bytesExtracted = 0; + + while ($filesize > $bytesExtracted && !$archiveReader->eof()) { + $block = $archiveReader->read(self::TAR_BLOCK_SIZE); + $nonExtractedBytesCount = $filesize - $bytesExtracted; + + $data = substr($block, 0, $nonExtractedBytesCount); + $fileWriter->write($data); + + $bytesExtracted += strlen($block); + } + } + /** * Pack file to TAR (Tape Archiver). * @@ -312,14 +617,18 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int * @param boolean $skipRoot * @return string */ - public function pack($source, $destination, $skipRoot=false) + public function pack($source, $destination, $skipRoot = false) { $this->_setSkipRoot($skipRoot); $source = realpath($source); $tarData = $this->_setCurrentPath($source) - ->_setCurrentFile($source) - ->_packToTar($skipRoot); - $this->_writeFile($destination, $tarData); + ->_setDestinationFilePath($destination) + ->_setCurrentFile($source); + + $this->_initWriter(); + $this->_createTar($skipRoot, true); + $this->_destroyWriter(); + return $destination; } @@ -332,13 +641,13 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ public function unpack($source, $destination) { - $tempFile = $destination . DS . '~tmp-'.microtime(true).'.tar'; - $data = $this->_readFile($source); - $this->_writeFile($tempFile, $data); - $this->_setCurrentFile($tempFile) - ->_setCurrentPath($tempFile) - ->_unpackCurrentTar($destination); - unlink($tempFile); + $this->_setCurrentFile($source) + ->_setCurrentPath($source); + + $this->_initReader(); + $this->_unpackCurrentTar($destination); + $this->_destroyReader(); + return $destination; } @@ -352,21 +661,28 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ public function extract($file, $source, $destination) { - $pointer = fopen($source, 'r'); - if (empty($pointer)) { - throw new Mage_Exception('Can\'t open file: '.$source); - } - $list = array(); + $this->_setCurrentFile($source); + $this->_initReader(); + + $archiveReader = $this->_getReader(); $extractedFile = ''; - while (!feof($pointer)) { - $header = $this->_parseHeader($pointer); + + while (!$archiveReader->eof()) { + $header = $this->_extractFileHeader(); if ($header['name'] == $file) { $extractedFile = $destination . basename($header['name']); - $this->_writeFile($extractedFile, $header['data']); + $this->_extractAndWriteFile($header, $extractedFile); break; } + + if ($header['type'] != 5){ + $skipBytes = floor(($header['size'] + self::TAR_BLOCK_SIZE - 1) / self::TAR_BLOCK_SIZE) + * self::TAR_BLOCK_SIZE; + $archiveReader->read($skipBytes); + } } - fclose($pointer); + + $this->_destroyReader(); return $extractedFile; } } diff --git a/lib/Mage/Autoload/Simple.php b/lib/Mage/Autoload/Simple.php index 7a37db8df63..8faadf984a8 100644 --- a/lib/Mage/Autoload/Simple.php +++ b/lib/Mage/Autoload/Simple.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/lib/Mage/Backup.php b/lib/Mage/Backup.php new file mode 100644 index 00000000000..d31d45a86c8 --- /dev/null +++ b/lib/Mage/Backup.php @@ -0,0 +1,59 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright 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 to work with backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup +{ + /** + * List of supported a backup types + * + * @var array + */ + static protected $_allowedBackupTypes = array('db', 'snapshot', 'filesystem', 'media', 'nomedia'); + + /** + * get Backup Instance By File Name + * + * @param string $type + * @return Mage_Backup_Interface + */ + static public function getBackupInstance($type) + { + $class = 'Mage_Backup_' . $type; + + if (!in_array($type, self::$_allowedBackupTypes) || !class_exists($class, true)){ + throw new Mage_Exception('Current implementation not supported this type (' . $type . ') of backup.'); + } + + return new $class(); + } +} diff --git a/lib/Mage/Backup/Abstract.php b/lib/Mage/Backup/Abstract.php new file mode 100644 index 00000000000..864551600e7 --- /dev/null +++ b/lib/Mage/Backup/Abstract.php @@ -0,0 +1,317 @@ +<?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_Backup + * @copyright 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 to work with archives + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Backup_Abstract implements Mage_Backup_Interface +{ + /** + * Backup name + * + * @var string + */ + protected $_name; + + /** + * Backup creation date + * + * @var int + */ + protected $_time; + + /** + * Backup file extension + * + * @var string + */ + protected $_backupExtension; + + /** + * Resource model + * + * @var object + */ + protected $_resourceModel; + + /** + * Magento's root directory + * + * @var string + */ + protected $_rootDir; + + /** + * Path to directory where backups stored + * + * @var string + */ + protected $_backupsDir; + + /** + * Is last operation completed successfully + * + * @var bool + */ + protected $_lastOperationSucceed = false; + + /** + * Last failed operation error message + * + * @var string + */ + protected $_lastErrorMessage; + + + /** + * Set Backup Extension + * + * @param string $backupExtension + * @return Mage_Backup_Interface + */ + public function setBackupExtension($backupExtension) + { + $this->_backupExtension = $backupExtension; + return $this; + } + + /** + * Get Backup Extension + * + * @return string + */ + public function getBackupExtension() + { + return $this->_backupExtension; + } + + /** + * Set Resource Model + * + * @param object $resourceModel + * @return Mage_Backup_Interface + */ + public function setResourceModel($resourceModel) + { + $this->_resourceModel = $resourceModel; + return $this; + } + + /** + * Get Resource Model + * + * @return object + */ + public function getResourceModel() + { + return $this->_resourceModel; + } + + /** + * Set Time + * + * @param int $time + * @return Mage_Backup_Interface + */ + public function setTime($time) + { + $this->_time = $time; + return $this; + } + + /** + * Get Time + * + * @return int + */ + public function getTime() + { + return $this->_time; + } + + /** + * Set root directory of Magento installation + * + * @param string $rootDir + * @throws Mage_Exception + * @return Mage_Backup_Interface + */ + public function setRootDir($rootDir) + { + if (!is_dir($rootDir)) { + throw new Mage_Exception('Bad root directory'); + } + + $this->_rootDir = $rootDir; + return $this; + } + + /** + * Get Magento's root directory + * @return string + */ + public function getRootDir() + { + return $this->_rootDir; + } + + /** + * Set path to directory where backups stored + * + * @param string $backupsDir + * @return Mage_Backup_Interface + */ + public function setBackupsDir($backupsDir) + { + $this->_backupsDir = $backupsDir; + return $this; + } + + /** + * Get path to directory where backups stored + * + * @return string + */ + public function getBackupsDir() + { + return $this->_backupsDir; + } + + /** + * Get path to backup + * + * @return string + */ + public function getBackupPath() + { + return $this->getBackupsDir() . DS . $this->getBackupFilename(); + } + + /** + * Get backup file name + * + * @return string + */ + public function getBackupFilename() + { + $filename = $this->getTime() . '_' . $this->getType(); + + $name = $this->getName(); + + if (!empty($name)) { + $filename .= '_' . $name; + } + + $filename .= '.' . $this->getBackupExtension(); + + return $filename; + } + + /** + * Check whether last operation completed successfully + * + * @return bool + */ + public function getIsSuccess() + { + return $this->_lastOperationSucceed; + } + + /** + * Get last error message + * + * @return string + */ + public function getErrorMessage() + { + return $this->_lastErrorMessage; + } + + /** + * Set error message + * + * @param string $errorMessage + * @return string + */ + public function setErrorMessage($errorMessage) + { + $this->_lastErrorMessage = $errorMessage; + } + + /** + * Set backup name + * + * @param string $name + * @param bool $applyFilter + * @return Mage_Backup_Interface + */ + public function setName($name, $applyFilter = true) + { + if ($applyFilter) { + $name = $this->_filterName($name); + } + $this->_name = $name; + return $this; + } + + /** + * Get backup name + * + * @return string + */ + public function getName() + { + return $this->_name; + } + + /** + * Get backup display name + * + * @return string + */ + public function getDisplayName() + { + return str_replace('_', ' ', $this->_name); + } + + /** + * Removes disallowed characters and replaces spaces with underscores + * + * @param string $name + * @return string + */ + protected function _filterName($name) + { + $name = trim(preg_replace('/[^\da-zA-Z ]/', '', $name)); + $name = preg_replace('/\s{2,}/', ' ', $name); + $name = str_replace(' ', '_', $name); + + return $name; + } +} diff --git a/lib/Mage/Backup/Archive/Tar.php b/lib/Mage/Backup/Archive/Tar.php new file mode 100644 index 00000000000..c2e3a39d22a --- /dev/null +++ b/lib/Mage/Backup/Archive/Tar.php @@ -0,0 +1,82 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Extended version of Mage_Archive_Tar that supports filtering + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Archive_Tar extends Mage_Archive_Tar +{ + /** + * Filenames or filename parts that are used for filtering files + * + * @var array() + */ + protected $_skipFiles = array(); + + /** + * Overridden Mage_Archive_Tar::_createTar method that does the same actions as it's parent but filters + * files using Mage_Backup_Filesystem_Iterator_Filter + * + * @see Mage_Archive_Tar::_createTar() + * @param bool $skipRoot + * @param bool $finalize + */ + protected function _createTar($skipRoot = false, $finalize = false) + { + $path = $this->_getCurrentFile(); + + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $this->_skipFiles); + + foreach ($iterator as $item) { + $this->_setCurrentFile($item->getPathname()); + $this->_packAndWriteCurrentFile(); + } + + if ($finalize) { + $this->_getWriter()->write(str_repeat("\0", self::TAR_BLOCK_SIZE * 12)); + } + } + + /** + * Set files that shouldn't be added to tarball + * + * @param array $skipFiles + * @return Mage_Backup_Archive_Tar + */ + public function setSkipFiles(array $skipFiles) + { + $this->_skipFiles = $skipFiles; + return $this; + } +} diff --git a/lib/Mage/Backup/Db.php b/lib/Mage/Backup/Db.php new file mode 100644 index 00000000000..17912345396 --- /dev/null +++ b/lib/Mage/Backup/Db.php @@ -0,0 +1,129 @@ +<?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_Backup + * @copyright 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 to work with database backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Db extends Mage_Backup_Abstract +{ + /** + * Implementation Rollback functionality for Db + * + * @return bool + */ + public function rollback() + { + set_time_limit(0); + ignore_user_abort(true); + + $this->_lastOperationSucceed = false; + + $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 = ''; + } + } + fclose($file); + $this->getResourceModel()->commitTransaction(); + @unlink($source); + + $this->_lastOperationSucceed = true; + + return true; + } + + /** + * Check is line a last in sql command + * + * @param $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; + } + + /** + * Implementation Create Backup functionality for Db + * + * @return boolean + */ + public function create() + { + set_time_limit(0); + ignore_user_abort(true); + + $this->_lastOperationSucceed = false; + + $backup = Mage::getModel('Mage_Backup_Model_Backup') + ->setTime($this->getTime()) + ->setType($this->getType()) + ->setPath($this->getBackupsDir()) + ->setName($this->getName()); + + $backupDb = Mage::getModel('Mage_Backup_Model_Db'); + $backupDb->createBackup($backup); + + $this->_lastOperationSucceed = true; + + return true; + } + + /** + * Get Backup Type + * + * @return string + */ + public function getType() + { + return "db"; + } +} diff --git a/lib/Mage/Backup/Exception.php b/lib/Mage/Backup/Exception.php new file mode 100644 index 00000000000..220ba4d94c0 --- /dev/null +++ b/lib/Mage/Backup/Exception.php @@ -0,0 +1,36 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception extends Mage_Exception +{ +} diff --git a/lib/Mage/Backup/Exception/CantLoadSnapshot.php b/lib/Mage/Backup/Exception/CantLoadSnapshot.php new file mode 100644 index 00000000000..681c7f40ed4 --- /dev/null +++ b/lib/Mage/Backup/Exception/CantLoadSnapshot.php @@ -0,0 +1,36 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_CantLoadSnapshot extends Mage_Backup_Exception +{ +} diff --git a/lib/Mage/Backup/Exception/FtpConnectionFailed.php b/lib/Mage/Backup/Exception/FtpConnectionFailed.php new file mode 100644 index 00000000000..7ff689827df --- /dev/null +++ b/lib/Mage/Backup/Exception/FtpConnectionFailed.php @@ -0,0 +1,36 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_FtpConnectionFailed extends Mage_Backup_Exception +{ +} diff --git a/lib/Mage/Backup/Exception/FtpValidationFailed.php b/lib/Mage/Backup/Exception/FtpValidationFailed.php new file mode 100644 index 00000000000..1e3b80e96c3 --- /dev/null +++ b/lib/Mage/Backup/Exception/FtpValidationFailed.php @@ -0,0 +1,36 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_FtpValidationFailed extends Mage_Backup_Exception +{ +} diff --git a/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php b/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php new file mode 100644 index 00000000000..dff2b06ebd0 --- /dev/null +++ b/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php @@ -0,0 +1,36 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_NotEnoughFreeSpace extends Mage_Backup_Exception +{ +} diff --git a/lib/Mage/Backup/Exception/NotEnoughPermissions.php b/lib/Mage/Backup/Exception/NotEnoughPermissions.php new file mode 100644 index 00000000000..88d6fe9f3fd --- /dev/null +++ b/lib/Mage/Backup/Exception/NotEnoughPermissions.php @@ -0,0 +1,36 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_NotEnoughPermissions extends Mage_Backup_Exception +{ +} diff --git a/lib/Mage/Backup/Filesystem.php b/lib/Mage/Backup/Filesystem.php new file mode 100644 index 00000000000..6c20dd906a1 --- /dev/null +++ b/lib/Mage/Backup/Filesystem.php @@ -0,0 +1,284 @@ +<?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_Backup + * @copyright 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 to work with filesystem backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem extends Mage_Backup_Abstract +{ + /** + * Paths that ignored when creating or rolling back snapshot + * + * @var array + */ + protected $_ignorePaths = array(); + + /** + * Whether use ftp account for rollback procedure + * + * @var bool + */ + protected $_useFtp = false; + + /** + * Ftp host + * + * @var string + */ + protected $_ftpHost; + + /** + * Ftp username + * + * @var string + */ + protected $_ftpUser; + + /** + * Password to ftp account + * + * @var string + */ + protected $_ftpPass; + + /** + * Ftp path to Magento installation + * + * @var string + */ + protected $_ftpPath; + + /** + * Implementation Rollback functionality for Filesystem + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $this->_lastOperationSucceed = false; + + set_time_limit(0); + ignore_user_abort(true); + + $rollbackWorker = $this->_useFtp ? new Mage_Backup_Filesystem_Rollback_Ftp($this) + : new Mage_Backup_Filesystem_Rollback_Fs($this); + $rollbackWorker->run(); + + $this->_lastOperationSucceed = true; + } + + /** + * Implementation Create Backup functionality for Filesystem + * + * @throws Mage_Exception + * @return boolean + */ + public function create() + { + set_time_limit(0); + ignore_user_abort(true); + + $this->_lastOperationSucceed = false; + + $this->_checkBackupsDir(); + + $fsHelper = new Mage_Backup_Filesystem_Helper(); + + $filesInfo = $fsHelper->getInfo( + $this->getRootDir(), + Mage_Backup_Filesystem_Helper::INFO_READABLE | Mage_Backup_Filesystem_Helper::INFO_SIZE, + $this->getIgnorePaths() + ); + + if (!$filesInfo['readable']) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Not enough permissions to read files for backup'); + } + + $freeSpace = disk_free_space($this->getBackupsDir()); + + if (2 * $filesInfo['size'] > $freeSpace) { + throw new Mage_Backup_Exception_NotEnoughFreeSpace('Not enough free space to create backup'); + } + + $tarTmpPath = $this->_getTarTmpPath(); + + $tarPacker = new Mage_Backup_Archive_Tar(); + $tarPacker->setSkipFiles($this->getIgnorePaths()) + ->pack($this->getRootDir(), $tarTmpPath, true); + + if (!is_file($tarTmpPath) || filesize($tarTmpPath) == 0) { + throw new Mage_Exception('Failed to create backup'); + } + + $backupPath = $this->getBackupPath(); + + $gzPacker = new Mage_Archive_Gz(); + $gzPacker->pack($tarTmpPath, $backupPath); + + if (!is_file($backupPath) || filesize($backupPath) == 0) { + throw new Mage_Exception('Failed to create backup'); + } + + @unlink($tarTmpPath); + + $this->_lastOperationSucceed = true; + } + + /** + * Force class to use ftp for rollback procedure + * + * @param string $host + * @param string $username + * @param string $password + * @param string $path + * @return Mage_Backup_Filesystem + */ + public function setUseFtp($host, $username, $password, $path) + { + $this->_useFtp = true; + $this->_ftpHost = $host; + $this->_ftpUser = $username; + $this->_ftpPass = $password; + $this->_ftpPath = $path; + return $this; + } + + /** + * Get backup type + * + * @see Mage_Backup_Interface::getType() + * @return string + */ + public function getType() + { + return 'filesystem'; + } + + /** + * Add path that should be ignoring when creating or rolling back backup + * + * @param string|array $paths + * @return Mage_Backup_Filesystem + */ + public function addIgnorePaths($paths) + { + if (is_string($paths)) { + if (!in_array($paths, $this->_ignorePaths)) { + $this->_ignorePaths[] = $paths; + } + } + else if (is_array($paths)) { + foreach ($paths as $path) { + $this->addIgnorePaths($path); + } + } + + return $this; + } + + /** + * Get paths that should be ignored while creating or rolling back backup procedure + * + * @return array + */ + public function getIgnorePaths() + { + return $this->_ignorePaths; + } + + /** + * Set directory where backups saved and add it to ignore paths + * + * @see Mage_Backup_Abstract::setBackupsDir() + * @param string $backupsDir + * @return Mage_Backup_Filesystem + */ + public function setBackupsDir($backupsDir) + { + parent::setBackupsDir($backupsDir); + $this->addIgnorePaths($backupsDir); + return $this; + } + + /** + * getter for $_ftpPath variable + * + * @return string + */ + public function getFtpPath() + { + return $this->_ftpPath; + } + + /** + * Get ftp connection string + * + * @return string + */ + public function getFtpConnectString() + { + return 'ftp://' . $this->_ftpUser . ':' . $this->_ftpPass . '@' . $this->_ftpHost . $this->_ftpPath; + } + + /** + * Check backups directory existance and whether it's writeable + * + * @throws Mage_Exception + */ + protected function _checkBackupsDir() + { + $backupsDir = $this->getBackupsDir(); + + if (!is_dir($backupsDir)) { + $backupsDirParentDirectory = basename($backupsDir); + + if (!is_writeable($backupsDirParentDirectory)) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Cant create backups directory'); + } + + mkdir($backupsDir); + chmod($backupsDir, 0777); + } + + if (!is_writable($backupsDir)) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Backups directory is not writeable'); + } + } + + /** + * Generate tmp name for tarball + */ + protected function _getTarTmpPath() + { + $tmpName = '~tmp-'. microtime(true) . '.tar'; + return $this->getBackupsDir() . DS . $tmpName; + } +} diff --git a/lib/Mage/Backup/Filesystem/Helper.php b/lib/Mage/Backup/Filesystem/Helper.php new file mode 100644 index 00000000000..5868045448c --- /dev/null +++ b/lib/Mage/Backup/Filesystem/Helper.php @@ -0,0 +1,137 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Filesystem helper for Mage_Backup library + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Helper +{ + /** + * Constant can be used in getInfo() function as second parameter. + * Check whether directory and all files/sub directories are writable + * + * @const int + */ + const INFO_WRITABLE = 1; + + /** + * Constant can be used in getInfo() function as second parameter. + * Check whether directory and all files/sub directories are readable + * + * @const int + */ + const INFO_READABLE = 2; + + /** + * Constant can be used in getInfo() function as second parameter. + * Get directory size + * + * @const int + */ + const INFO_SIZE = 4; + + /** + * Constant can be used in getInfo() function as second parameter. + * Combination of INFO_WRITABLE, INFO_READABLE, INFO_SIZE + * + * @const int + */ + const INFO_ALL = 7; + + /** + * Recursively delete $path + * + * @param string $path + * @param array $skipPaths + * @param bool $removeRoot + * @throws Mage_Exception + */ + public function rm($path, $skipPaths = array(), $removeRoot = false) + { + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::CHILD_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $skipPaths); + + foreach ($iterator as $item) { + $item->isDir() ? @rmdir($item->__toString()) : @unlink($item->__toString()); + } + + if ($removeRoot && is_dir($path)) { + @rmdir($path); + } + } + + /** + * Get information (readable, writable, size) about $path + * + * @param string $path + * @param int $infoOptions + * @param array $skipFiles + */ + public function getInfo($path, $infoOptions = self::INFO_ALL, $skipFiles = array()) + { + $info = array(); + if ($infoOptions & self::INFO_READABLE) { + $info['readable'] = true; + } + + if ($infoOptions & self::INFO_WRITABLE) { + $info['writable'] = true; + } + + if ($infoOptions & self::INFO_SIZE) { + $info['size'] = 0; + } + + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::CHILD_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $skipFiles); + + foreach ($iterator as $item) { + if (($infoOptions & self::INFO_WRITABLE) && !$item->isWritable()) { + $info['writable'] = false; + } + + if (($infoOptions & self::INFO_READABLE) && !$item->isReadable()) { + $info['readable'] = false; + } + + if ($infoOptions & self::INFO_SIZE && !$item->isDir()) { + $info['size'] += $item->getSize(); + } + } + + return $info; + } +} diff --git a/lib/Mage/Backup/Filesystem/Iterator/Filter.php b/lib/Mage/Backup/Filesystem/Iterator/Filter.php new file mode 100644 index 00000000000..070e335af90 --- /dev/null +++ b/lib/Mage/Backup/Filesystem/Iterator/Filter.php @@ -0,0 +1,77 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Filter Iterator + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Iterator_Filter extends FilterIterator +{ + /** + * Array that is used for filtering + * + * @var array + */ + protected $_filters; + + /** + * Constructor + * + * @param Iterator $iterator + * @param array $skipFiles + */ + public function __construct(Iterator $iterator, array $filters) + { + parent::__construct($iterator); + $this->_filters = $filters; + } + + /** + * Check whether the current element of the iterator is acceptable + * + * @return bool + */ + public function accept() + { + $current = $this->current()->__toString(); + $currentFilename = $this->current()->getFilename(); + + if ($currentFilename == '.' || $currentFilename == '..') { + return false; + } + + foreach ($this->_filters as $filter) { + if (false !== strpos($current, $filter)) { + return false; + } + } + + return true; + } +} diff --git a/lib/Mage/Backup/Filesystem/Rollback/Abstract.php b/lib/Mage/Backup/Filesystem/Rollback/Abstract.php new file mode 100644 index 00000000000..b1923fcdf98 --- /dev/null +++ b/lib/Mage/Backup/Filesystem/Rollback/Abstract.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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Filesystem rollback workers abstract class + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Backup_Filesystem_Rollback_Abstract +{ + /** + * Snapshot object + * + * @var Mage_Backup_Filesystem + */ + protected $_snapshot; + + /** + * Default worker constructor + * + * @param Mage_Backup_Filesystem $snapshotObject + */ + public function __construct(Mage_Backup_Filesystem $snapshotObject) + { + $this->_snapshot = $snapshotObject; + } + + /** + * Main worker's function that makes files rollback + */ + abstract public function run(); +} diff --git a/lib/Mage/Backup/Filesystem/Rollback/Fs.php b/lib/Mage/Backup/Filesystem/Rollback/Fs.php new file mode 100644 index 00000000000..2089fe857de --- /dev/null +++ b/lib/Mage/Backup/Filesystem/Rollback/Fs.php @@ -0,0 +1,78 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Rollback worker for rolling back via local filesystem + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Rollback_Fs extends Mage_Backup_Filesystem_Rollback_Abstract +{ + /** + * Files rollback implementation via local filesystem + * + * @see Mage_Backup_Filesystem_Rollback_Abstract::run() + * @throws Mage_Exception + */ + public function run() + { + $snapshotPath = $this->_snapshot->getBackupPath(); + + if (!is_file($snapshotPath) || !is_readable($snapshotPath)) { + throw new Mage_Backup_Exception_CantLoadSnapshot('Cant load snapshot archive'); + } + + $fsHelper = new Mage_Backup_Filesystem_Helper(); + + $filesInfo = $fsHelper->getInfo( + $this->_snapshot->getRootDir(), + Mage_Backup_Filesystem_Helper::INFO_WRITABLE, + $this->_snapshot->getIgnorePaths() + ); + + if (!$filesInfo['writable']) { + throw new Mage_Backup_Exception_NotEnoughPermissions( + 'Unable to make rollback because not all files are writable' + ); + } + + $archiver = new Mage_Archive(); + + /** + * we need these fake initializations because all magento's files in filesystem will be deleted and autoloader + * wont be able to load classes that we need for unpacking + */ + new Mage_Archive_Tar(); + new Mage_Archive_Gz(); + new Mage_Archive_Helper_File(''); + new Mage_Archive_Helper_File_Gz(''); + + $fsHelper->rm($this->_snapshot->getRootDir(), $this->_snapshot->getIgnorePaths()); + $archiver->unpack($snapshotPath, $this->_snapshot->getRootDir()); + } +} diff --git a/lib/Mage/Backup/Filesystem/Rollback/Ftp.php b/lib/Mage/Backup/Filesystem/Rollback/Ftp.php new file mode 100644 index 00000000000..f5293402415 --- /dev/null +++ b/lib/Mage/Backup/Filesystem/Rollback/Ftp.php @@ -0,0 +1,198 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Rollback worker for rolling back via ftp + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Rollback_Ftp extends Mage_Backup_Filesystem_Rollback_Abstract +{ + /** + * Ftp client + * + * @var Mage_System_Ftp + */ + protected $_ftpClient; + + /** + * Files rollback implementation via ftp + * + * @see Mage_Backup_Filesystem_Rollback_Abstract::run() + * @throws Mage_Exception + */ + public function run() + { + $snapshotPath = $this->_snapshot->getBackupPath(); + + if (!is_file($snapshotPath) || !is_readable($snapshotPath)) { + throw new Mage_Backup_Exception_CantLoadSnapshot('Cant load snapshot archive'); + } + + $this->_initFtpClient(); + $this->_validateFtp(); + + $tmpDir = $this->_createTmpDir(); + $this->_unpackSnapshot($tmpDir); + + $fsHelper = new Mage_Backup_Filesystem_Helper(); + + $this->_cleanupFtp(); + $this->_uploadBackupToFtp($tmpDir); + + $fsHelper->rm($tmpDir, array(), true); + } + + /** + * Initialize ftp client and connect to ftp + * + * @throws Mage_Backup_Exception_FtpConnectionFailed + */ + protected function _initFtpClient() + { + try { + $this->_ftpClient = new Mage_System_Ftp(); + $this->_ftpClient->connect($this->_snapshot->getFtpConnectString()); + } catch (Exception $e) { + throw new Mage_Backup_Exception_FtpConnectionFailed($e->getMessage()); + } + } + + /** + * Perform ftp validation. Check whether ftp account provided points to current magento installation + * + * @throws Mage_Exception + */ + protected function _validateFtp() + { + $validationFilename = '~validation-' . microtime(true) . '.tmp'; + $validationFilePath = $this->_snapshot->getBackupsDir() . DS . $validationFilename; + + $fh = @fopen($validationFilePath, 'w'); + @fclose($fh); + + if (!is_file($validationFilePath)) { + throw new Mage_Exception('Unable to validate ftp account'); + } + + $rootDir = $this->_snapshot->getRootDir(); + $ftpPath = $this->_snapshot->getFtpPath() . DS . str_replace($rootDir, '', $validationFilePath); + + $fileExistsOnFtp = $this->_ftpClient->fileExists($ftpPath); + @unlink($validationFilePath); + + if (!$fileExistsOnFtp) { + throw new Mage_Backup_Exception_FtpValidationFailed('Failed to validate ftp account'); + } + } + + /** + * Unpack snapshot + * + * @param string $tmpDir + */ + protected function _unpackSnapshot($tmpDir) + { + $snapshotPath = $this->_snapshot->getBackupPath(); + + $archiver = new Mage_Archive(); + $archiver->unpack($snapshotPath, $tmpDir); + } + + /** + * @throws Mage_Exception + * @return string + */ + protected function _createTmpDir() + { + $tmpDir = $this->_snapshot->getBackupsDir() . DS . '~tmp-' . microtime(true); + + $result = @mkdir($tmpDir); + + if (false === $result) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Failed to create directory ' . $tmpDir); + } + + return $tmpDir; + } + + /** + * Delete magento and all files from ftp + */ + protected function _cleanupFtp() + { + $rootDir = $this->_snapshot->getRootDir(); + + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($rootDir), RecursiveIteratorIterator::CHILD_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $this->_snapshot->getIgnorePaths()); + + foreach ($iterator as $item) { + $ftpPath = $this->_snapshot->getFtpPath() . DS . str_replace($rootDir, '', $item->__toString()); + $ftpPath = str_replace(DS, '/', $ftpPath); + + $this->_ftpClient->delete($ftpPath); + } + } + + /** + * Perform files rollback + * + * @param string $tmpDir + * @throws Mage_Exception + */ + protected function _uploadBackupToFtp($tmpDir) + { + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($tmpDir), RecursiveIteratorIterator::SELF_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $this->_snapshot->getIgnorePaths()); + + foreach ($filesystemIterator as $item) { + $ftpPath = $this->_snapshot->getFtpPath() . DS . str_replace($tmpDir, '', $item->__toString()); + $ftpPath = str_replace(DS, '/', $ftpPath); + + if ($item->isLink()) { + continue; + } + + if ($item->isDir()) { + $this->_ftpClient->mkdirRecursive($ftpPath); + } else { + $result = $this->_ftpClient->put($ftpPath, $item->__toString()); + if (false === $result) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Failed to upload file ' + . $item->__toString() . ' to ftp'); + } + } + } + } +} diff --git a/lib/Mage/Backup/Interface.php b/lib/Mage/Backup/Interface.php new file mode 100644 index 00000000000..d14a8edce2f --- /dev/null +++ b/lib/Mage/Backup/Interface.php @@ -0,0 +1,88 @@ +<?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_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Interface for work with archives + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +interface Mage_Backup_Interface +{ + /** + * Create Backup + * + * @return boolean + */ + public function create(); + + /** + * Rollback Backup + * + * @return boolean + */ + public function rollback(); + + /** + * Set Backup Extension + * + * @param string $backupExtension + * @return Mage_Backup_Interface + */ + public function setBackupExtension($backupExtension); + + /** + * Set Resource Model + * + * @param object $resourceModel + * @return Mage_Backup_Interface + */ + public function setResourceModel($resourceModel); + + /** + * Set Time + * + * @param int $time + * @return Mage_Backup_Interface + */ + public function setTime($time); + + /** + * Get Backup Type + * + * @return string + */ + public function getType(); + + /** + * Set path to directory where backups stored + * + * @param string $backupsDir + * @return Mage_Backup_Interface + */ + public function setBackupsDir($backupsDir); +} diff --git a/lib/Mage/Backup/Media.php b/lib/Mage/Backup/Media.php new file mode 100644 index 00000000000..2c5fe0be4a0 --- /dev/null +++ b/lib/Mage/Backup/Media.php @@ -0,0 +1,99 @@ +<?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_Backup + * @copyright 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 to work media folder and database backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Media extends Mage_Backup_Snapshot +{ + /** + * Implementation Rollback functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $this->_prepareIgnoreList(); + return parent::rollback(); + } + + /** + * Implementation Create Backup functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function create() + { + $this->_prepareIgnoreList(); + return parent::create(); + } + + /** + * Overlap getType + * + * @return string + * @see Mage_Backup_Interface::getType() + */ + public function getType() + { + return 'media'; + } + + /** + * Add all folders and files except media and db backup to ignore list + * + * @return Mage_Backup_Media + */ + protected function _prepareIgnoreList() + { + $iterator = new DirectoryIterator($this->getRootDir()); + + foreach ($iterator as $item) { + $filename = $item->getFilename(); + if (!in_array($filename, array('media', 'var'))) { + $this->addIgnorePaths($item->getPathname()); + } + } + + $iterator = new DirectoryIterator($this->getRootDir() . DS . 'var'); + $dbBackupFilename = $this->_getDbBackupManager()->getBackupFilename(); + + foreach ($iterator as $item) { + $filename = $item->getFilename(); + if ($filename != $dbBackupFilename) { + $this->addIgnorePaths($item->getPathname()); + } + } + + return $this; + } +} diff --git a/lib/Mage/Backup/Nomedia.php b/lib/Mage/Backup/Nomedia.php new file mode 100644 index 00000000000..81c48565603 --- /dev/null +++ b/lib/Mage/Backup/Nomedia.php @@ -0,0 +1,82 @@ +<?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_Backup + * @copyright 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 to work system backup that excludes media folder + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Nomedia extends Mage_Backup_Snapshot +{ + /** + * Implementation Rollback functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $this->_prepareIgnoreList(); + return parent::rollback(); + } + + /** + * Implementation Create Backup functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function create() + { + $this->_prepareIgnoreList(); + return parent::create(); + } + + /** + * Overlap getType + * + * @return string + * @see Mage_Backup_Interface::getType() + */ + public function getType() + { + return 'nomedia'; + } + + /** + * Add media folder to ignore list + * + * @return Mage_Backup_Media + */ + protected function _prepareIgnoreList() + { + $this->addIgnorePaths($this->getRootDir() . DS . 'media'); + + return $this; + } +} \ No newline at end of file diff --git a/lib/Mage/Backup/Snapshot.php b/lib/Mage/Backup/Snapshot.php new file mode 100644 index 00000000000..8b539b791b8 --- /dev/null +++ b/lib/Mage/Backup/Snapshot.php @@ -0,0 +1,140 @@ +<?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_Backup + * @copyright 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 to work with full filesystem and database backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Snapshot extends Mage_Backup_Filesystem +{ + /** + * Database backup manager + * + * @var Mage_Backup_Db + */ + protected $_dbBackupManager; + + /** + * Implementation Rollback functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $result = parent::rollback(); + + $this->_lastOperationSucceed = false; + + try { + $this->_getDbBackupManager()->rollback(); + } catch (Exception $e) { + $this->_removeDbBackup(); + throw $e; + } + + $this->_removeDbBackup(); + $this->_lastOperationSucceed = true; + + return $result; + } + + /** + * Implementation Create Backup functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function create() + { + $this->_getDbBackupManager()->create(); + + try { + $result = parent::create(); + } catch (Exception $e) { + $this->_removeDbBackup(); + throw $e; + } + + $this->_lastOperationSucceed = false; + $this->_removeDbBackup(); + $this->_lastOperationSucceed = true; + + return $result; + } + + /** + * Overlap getType + * + * @return string + * @see Mage_Backup_Interface::getType() + */ + public function getType() + { + return 'snapshot'; + } + + /** + * Create Db Instance + * + * @return Mage_Backup_Interface + */ + protected function _createDbBackupInstance() + { + return Mage_Backup::getBackupInstance(Mage_Backup_Helper_Data::TYPE_DB) + ->setBackupExtension(Mage::helper('Mage_Backup_Helper_Data')->getExtensionByType(Mage_Backup_Helper_Data::TYPE_DB)) + ->setTime($this->getTime()) + ->setBackupsDir(Mage::getBaseDir("var")) + ->setResourceModel($this->getResourceModel()); + } + + /** + * Get database backup manager + * + * @return Mage_Backup_Db + */ + protected function _getDbBackupManager() + { + if (is_null($this->_dbBackupManager)) { + $this->_dbBackupManager = $this->_createDbBackupInstance(); + } + + return $this->_dbBackupManager; + } + + /** + * Remove Db backup after added it to the snapshot + * + * @return Mage_Backup_Snapshot + */ + protected function _removeDbBackup(){ + @unlink($this->_getDbBackupManager()->getBackupPath()); + return $this; + } +} diff --git a/lib/Mage/Connect/Channel/Generator.php b/lib/Mage/Connect/Channel/Generator.php index 823873f4915..2ae17b7f836 100644 --- a/lib/Mage/Connect/Channel/Generator.php +++ b/lib/Mage/Connect/Channel/Generator.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/lib/Mage/Connect/Channel/Parser.php b/lib/Mage/Connect/Channel/Parser.php index 53235fc0aa6..ac6342ed24c 100644 --- a/lib/Mage/Connect/Channel/Parser.php +++ b/lib/Mage/Connect/Channel/Parser.php @@ -20,6 +20,6 @@ * * @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) */ \ No newline at end of file diff --git a/lib/Mage/Connect/Channel/VO.php b/lib/Mage/Connect/Channel/VO.php index 8a8138fdaa5..c3f93dceb3d 100644 --- a/lib/Mage/Connect/Channel/VO.php +++ b/lib/Mage/Connect/Channel/VO.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/lib/Mage/Connect/Command.php b/lib/Mage/Connect/Command.php index 7876cab3451..fcc9c07714b 100644 --- a/lib/Mage/Connect/Command.php +++ b/lib/Mage/Connect/Command.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/lib/Mage/Connect/Command/Channels.php b/lib/Mage/Connect/Command/Channels.php index 483a8559925..1ed6edfea9c 100644 --- a/lib/Mage/Connect/Command/Channels.php +++ b/lib/Mage/Connect/Command/Channels.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/lib/Mage/Connect/Command/Channels_Header.php b/lib/Mage/Connect/Command/Channels_Header.php index 011a2512e98..94f7e9bb685 100644 --- a/lib/Mage/Connect/Command/Channels_Header.php +++ b/lib/Mage/Connect/Command/Channels_Header.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/lib/Mage/Connect/Command/Config.php b/lib/Mage/Connect/Command/Config.php index 36dd8fdff19..87f7e12182d 100644 --- a/lib/Mage/Connect/Command/Config.php +++ b/lib/Mage/Connect/Command/Config.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/lib/Mage/Connect/Command/Config_Header.php b/lib/Mage/Connect/Command/Config_Header.php index 383f12bcd15..9208cc71383 100644 --- a/lib/Mage/Connect/Command/Config_Header.php +++ b/lib/Mage/Connect/Command/Config_Header.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/lib/Mage/Connect/Command/Install.php b/lib/Mage/Connect/Command/Install.php index c53e94c4de9..89c4b88a055 100644 --- a/lib/Mage/Connect/Command/Install.php +++ b/lib/Mage/Connect/Command/Install.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/lib/Mage/Connect/Command/Install_Header.php b/lib/Mage/Connect/Command/Install_Header.php index c1f5f1d956a..859278b94fd 100644 --- a/lib/Mage/Connect/Command/Install_Header.php +++ b/lib/Mage/Connect/Command/Install_Header.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/lib/Mage/Connect/Command/Package.php b/lib/Mage/Connect/Command/Package.php index 2973c2ba423..8875dd4c616 100644 --- a/lib/Mage/Connect/Command/Package.php +++ b/lib/Mage/Connect/Command/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/lib/Mage/Connect/Command/Package_Header.php b/lib/Mage/Connect/Command/Package_Header.php index ce3032363d8..2ca696bb5ad 100644 --- a/lib/Mage/Connect/Command/Package_Header.php +++ b/lib/Mage/Connect/Command/Package_Header.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/lib/Mage/Connect/Command/Registry.php b/lib/Mage/Connect/Command/Registry.php index 06c2771b00a..a1fab5ed7da 100644 --- a/lib/Mage/Connect/Command/Registry.php +++ b/lib/Mage/Connect/Command/Registry.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/lib/Mage/Connect/Command/Registry_Header.php b/lib/Mage/Connect/Command/Registry_Header.php index ed7a38a99d5..580d32f4532 100644 --- a/lib/Mage/Connect/Command/Registry_Header.php +++ b/lib/Mage/Connect/Command/Registry_Header.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/lib/Mage/Connect/Command/Remote.php b/lib/Mage/Connect/Command/Remote.php index 030d40b55c7..c9f2b5a18f4 100644 --- a/lib/Mage/Connect/Command/Remote.php +++ b/lib/Mage/Connect/Command/Remote.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/lib/Mage/Connect/Command/Remote_Header.php b/lib/Mage/Connect/Command/Remote_Header.php index 07cf3d92436..53e9b40aeac 100644 --- a/lib/Mage/Connect/Command/Remote_Header.php +++ b/lib/Mage/Connect/Command/Remote_Header.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/lib/Mage/Connect/Config.php b/lib/Mage/Connect/Config.php index 69b2e301f95..8e0aad14eae 100644 --- a/lib/Mage/Connect/Config.php +++ b/lib/Mage/Connect/Config.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/lib/Mage/Connect/Converter.php b/lib/Mage/Connect/Converter.php index a8228bc521c..067e0717338 100644 --- a/lib/Mage/Connect/Converter.php +++ b/lib/Mage/Connect/Converter.php @@ -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/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Frontend.php b/lib/Mage/Connect/Frontend.php index 20f486e2d12..b2e6d72a765 100644 --- a/lib/Mage/Connect/Frontend.php +++ b/lib/Mage/Connect/Frontend.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/lib/Mage/Connect/Frontend/CLI.php b/lib/Mage/Connect/Frontend/CLI.php index 937a28ddbaf..2395dfe8492 100644 --- a/lib/Mage/Connect/Frontend/CLI.php +++ b/lib/Mage/Connect/Frontend/CLI.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/lib/Mage/Connect/Ftp.php b/lib/Mage/Connect/Ftp.php index 8569bcd9254..8432c207a0d 100644 --- a/lib/Mage/Connect/Ftp.php +++ b/lib/Mage/Connect/Ftp.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) */ @@ -31,464 +31,6 @@ * @package Mage_Connect * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Connect_Ftp +class Mage_Connect_Ftp extends Mage_System_Ftp { - - /** - * Connection object - * @var resource - */ - protected $_conn = false; - - public function __construct() - { - - } - - /** - * Check connected, throw exception if not - * @throws Exception - * @return void - */ - protected function checkConnected() - { - if(!$this->_conn) { - throw new Exception(__CLASS__." - no connection established with server"); - } - } - - /** - * ftp_mkdir wrapper - * @param stin$name - * @return unknown_type - */ - public function mdkir($name) - { - $this->checkConnected(); - return @ftp_mkdir($this->_conn, $name); - } - - - - /** - * Make dir recursive - * @param string $path - * @param int $mode - */ - public function mkdirRecursive($path, $mode = 0777) - { - $this->checkConnected(); - $dir = split("/", $path); - $path= ""; - $ret = true; - for ($i=0; $i < count($dir); $i++) { - $path .= "/" .$dir[$i]; - if(!@ftp_chdir($this->_conn, $path)) { - @ftp_chdir($this->_conn,"/"); - if(!@ftp_mkdir($this->_conn,$path)) { - $ret=false; - break; - } else { - @ftp_chmod($this->_conn, $mode, $path); - } - } - } - return $ret; - } - - - /** - * Try to login to server - * @param string $login - * @param string $password - * @throws Exception on invalid login credentials - * @return bool - */ - public function login($login = "anonymous", $password = "test@gmail.com") - { - $this->checkConnected(); - $res = @ftp_login($this->_conn, $login, $password); - if(!$res) { - throw new Exception("Invalid login credentials"); - } - return $res; - } - - /** - * Validate connection string - * @param string $string - * @throws Exception - * @return string - */ - public function validateConnectionString($string) - { - $data = @parse_url($string); - if(false === $data) { - throw new Exception("Connection string invalid: '{$string}'"); - } - if($data['scheme'] != 'ftp') { - throw new Exception("Support for scheme unsupported: '{$data['scheme']}'"); - } - return $data; - } - - /** - * Connect to server using connect string - * Connection string: ftp://user:pass@server:port/path - * user,pass,port,path are optional parts - * @param string $string - * - * @param $timeout - * @return unknown_type - */ - public function connect($string, $timeout = 900) - { - $params = $this->validateConnectionString($string); - $port = isset($params['port']) ? intval($params['port']) : 21; - - $this->_conn = ftp_connect($params['host'], $port, $timeout); - - if(!$this->_conn) { - throw new Exception("Cannot connect to host: {$params['host']}"); - } - if(isset($params['user']) && isset($params['pass'])) { - $this->login($params['user'], $params['pass']); - } else { - $this->login(); - } - if(isset($params['path'])) { - if(!$this->chdir($params['path'])) { - throw new Exception ("Cannot chdir after login to: {$params['path']}"); - } - } - } - - /** - * ftp_fput wrapper - * @param string $remoteFile - * @param resource $handle - * @param int $mode FTP_BINARY | FTP_ASCII - * @param int $startPos - * @return bool - */ - - public function fput($remoteFile, $handle, $mode = FTP_BINARY, $startPos = 0) - { - $this->checkConnected(); - return @ftp_fput($this->_conn, $remoteFile, $handle, $mode, $startPos); - } - - /** - * ftp_put wrapper - * @param string $remoteFile - * @param string $localFile - * @param int $mode FTP_BINARY | FTP_ASCII - * @param int $startPos - * @return bool - */ - public function put($remoteFile, $localFile, $mode = FTP_BINARY, $startPos = 0) - { - $this->checkConnected(); - return ftp_put($this->_conn, $remoteFile, $localFile, $mode, $startPos); - } - - - /** - * Get current working directory - * @return mixed - */ - public function getcwd() - { - $d = $this->raw("pwd"); - $data = explode(" ", $d[0], 3); - if(empty($data[1])) { - return false; - } - if(intval($data[0]) != 257) { - return false; - } - $out = trim($data[1], '"'); - if($out !== "/") { - $out = rtrim($out, "/"); - } - return $out; - } - - /** - * ftp_raw wrapper - * @param string $cmd - * @return mixed - */ - public function raw($cmd) - { - $this->checkConnected(); - return @ftp_raw($this->_conn, $cmd); - } - - - /** - * Upload local file to remote - * - * Can be used for relative and absoulte remote paths - * Relative: use chdir before calling this - * - * @param srting $remote - * @param string $local - * @param int $dirMode - * @param int $ftpMode - * @return unknown_type - */ - public function upload($remote, $local, $dirMode = 0777, $ftpMode = FTP_BINARY) - { - $this->checkConnected(); - - if(!file_exists($local)) { - throw new Exception("Local file doesn't exist: {$localFile}"); - } - if(!is_readable($local)) { - throw new Exception("Local file is not readable: {$localFile}"); - } - if(is_dir($local)) { - throw new Exception("Directory given instead of file: {$localFile}"); - } - - $globalPathMode = substr($remote, 0, 1) == "/"; - $dirname = dirname($remote); - $cwd = $this->getcwd(); - if(false === $cwd) { - throw new Exception("Server returns something awful on PWD command"); - } - - if(!$globalPathMode) { - $dirname = $cwd."/".$dirname; - $remote = $cwd."/".$remote; - } - $res = $this->mkdirRecursive($dirname, $dirMode); - $this->chdir($cwd); - - if(!$res) { - return false; - } - return $this->put($remote, $local, $ftpMode); - } - - /** - * Download remote file to local machine - * @param string $remote - * @param string $local - * @param int $ftpMode FTP_BINARY|FTP_ASCII - * @return bool - */ - public function download($remote, $local, $ftpMode = FTP_BINARY) - { - $this->checkConnected(); - return $this->get($local, $remote, $ftpMode); - } - - - /** - * ftp_pasv wrapper - * @param bool $pasv - * @return bool - */ - public function pasv($pasv) - { - $this->checkConnected(); - return @ftp_pasv($this->_conn, (bool) $pasv); - } - - /** - * Close FTP connection - * @return void - */ - public function close() - { - if($this->_conn) { - @ftp_close($this->_conn); - } - } - - /** - * ftp_chmod wrapper - * @param $mode - * @param $remoteFile - * @return bool - */ - public function chmod($mode, $remoteFile) - { - $this->checkConnected(); - return @ftp_chmod($this->_conn, $mode, $remoteFile); - } - - /** - * ftp_chdir wrapper - * @param string $dir - * @return bool - */ - public function chdir($dir) - { - $this->checkConnected(); - return @ftp_chdir($this->_conn, $dir); - } - - /** - * ftp_cdup wrapper - * @return bool - */ - public function cdup() - { - $this->checkConnected(); - return @ftp_cdup($this->_conn); - } - - /** - * ftp_get wrapper - * @param string $localFile - * @param string $remoteFile - * @param int $fileMode FTP_BINARY | FTP_ASCII - * @param int $resumeOffset - * @return bool - */ - public function get($localFile, $remoteFile, $fileMode = FTP_BINARY, $resumeOffset = 0) - { - $remoteFile = $this->correctFilePath($remoteFile); - $this->checkConnected(); - return @ftp_get($this->_conn, $localFile, $remoteFile, $fileMode, $resumeOffset); - } - - /** - * ftp_nlist wrapper - * @param string $dir - * @return bool - */ - public function nlist($dir = "/") - { - $this->checkConnected(); - $dir = $this->correctFilePath($dir); - return @ftp_nlist($this->_conn, $dir); - } - - /** - * ftp_rawlist wrapper - * @param string $dir - * @param bool $recursive - * @return mixed - */ - public function rawlist( $dir = "/", $recursive = false ) - { - $this->checkConnected(); - $dir = $this->correctFilePath($dir); - return @ftp_rawlist($this->_conn, $dir, $recursive); - } - - - /** - * Convert byte count to float KB/MB format - * @param int $bytes - * @return string - */ - public static function byteconvert($bytes) - { - $symbol = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); - $exp = floor( log($bytes) / log(1024) ); - return sprintf( '%.2f ' . $symbol[ $exp ], ($bytes / pow(1024, floor($exp))) ); - } - - /** - * Chmod string "-rwxrwxrwx" to "777" converter - * @param string $chmod - * @return string - */ - public static function chmodnum($chmod) - { - $trans = array('-' => '0', 'r' => '4', 'w' => '2', 'x' => '1'); - $chmod = substr(strtr($chmod, $trans), 1); - $array = str_split($chmod, 3); - return array_sum(str_split($array[0])) . array_sum(str_split($array[1])) . array_sum(str_split($array[2])); - } - - - public function fileExists($path, $excludeIfIsDir = true) - { - $path = $this->correctFilePath($path); - $globalPathMode = substr($path, 0, 1) == "/"; - - $file = basename($path); - $dir = $globalPathMode ? dirname($path) : $this->getcwd()."/".$path; - $data = $this->ls($dir); - foreach($data as $row) { - if($file == $row['name']) { - if($excludeIfIsDir && $row['dir']) { - continue; - } - return true; - } - } - return false; - } - - - /** - * Get directory contents in PHP array - * @param string $dir - * @param bool $recursive - * @return array - */ - public function ls($dir = "/", $recursive = false) - { - $dir= $this->correctFilePath($dir); - $rawfiles = (array) $this->rawlist($dir, $recursive); - $structure = array(); - $arraypointer = &$structure; - foreach ($rawfiles as $rawfile) { - if ($rawfile[0] == '/') { - $paths = array_slice(explode('/', str_replace(':', '', $rawfile)), 1); - $arraypointer = &$structure; - foreach ($paths as $path) { - foreach ($arraypointer as $i => $file) { - if ($file['name'] == $path) { - $arraypointer = &$arraypointer[ $i ]['children']; - break; - } - } - } - } elseif(!empty($rawfile)) { - $info = preg_split("/[\s]+/", $rawfile, 9); - $arraypointer[] = array( - 'name' => $info[8], - 'dir' => $info[0]{0} == 'd', - 'size' => (int) $info[4], - 'chmod' => self::chmodnum($info[0]), - 'rawdata' => $info, - 'raw' => $rawfile - ); - } - } - return $structure; - } - - - /** - * Correct file path - * @param $str - * @return string - */ - public function correctFilePath($str) - { - $str = str_replace("\\", "/", $str); - $str = preg_replace("/^.\//", "", $str); - return $str; - } - - public function delete($file) - { - $this->checkConnected(); - $file = $this->correctFilePath($file); - return @ftp_delete($this->_conn, $file); - } - - - - - -} \ No newline at end of file +} diff --git a/lib/Mage/Connect/Loader.php b/lib/Mage/Connect/Loader.php index de8001fea7e..aea4bb46508 100644 --- a/lib/Mage/Connect/Loader.php +++ b/lib/Mage/Connect/Loader.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/lib/Mage/Connect/Loader/Ftp.php b/lib/Mage/Connect/Loader/Ftp.php index 88bbfdffa2b..1fb2f51e2a2 100644 --- a/lib/Mage/Connect/Loader/Ftp.php +++ b/lib/Mage/Connect/Loader/Ftp.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/lib/Mage/Connect/Package.php b/lib/Mage/Connect/Package.php index 8915a0baca7..4a3f4fdb948 100644 --- a/lib/Mage/Connect/Package.php +++ b/lib/Mage/Connect/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/lib/Mage/Connect/Package/Hotfix.php b/lib/Mage/Connect/Package/Hotfix.php index bfa385cf1d5..a94ed690b09 100644 --- a/lib/Mage/Connect/Package/Hotfix.php +++ b/lib/Mage/Connect/Package/Hotfix.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/lib/Mage/Connect/Package/Reader.php b/lib/Mage/Connect/Package/Reader.php index 08ebdb8d11a..943b325bfdc 100644 --- a/lib/Mage/Connect/Package/Reader.php +++ b/lib/Mage/Connect/Package/Reader.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/lib/Mage/Connect/Package/Target.php b/lib/Mage/Connect/Package/Target.php index 8deaa45aecc..13f01802a9b 100644 --- a/lib/Mage/Connect/Package/Target.php +++ b/lib/Mage/Connect/Package/Target.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/lib/Mage/Connect/Package/VO.php b/lib/Mage/Connect/Package/VO.php index bd08d02eca2..cb728ace851 100644 --- a/lib/Mage/Connect/Package/VO.php +++ b/lib/Mage/Connect/Package/VO.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/lib/Mage/Connect/Package/Writer.php b/lib/Mage/Connect/Package/Writer.php index ee27e30d6cd..3955cf02644 100644 --- a/lib/Mage/Connect/Package/Writer.php +++ b/lib/Mage/Connect/Package/Writer.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/lib/Mage/Connect/Packager.php b/lib/Mage/Connect/Packager.php index e96a0e55feb..b1aa7639105 100644 --- a/lib/Mage/Connect/Packager.php +++ b/lib/Mage/Connect/Packager.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/lib/Mage/Connect/Rest.php b/lib/Mage/Connect/Rest.php index e5f004522d5..7c772ed5ecf 100644 --- a/lib/Mage/Connect/Rest.php +++ b/lib/Mage/Connect/Rest.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/lib/Mage/Connect/Singleconfig.php b/lib/Mage/Connect/Singleconfig.php index 419e99090e5..5e48db7702c 100644 --- a/lib/Mage/Connect/Singleconfig.php +++ b/lib/Mage/Connect/Singleconfig.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/lib/Mage/Connect/Structures/Graph.php b/lib/Mage/Connect/Structures/Graph.php index 8bcb9d73e89..6e9410cde52 100644 --- a/lib/Mage/Connect/Structures/Graph.php +++ b/lib/Mage/Connect/Structures/Graph.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/lib/Mage/Connect/Structures/Node.php b/lib/Mage/Connect/Structures/Node.php index 4abae479028..10265904d72 100644 --- a/lib/Mage/Connect/Structures/Node.php +++ b/lib/Mage/Connect/Structures/Node.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/lib/Mage/Connect/Validator.php b/lib/Mage/Connect/Validator.php index 022c448c09c..8ef8aaab8ff 100644 --- a/lib/Mage/Connect/Validator.php +++ b/lib/Mage/Connect/Validator.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/lib/Mage/DB/Exception.php b/lib/Mage/DB/Exception.php index 3476787901a..593a33015b5 100644 --- a/lib/Mage/DB/Exception.php +++ b/lib/Mage/DB/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/DB/Mysqli.php b/lib/Mage/DB/Mysqli.php index 548ce430327..aae6f834402 100644 --- a/lib/Mage/DB/Mysqli.php +++ b/lib/Mage/DB/Mysqli.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Exception.php b/lib/Mage/Exception.php index eb04f2c8362..fa0dda27fe4 100644 --- a/lib/Mage/Exception.php +++ b/lib/Mage/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,4 +32,5 @@ * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Exception extends Exception -{} +{ +} \ No newline at end of file diff --git a/lib/Mage/HTTP/Client.php b/lib/Mage/HTTP/Client.php index bee8e7657d8..c92b87ad92b 100644 --- a/lib/Mage/HTTP/Client.php +++ b/lib/Mage/HTTP/Client.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/lib/Mage/HTTP/Client/Curl.php b/lib/Mage/HTTP/Client/Curl.php index bb20ceed622..24c8c1eca93 100644 --- a/lib/Mage/HTTP/Client/Curl.php +++ b/lib/Mage/HTTP/Client/Curl.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/lib/Mage/HTTP/Client/Socket.php b/lib/Mage/HTTP/Client/Socket.php index d4e51801b85..0fab5328e38 100644 --- a/lib/Mage/HTTP/Client/Socket.php +++ b/lib/Mage/HTTP/Client/Socket.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/lib/Mage/HTTP/IClient.php b/lib/Mage/HTTP/IClient.php index 5163808a118..2c59e814552 100644 --- a/lib/Mage/HTTP/IClient.php +++ b/lib/Mage/HTTP/IClient.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/lib/Mage/System/Args.php b/lib/Mage/System/Args.php index d871567971b..e7f6bdfbaac 100644 --- a/lib/Mage/System/Args.php +++ b/lib/Mage/System/Args.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_System - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 +59,7 @@ class Mage_System_Args { $this->flags = array(); $this->filtered = array(); - + if(false === $source) { $argv = $GLOBALS['argv']; array_shift($argv); @@ -89,7 +89,7 @@ class Mage_System_Args } elseif(strlen($str) == 2 && $str[0] == '-') // -a { - $this->flags[$str[1]] = true; + $this->flags[$str[1]] = true; if(isset($argv[$i + 1]) && preg_match('/^--?.+/', $argv[$i + 1]) == 0) { $this->flags[$str[1]] = $argv[$i + 1]; $argv[$i + 1] = null; diff --git a/lib/Mage/System/Dirs.php b/lib/Mage/System/Dirs.php index d9097ad26d6..ad8e4c47aa3 100644 --- a/lib/Mage/System/Dirs.php +++ b/lib/Mage/System/Dirs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_System - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,4 +103,4 @@ class Mage_System_Dirs } } -} \ No newline at end of file +} diff --git a/lib/Mage/System/Ftp.php b/lib/Mage/System/Ftp.php new file mode 100644 index 00000000000..a9fe9353d60 --- /dev/null +++ b/lib/Mage/System/Ftp.php @@ -0,0 +1,509 @@ +<?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_System + * @copyright 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 to work with remote FTP server + * + * @category Mage + * @package Mage_System + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_System_Ftp +{ + + /** + * Connection object + * + * @var resource + */ + protected $_conn = false; + + /** + * Check connected, throw exception if not + * + * @throws Exception + * @return void + */ + protected function checkConnected() + { + if(!$this->_conn) { + throw new Exception(__CLASS__." - no connection established with server"); + } + } + + /** + * ftp_mkdir wrapper + * + * @param stin$name + * @return unknown_type + */ + public function mdkir($name) + { + $this->checkConnected(); + return @ftp_mkdir($this->_conn, $name); + } + + /** + * Make dir recursive + * + * @param string $path + * @param int $mode + * @return bool + */ + public function mkdirRecursive($path, $mode = 0777) + { + $this->checkConnected(); + $dir = explode("/", $path); + $path= ""; + $ret = true; + for ($i=0; $i < count($dir); $i++) { + $path .= "/" .$dir[$i]; + if(!@ftp_chdir($this->_conn, $path)) { + @ftp_chdir($this->_conn,"/"); + if(!@ftp_mkdir($this->_conn,$path)) { + $ret=false; + break; + } else { + @ftp_chmod($this->_conn, $mode, $path); + } + } + } + return $ret; + } + + /** + * Try to login to server + * + * @param string $login + * @param string $password + * @throws Exception on invalid login credentials + * @return bool + */ + public function login($login = "anonymous", $password = "test@gmail.com") + { + $this->checkConnected(); + $res = @ftp_login($this->_conn, $login, $password); + if(!$res) { + throw new Exception("Invalid login credentials"); + } + return $res; + } + + /** + * Validate connection string + * + * @param string $string + * @throws Exception + * @return string + */ + public function validateConnectionString($string) + { + $data = @parse_url($string); + if(false === $data) { + throw new Exception("Connection string invalid: '{$string}'"); + } + if($data['scheme'] != 'ftp') { + throw new Exception("Support for scheme unsupported: '{$data['scheme']}'"); + } + return $data; + } + + /** + * Connect to server using connect string + * Connection string: ftp://user:pass@server:port/path + * user,pass,port,path are optional parts + * + * @param string $string + * @param int $timeout + */ + public function connect($string, $timeout = 900) + { + $params = $this->validateConnectionString($string); + $port = isset($params['port']) ? intval($params['port']) : 21; + + $this->_conn = ftp_connect($params['host'], $port, $timeout); + + if(!$this->_conn) { + throw new Exception("Cannot connect to host: {$params['host']}"); + } + if(isset($params['user']) && isset($params['pass'])) { + $this->login($params['user'], $params['pass']); + } else { + $this->login(); + } + if(isset($params['path'])) { + if(!$this->chdir($params['path'])) { + throw new Exception ("Cannot chdir after login to: {$params['path']}"); + } + } + } + + /** + * ftp_fput wrapper + * + * @param string $remoteFile + * @param resource $handle + * @param int $mode FTP_BINARY | FTP_ASCII + * @param int $startPos + * @return bool + */ + public function fput($remoteFile, $handle, $mode = FTP_BINARY, $startPos = 0) + { + $this->checkConnected(); + return @ftp_fput($this->_conn, $remoteFile, $handle, $mode, $startPos); + } + + /** + * ftp_put wrapper + * + * @param string $remoteFile + * @param string $localFile + * @param int $mode FTP_BINARY | FTP_ASCII + * @param int $startPos + * @return bool + */ + public function put($remoteFile, $localFile, $mode = FTP_BINARY, $startPos = 0) + { + $this->checkConnected(); + return ftp_put($this->_conn, $remoteFile, $localFile, $mode, $startPos); + } + + /** + * Get current working directory + * + * @return mixed + */ + public function getcwd() + { + $d = $this->raw("pwd"); + $data = explode(" ", $d[0], 3); + if(empty($data[1])) { + return false; + } + if(intval($data[0]) != 257) { + return false; + } + $out = trim($data[1], '"'); + if($out !== "/") { + $out = rtrim($out, "/"); + } + return $out; + } + + /** + * ftp_raw wrapper + * + * @param string $cmd + * @return mixed + */ + public function raw($cmd) + { + $this->checkConnected(); + return @ftp_raw($this->_conn, $cmd); + } + + /** + * Upload local file to remote + * + * Can be used for relative and absoulte remote paths + * Relative: use chdir before calling this + * + * @param srting $remote + * @param string $local + * @param int $dirMode + * @param int $ftpMode + * @return unknown_type + */ + public function upload($remote, $local, $dirMode = 0777, $ftpMode = FTP_BINARY) + { + $this->checkConnected(); + + if(!file_exists($local)) { + throw new Exception("Local file doesn't exist: {$localFile}"); + } + if(!is_readable($local)) { + throw new Exception("Local file is not readable: {$localFile}"); + } + if(is_dir($local)) { + throw new Exception("Directory given instead of file: {$localFile}"); + } + + $globalPathMode = substr($remote, 0, 1) == "/"; + $dirname = dirname($remote); + $cwd = $this->getcwd(); + if(false === $cwd) { + throw new Exception("Server returns something awful on PWD command"); + } + + if(!$globalPathMode) { + $dirname = $cwd."/".$dirname; + $remote = $cwd."/".$remote; + } + $res = $this->mkdirRecursive($dirname, $dirMode); + $this->chdir($cwd); + + if(!$res) { + return false; + } + return $this->put($remote, $local, $ftpMode); + } + + /** + * Download remote file to local machine + * + * @param string $remote + * @param string $local + * @param int $ftpMode FTP_BINARY|FTP_ASCII + * @return bool + */ + public function download($remote, $local, $ftpMode = FTP_BINARY) + { + $this->checkConnected(); + return $this->get($local, $remote, $ftpMode); + } + + /** + * ftp_pasv wrapper + * + * @param bool $pasv + * @return bool + */ + public function pasv($pasv) + { + $this->checkConnected(); + return @ftp_pasv($this->_conn, (bool) $pasv); + } + + /** + * Close FTP connection + * + * @return void + */ + public function close() + { + if($this->_conn) { + @ftp_close($this->_conn); + } + } + + /** + * ftp_chmod wrapper + * + * @param $mode + * @param $remoteFile + * @return bool + */ + public function chmod($mode, $remoteFile) + { + $this->checkConnected(); + return @ftp_chmod($this->_conn, $mode, $remoteFile); + } + + /** + * ftp_chdir wrapper + * + * @param string $dir + * @return bool + */ + public function chdir($dir) + { + $this->checkConnected(); + return @ftp_chdir($this->_conn, $dir); + } + + /** + * ftp_cdup wrapper + * + * @return bool + */ + public function cdup() + { + $this->checkConnected(); + return @ftp_cdup($this->_conn); + } + + /** + * ftp_get wrapper + * + * @param string $localFile + * @param string $remoteFile + * @param int $fileMode FTP_BINARY | FTP_ASCII + * @param int $resumeOffset + * @return bool + */ + public function get($localFile, $remoteFile, $fileMode = FTP_BINARY, $resumeOffset = 0) + { + $remoteFile = $this->correctFilePath($remoteFile); + $this->checkConnected(); + return @ftp_get($this->_conn, $localFile, $remoteFile, $fileMode, $resumeOffset); + } + + /** + * ftp_nlist wrapper + * + * @param string $dir + * @return bool + */ + public function nlist($dir = "/") + { + $this->checkConnected(); + $dir = $this->correctFilePath($dir); + return @ftp_nlist($this->_conn, $dir); + } + + /** + * ftp_rawlist wrapper + * + * @param string $dir + * @param bool $recursive + * @return mixed + */ + public function rawlist( $dir = "/", $recursive = false ) + { + $this->checkConnected(); + $dir = $this->correctFilePath($dir); + return @ftp_rawlist($this->_conn, $dir, $recursive); + } + + /** + * Convert byte count to float KB/MB format + * + * @param int $bytes + * @return string + */ + public static function byteconvert($bytes) + { + $symbol = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); + $exp = floor( log($bytes) / log(1024) ); + return sprintf( '%.2f ' . $symbol[ $exp ], ($bytes / pow(1024, floor($exp))) ); + } + + /** + * Chmod string "-rwxrwxrwx" to "777" converter + * + * @param string $chmod + * @return string + */ + public static function chmodnum($chmod) + { + $trans = array('-' => '0', 'r' => '4', 'w' => '2', 'x' => '1'); + $chmod = substr(strtr($chmod, $trans), 1); + $array = str_split($chmod, 3); + return array_sum(str_split($array[0])) . array_sum(str_split($array[1])) . array_sum(str_split($array[2])); + } + + /** + * Check whether file exists + * + * @param string $path + * @param bool $excludeIfIsDir + * @return bool + */ + public function fileExists($path, $excludeIfIsDir = true) + { + $path = $this->correctFilePath($path); + $globalPathMode = substr($path, 0, 1) == "/"; + + $file = basename($path); + $dir = $globalPathMode ? dirname($path) : $this->getcwd()."/".$path; + $data = $this->ls($dir); + foreach($data as $row) { + if($file == $row['name']) { + if($excludeIfIsDir && $row['dir']) { + continue; + } + return true; + } + } + return false; + } + + /** + * Get directory contents in PHP array + * + * @param string $dir + * @param bool $recursive + * @return array + */ + public function ls($dir = "/", $recursive = false) + { + $dir= $this->correctFilePath($dir); + $rawfiles = (array) $this->rawlist($dir, $recursive); + $structure = array(); + $arraypointer = &$structure; + foreach ($rawfiles as $rawfile) { + if ($rawfile[0] == '/') { + $paths = array_slice(explode('/', str_replace(':', '', $rawfile)), 1); + $arraypointer = &$structure; + foreach ($paths as $path) { + foreach ($arraypointer as $i => $file) { + if ($file['name'] == $path) { + $arraypointer = &$arraypointer[ $i ]['children']; + break; + } + } + } + } elseif(!empty($rawfile)) { + $info = preg_split("/[\s]+/", $rawfile, 9); + $arraypointer[] = array( + 'name' => $info[8], + 'dir' => $info[0]{0} == 'd', + 'size' => (int) $info[4], + 'chmod' => self::chmodnum($info[0]), + 'rawdata' => $info, + 'raw' => $rawfile + ); + } + } + return $structure; + } + + /** + * Correct file path + * + * @param string $str + * @return string + */ + public function correctFilePath($str) + { + $str = str_replace("\\", "/", $str); + $str = preg_replace("/^.\//", "", $str); + return $str; + } + + /** + * Delete file + * + * @param string $file + * @return bool + */ + public function delete($file) + { + $this->checkConnected(); + $file = $this->correctFilePath($file); + return @ftp_delete($this->_conn, $file); + } +} diff --git a/lib/Mage/Xml/Generator.php b/lib/Mage/Xml/Generator.php index f95ef6d06ab..1c9d4f9cdc7 100644 --- a/lib/Mage/Xml/Generator.php +++ b/lib/Mage/Xml/Generator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Xml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Xml/Parser.php b/lib/Mage/Xml/Parser.php index 4539f41a07d..f4937f52ac2 100644 --- a/lib/Mage/Xml/Parser.php +++ b/lib/Mage/Xml/Parser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Xml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Autoload.php b/lib/Magento/Autoload.php index 95dc5ca9026..f771f196b9c 100644 --- a/lib/Magento/Autoload.php +++ b/lib/Magento/Autoload.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Loader - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -152,8 +152,8 @@ class Magento_Autoload * Add classes files declaration to the map. New map will override existing values if such was defined before. * * @param array|string $map - * @param string $basePath * @return Magento_Autoload + * @throws Magento_Exception */ public function addFilesMap($map) { @@ -161,13 +161,13 @@ class Magento_Autoload if (is_file($map) && is_readable($map)) { $map = unserialize(file_get_contents($map)); } else { - throw new Exception($map . ' file does not exist.'); + throw new Magento_Exception($map . ' file does not exist.'); } } if (is_array($map)) { $this->_filesMap = array_merge($this->_filesMap, $map); } else { - throw new Exception('$map parameter should be an array or path map file.'); + throw new Magento_Exception('$map parameter should be an array or path map file.'); } return $this; } diff --git a/lib/Magento/Config/Dom.php b/lib/Magento/Config/Dom.php index f251a20a5cb..527083f11d3 100644 --- a/lib/Magento/Config/Dom.php +++ b/lib/Magento/Config/Dom.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage Config - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,7 +135,7 @@ class Magento_Config_Dom * Getter for node by path * * @param string $nodePath - * @throws Exception an exception is possible if original document contains multiple nodes for identifier + * @throws Magento_Exception an exception is possible if original document contains multiple nodes for identifier * @return DOMElement | null */ protected function _getMatchedNode($nodePath) @@ -144,7 +144,7 @@ class Magento_Config_Dom $matchedNodes = $xPath->query($nodePath); $node = null; if ($matchedNodes->length > 1) { - throw new Exception("More than one node matching the query: {$nodePath}"); + throw new Magento_Exception("More than one node matching the query: {$nodePath}"); } elseif ($matchedNodes->length == 1) { $node = $matchedNodes->item(0); } diff --git a/lib/Magento/Config/Theme.php b/lib/Magento/Config/Theme.php index d9f48ec7efb..5c9b48c4316 100644 --- a/lib/Magento/Config/Theme.php +++ b/lib/Magento/Config/Theme.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage Config - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 @@ class Magento_Config_Theme extends Magento_Config_XmlAbstract * * @param string $package * @param string $theme - * @throw Exception an exception in case of unknown theme + * @throw Magento_Exception an exception in case of unknown theme * @return array */ public function getCompatibleVersions($package, $theme) @@ -96,7 +96,7 @@ class Magento_Config_Theme extends Magento_Config_XmlAbstract ->query("/design/package[@code='{$package}']/theme[@code='{$theme}']/requirements/magento_version") ->item(0); if (!$version) { - throw new Exception('Unknown theme "' . $theme . '" in "' . $package . '" package.'); + throw new Magento_Exception('Unknown theme "' . $theme . '" in "' . $package . '" package.'); } $result = array( 'from' => $version->getAttribute('from'), diff --git a/lib/Magento/Config/View.php b/lib/Magento/Config/View.php index 343fd632c39..8f79ebca66b 100644 --- a/lib/Magento/Config/View.php +++ b/lib/Magento/Config/View.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage Config - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Config/XmlAbstract.php b/lib/Magento/Config/XmlAbstract.php index 1564cde4479..0e0a6d607fc 100644 --- a/lib/Magento/Config/XmlAbstract.php +++ b/lib/Magento/Config/XmlAbstract.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage Config - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -39,12 +39,12 @@ abstract class Magento_Config_XmlAbstract * Instantiate with the list of files to merge * * @param array $configFiles - * @throws Exception + * @throws Magento_Exception */ public function __construct(array $configFiles) { if (empty($configFiles)) { - throw new Exception('There must be at least one configuration file specified.'); + throw new Magento_Exception('There must be at least one configuration file specified.'); } $this->_merge($configFiles); } @@ -60,14 +60,14 @@ abstract class Magento_Config_XmlAbstract * Merge the config XML-files * * @param array $configFiles - * @throws Exception if a non-existing or invalid XML-file passed + * @throws Magento_Exception if a non-existing or invalid XML-file passed */ protected function _merge($configFiles) { $domConfig = new Magento_Config_Dom($this->_getInitialXml(), $this->_getIdAttributes()); foreach ($configFiles as $file) { if (!file_exists($file)) { - throw new Exception("File does not exist: {$file}"); + throw new Magento_Exception("File does not exist: {$file}"); } $domConfig->merge(file_get_contents($file)); if (!$domConfig->validate($this->getSchemaFile(), $errors)) { @@ -76,7 +76,7 @@ abstract class Magento_Config_XmlAbstract foreach ($errors as $error) { $message .= "{$error->message} Line: {$error->line}\n"; } - throw new Exception($message); + throw new Magento_Exception($message); } } $this->_dom = $domConfig->getDom(); diff --git a/lib/Magento/Config/theme.xsd b/lib/Magento/Config/theme.xsd index 6ae28d51cdf..3ad9700cb09 100644 --- a/lib/Magento/Config/theme.xsd +++ b/lib/Magento/Config/theme.xsd @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage Config - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/lib/Magento/Config/view.xsd b/lib/Magento/Config/view.xsd index bd1900ef116..f5976575136 100644 --- a/lib/Magento/Config/view.xsd +++ b/lib/Magento/Config/view.xsd @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage Config - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/lib/Magento/Convert/Excel.php b/lib/Magento/Convert/Excel.php index dcc4f8acb31..9f9e7a4b0c7 100644 --- a/lib/Magento/Convert/Excel.php +++ b/lib/Magento/Convert/Excel.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Convert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Crypt.php b/lib/Magento/Crypt.php index 358f09bd4d7..58fcf18d397 100755 --- a/lib/Magento/Crypt.php +++ b/lib/Magento/Crypt.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Crypt - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Exception.php b/lib/Magento/Exception.php index e66d0a5d2e9..ee2a6359035 100755 --- a/lib/Magento/Exception.php +++ b/lib/Magento/Exception.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Exception - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Profiler.php b/lib/Magento/Profiler.php index ef1bd38edbd..9723bbaf099 100644 --- a/lib/Magento/Profiler.php +++ b/lib/Magento/Profiler.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Profiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Profiler/Output/Csvfile.php b/lib/Magento/Profiler/Output/Csvfile.php index a9c35d812b8..522dc67899b 100644 --- a/lib/Magento/Profiler/Output/Csvfile.php +++ b/lib/Magento/Profiler/Output/Csvfile.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Profiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Profiler/Output/Firebug.php b/lib/Magento/Profiler/Output/Firebug.php index 6f2031f86db..435822f458d 100644 --- a/lib/Magento/Profiler/Output/Firebug.php +++ b/lib/Magento/Profiler/Output/Firebug.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Profiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Profiler/Output/Html.php b/lib/Magento/Profiler/Output/Html.php index 630bdbd58ec..ce5faeac74a 100644 --- a/lib/Magento/Profiler/Output/Html.php +++ b/lib/Magento/Profiler/Output/Html.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Profiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Profiler/OutputAbstract.php b/lib/Magento/Profiler/OutputAbstract.php index 9411eee9952..0544c662db0 100644 --- a/lib/Magento/Profiler/OutputAbstract.php +++ b/lib/Magento/Profiler/OutputAbstract.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Profiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Cache/Backend/Database.php b/lib/Varien/Cache/Backend/Database.php index 6eb13557153..af3170da039 100644 --- a/lib/Varien/Cache/Backend/Database.php +++ b/lib/Varien/Cache/Backend/Database.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Cache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Cache/Backend/Eaccelerator.php b/lib/Varien/Cache/Backend/Eaccelerator.php index 996f82404a2..016f14347db 100644 --- a/lib/Varien/Cache/Backend/Eaccelerator.php +++ b/lib/Varien/Cache/Backend/Eaccelerator.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Cache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Cache/Backend/Memcached.php b/lib/Varien/Cache/Backend/Memcached.php index 67bcc5c9ea9..e228f57f1ea 100644 --- a/lib/Varien/Cache/Backend/Memcached.php +++ b/lib/Varien/Cache/Backend/Memcached.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Cache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Cache/Core.php b/lib/Varien/Cache/Core.php index c4d92fbfa44..f2ee0773437 100644 --- a/lib/Varien/Cache/Core.php +++ b/lib/Varien/Cache/Core.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Cache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Convert/Container/Abstract.php b/lib/Varien/Convert/Container/Abstract.php index 489e212ac7d..a0d98da7dba 100644 --- a/lib/Varien/Convert/Container/Abstract.php +++ b/lib/Varien/Convert/Container/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Convert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Convert/Exception.php b/lib/Varien/Convert/Exception.php index 97dca706f07..b3c83d749d7 100644 --- a/lib/Varien/Convert/Exception.php +++ b/lib/Varien/Convert/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Convert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Convert/Mapper/Column.php b/lib/Varien/Convert/Mapper/Column.php index 0df76cf99f4..95ac6e1a354 100644 --- a/lib/Varien/Convert/Mapper/Column.php +++ b/lib/Varien/Convert/Mapper/Column.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Convert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Convert/Mapper/Interface.php b/lib/Varien/Convert/Mapper/Interface.php index 7cd9963a549..1a7808f5a63 100644 --- a/lib/Varien/Convert/Mapper/Interface.php +++ b/lib/Varien/Convert/Mapper/Interface.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Convert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Collection.php b/lib/Varien/Data/Collection.php index bcdf6b05ba6..c4b3a0dd354 100644 --- a/lib/Varien/Data/Collection.php +++ b/lib/Varien/Data/Collection.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Collection/Db.php b/lib/Varien/Data/Collection/Db.php index a82f359f78e..0ac9545b3f3 100644 --- a/lib/Varien/Data/Collection/Db.php +++ b/lib/Varien/Data/Collection/Db.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -373,42 +373,76 @@ class Varien_Data_Collection_Db extends Varien_Data_Collection * Add field filter to collection * * @see self::_getConditionSql for $condition - * @param string $field - * @param null|string|array $condition - * @return Mage_Eav_Model_Entity_Collection_Abstract + * + * @param string|array $field + * @param null|string|array $condition + * + * @return Mage_Eav_Model_Entity_Collection_Abstract */ - public function addFieldToFilter($field, $condition=null) + public function addFieldToFilter($field, $condition = null) { - $field = $this->_getMappedField($field); - $this->_select->where($this->_getConditionSql($field, $condition), null, Varien_Db_Select::TYPE_CONDITION); + if (!is_array($field)) { + $resultCondition = $this->_translateCondition($field, $condition); + } else { + $conditions = array(); + foreach ($field as $key => $currField) { + $conditions[] = $this->_translateCondition( + $currField, + isset($condition[$key]) ? $condition[$key] : null + ); + } + + $resultCondition = '(' . join(') ' . Zend_Db_Select::SQL_OR . ' (', $conditions) . ')'; + } + + $this->_select->where($resultCondition); + return $this; } + /** + * Build sql where condition part + * + * @param string|array $field + * @param null|string|array $condition + * + * @return string + */ + protected function _translateCondition($field, $condition) + { + $field = $this->_getMappedField($field); + return $this->_getConditionSql($field, $condition); + } + /** * Try to get mapped field name for filter to collection * - * @param string - * @return string + * @param string $field + * @return string */ protected function _getMappedField($field) { - $mappedFiled = $field; - $mapper = $this->_getMapper(); if (isset($mapper['fields'][$field])) { $mappedFiled = $mapper['fields'][$field]; + } else { + $mappedFiled = $field; } return $mappedFiled; } + /** + * Retrieve mapper data + * + * @return array|bool|null + */ protected function _getMapper() { if (isset($this->_map)) { return $this->_map; - } - else { + } else { return false; } } @@ -468,6 +502,7 @@ class Varien_Data_Collection_Db extends Varien_Data_Collection } $this->_isOrdersRendered = true; } + return $this; } @@ -488,7 +523,9 @@ class Varien_Data_Collection_Db extends Varien_Data_Collection /** * Set select distinct * - * @param bool $flag + * @param bool $flag + * + * @return Varien_Data_Collection_Db */ public function distinct($flag) { @@ -509,6 +546,9 @@ class Varien_Data_Collection_Db extends Varien_Data_Collection /** * Load data * + * @param bool $printQuery + * @param bool $logQuery + * * @return Varien_Data_Collection_Db */ public function load($printQuery = false, $logQuery = false) @@ -547,7 +587,7 @@ class Varien_Data_Collection_Db extends Varien_Data_Collection * Returns a collection item that corresponds to the fetched row * and moves the internal data pointer ahead * - * return Varien_Object|bool + * @return Varien_Object|bool */ public function fetchItem() { @@ -643,8 +683,10 @@ class Varien_Data_Collection_Db extends Varien_Data_Collection /** * Print and/or log query * - * @param boolean $printQuery - * @param boolean $logQuery + * @param bool $printQuery + * @param bool $logQuery + * @param string $sql + * * @return Varien_Data_Collection_Db */ public function printLogQuery($printQuery = false, $logQuery = false, $sql = null) { diff --git a/lib/Varien/Data/Collection/Filesystem.php b/lib/Varien/Data/Collection/Filesystem.php index 8d6c2cd045f..c7f5871e930 100644 --- a/lib/Varien/Data/Collection/Filesystem.php +++ b/lib/Varien/Data/Collection/Filesystem.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -511,7 +511,7 @@ class Varien_Data_Collection_Filesystem extends Varien_Data_Collection return $this->addCallbackFilter($field, $cond['in'], $type, array($this, 'filterCallbackInArray')); } if (isset($cond['nin'])) { - return $this->addCallbackFilter($field, $cond['nin'], $type, array($this, 'filterCallbackIn'), $inverted); + return $this->addCallbackFilter($field, $cond['nin'], $type, array($this, 'filterCallbackInArray'), $inverted); } if (isset($cond['notnull'])) { return $this->addCallbackFilter($field, $cond['notnull'], $type, array($this, 'filterCallbackIsNull'), $inverted); diff --git a/lib/Varien/Data/Form.php b/lib/Varien/Data/Form.php index 194bc698868..0d4de443344 100644 --- a/lib/Varien/Data/Form.php +++ b/lib/Varien/Data/Form.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Abstract.php b/lib/Varien/Data/Form/Abstract.php index af4a5ac0a41..c1d91002521 100644 --- a/lib/Varien/Data/Form/Abstract.php +++ b/lib/Varien/Data/Form/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -110,10 +110,12 @@ class Varien_Data_Form_Abstract extends Varien_Object /** * Add form element * - * @param Varien_Data_Form_Element_Abstract $element - * @return Varien_Data_Form + * @param Varien_Data_Form_Element_Abstract $element + * @param bool|string|null $after + * + * @return Varien_Data_Form */ - public function addElement(Varien_Data_Form_Element_Abstract $element, $after=null) + public function addElement(Varien_Data_Form_Element_Abstract $element, $after = null) { $element->setForm($this); $this->getElements()->add($element, $after); @@ -163,11 +165,12 @@ class Varien_Data_Form_Abstract extends Varien_Object * Enter description here... * * @param string $elementId - * @param unknown_type $config - * @param unknown_type $after + * @param array $config + * @param bool|string|null $after + * * @return Varien_Data_Form_Element_Fieldset */ - public function addFieldset($elementId, $config, $after=false) + public function addFieldset($elementId, $config, $after = false) { $element = new Varien_Data_Form_Element_Fieldset($config); $element->setId($elementId); diff --git a/lib/Varien/Data/Form/Element/Abstract.php b/lib/Varien/Data/Form/Element/Abstract.php index c7b8ff0fb6d..bf45faea108 100644 --- a/lib/Varien/Data/Form/Element/Abstract.php +++ b/lib/Varien/Data/Form/Element/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Button.php b/lib/Varien/Data/Form/Element/Button.php index 19e4c791482..29b4cafd759 100644 --- a/lib/Varien/Data/Form/Element/Button.php +++ b/lib/Varien/Data/Form/Element/Button.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Checkbox.php b/lib/Varien/Data/Form/Element/Checkbox.php index d7299b01f13..c1a327de904 100644 --- a/lib/Varien/Data/Form/Element/Checkbox.php +++ b/lib/Varien/Data/Form/Element/Checkbox.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Checkboxes.php b/lib/Varien/Data/Form/Element/Checkboxes.php index 8939177e16f..a348692bce0 100644 --- a/lib/Varien/Data/Form/Element/Checkboxes.php +++ b/lib/Varien/Data/Form/Element/Checkboxes.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Collection.php b/lib/Varien/Data/Form/Element/Collection.php index 345d59bd629..4808378e3c3 100644 --- a/lib/Varien/Data/Form/Element/Collection.php +++ b/lib/Varien/Data/Form/Element/Collection.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -116,10 +116,11 @@ class Varien_Data_Form_Element_Collection implements ArrayAccess, IteratorAggreg * * @todo get it straight with $after * @param Varien_Data_Form_Element_Abstract $element - * @param boolean|'^'|string $after - * @return Varien_Data_Form_Element_Abstract + * @param bool|string $after + * + * @return Varien_Data_Form_Element_Collection */ - public function add(Varien_Data_Form_Element_Abstract $element, $after=false) + public function add(Varien_Data_Form_Element_Abstract $element, $after = false) { // Set the Form for the node if ($this->_container->getForm() instanceof Varien_Data_Form) { diff --git a/lib/Varien/Data/Form/Element/Column.php b/lib/Varien/Data/Form/Element/Column.php index b01eb8b7605..bccfc5d006d 100644 --- a/lib/Varien/Data/Form/Element/Column.php +++ b/lib/Varien/Data/Form/Element/Column.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Date.php b/lib/Varien/Data/Form/Element/Date.php index f1399de4f60..ffbc18681ec 100644 --- a/lib/Varien/Data/Form/Element/Date.php +++ b/lib/Varien/Data/Form/Element/Date.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Editor.php b/lib/Varien/Data/Form/Element/Editor.php index 9ba24266c25..074f9e338df 100644 --- a/lib/Varien/Data/Form/Element/Editor.php +++ b/lib/Varien/Data/Form/Element/Editor.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -308,7 +308,7 @@ class Varien_Data_Form_Element_Editor extends Varien_Data_Form_Element_Textarea $html.= isset($data['style']) ? ' style="'.$data['style'].'"' : ''; $html.= isset($data['id']) ? ' id="'.$data['id'].'"' : ''; $html.= '>'; - $html.= isset($data['title']) ? '<span>'.$data['title'].'</span>' : ''; + $html.= isset($data['title']) ? '<span><span><span>'.$data['title'].'</span></span></span>' : ''; $html.= '</button>'; return $html; diff --git a/lib/Varien/Data/Form/Element/Fieldset.php b/lib/Varien/Data/Form/Element/Fieldset.php index 588428bb07b..a7c49f2a9ef 100644 --- a/lib/Varien/Data/Form/Element/Fieldset.php +++ b/lib/Varien/Data/Form/Element/Fieldset.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/File.php b/lib/Varien/Data/Form/Element/File.php index a3a06c264ef..0fb5c1a1552 100644 --- a/lib/Varien/Data/Form/Element/File.php +++ b/lib/Varien/Data/Form/Element/File.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Gallery.php b/lib/Varien/Data/Form/Element/Gallery.php index a697dd75b46..19984a79a40 100644 --- a/lib/Varien/Data/Form/Element/Gallery.php +++ b/lib/Varien/Data/Form/Element/Gallery.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Hidden.php b/lib/Varien/Data/Form/Element/Hidden.php index d835e193eca..c20faa77bd1 100644 --- a/lib/Varien/Data/Form/Element/Hidden.php +++ b/lib/Varien/Data/Form/Element/Hidden.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Image.php b/lib/Varien/Data/Form/Element/Image.php index 41420a1a62d..4e5fe23f3f8 100644 --- a/lib/Varien/Data/Form/Element/Image.php +++ b/lib/Varien/Data/Form/Element/Image.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Imagefile.php b/lib/Varien/Data/Form/Element/Imagefile.php index 2eb815bffb6..42e4baa7273 100644 --- a/lib/Varien/Data/Form/Element/Imagefile.php +++ b/lib/Varien/Data/Form/Element/Imagefile.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Label.php b/lib/Varien/Data/Form/Element/Label.php index 18637f161ae..34ae50b617b 100644 --- a/lib/Varien/Data/Form/Element/Label.php +++ b/lib/Varien/Data/Form/Element/Label.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,19 +33,28 @@ */ class Varien_Data_Form_Element_Label extends Varien_Data_Form_Element_Abstract { - public function __construct($attributes=array()) + /** + * Assigns attributes for Element + * + * @param array $attributes + */ + public function __construct($attributes=array()) { parent::__construct($attributes); $this->setType('label'); } + /** + * Retrieve Element HTML + * + * @return string + */ public function getElementHtml() { - $html = $this->getBold() ? '<strong>' : ''; - $html.= $this->getEscapedValue(); - $html.= $this->getBold() ? '</strong>' : ''; - $html.= $this->getAfterElementHtml(); - return $html; + $html = $this->getBold() ? '<strong>' : ''; + $html.= $this->getEscapedValue(); + $html.= $this->getBold() ? '</strong>' : ''; + $html.= $this->getAfterElementHtml(); + return $html; } - -} \ No newline at end of file +} diff --git a/lib/Varien/Data/Form/Element/Link.php b/lib/Varien/Data/Form/Element/Link.php index 20bc2289df9..b268069665d 100644 --- a/lib/Varien/Data/Form/Element/Link.php +++ b/lib/Varien/Data/Form/Element/Link.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Multiline.php b/lib/Varien/Data/Form/Element/Multiline.php index 15c9522a2bb..f1edc0e2de0 100644 --- a/lib/Varien/Data/Form/Element/Multiline.php +++ b/lib/Varien/Data/Form/Element/Multiline.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Multiselect.php b/lib/Varien/Data/Form/Element/Multiselect.php index b47dc0ae19d..e0d1373bf35 100644 --- a/lib/Varien/Data/Form/Element/Multiselect.php +++ b/lib/Varien/Data/Form/Element/Multiselect.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Note.php b/lib/Varien/Data/Form/Element/Note.php index 52311f20ca6..889daf0ab42 100644 --- a/lib/Varien/Data/Form/Element/Note.php +++ b/lib/Varien/Data/Form/Element/Note.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Obscure.php b/lib/Varien/Data/Form/Element/Obscure.php index 2be904654d2..b75de33d2be 100644 --- a/lib/Varien/Data/Form/Element/Obscure.php +++ b/lib/Varien/Data/Form/Element/Obscure.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Password.php b/lib/Varien/Data/Form/Element/Password.php index f5428f683e8..656e0c05037 100644 --- a/lib/Varien/Data/Form/Element/Password.php +++ b/lib/Varien/Data/Form/Element/Password.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Radio.php b/lib/Varien/Data/Form/Element/Radio.php index ba8f22490d4..39c648aafae 100644 --- a/lib/Varien/Data/Form/Element/Radio.php +++ b/lib/Varien/Data/Form/Element/Radio.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Radios.php b/lib/Varien/Data/Form/Element/Radios.php index 65460b2359b..9c4842781c5 100644 --- a/lib/Varien/Data/Form/Element/Radios.php +++ b/lib/Varien/Data/Form/Element/Radios.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Renderer/Interface.php b/lib/Varien/Data/Form/Element/Renderer/Interface.php index d4b0043b001..253cd84bb05 100644 --- a/lib/Varien/Data/Form/Element/Renderer/Interface.php +++ b/lib/Varien/Data/Form/Element/Renderer/Interface.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Reset.php b/lib/Varien/Data/Form/Element/Reset.php index 816a19d4e2a..c92db81c668 100644 --- a/lib/Varien/Data/Form/Element/Reset.php +++ b/lib/Varien/Data/Form/Element/Reset.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Select.php b/lib/Varien/Data/Form/Element/Select.php index b425dd00a99..96210bd0410 100644 --- a/lib/Varien/Data/Form/Element/Select.php +++ b/lib/Varien/Data/Form/Element/Select.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Submit.php b/lib/Varien/Data/Form/Element/Submit.php index 7104f10c4a5..5a7d97ec7d9 100644 --- a/lib/Varien/Data/Form/Element/Submit.php +++ b/lib/Varien/Data/Form/Element/Submit.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Text.php b/lib/Varien/Data/Form/Element/Text.php index d3e7d0f52e7..0c069612367 100644 --- a/lib/Varien/Data/Form/Element/Text.php +++ b/lib/Varien/Data/Form/Element/Text.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Textarea.php b/lib/Varien/Data/Form/Element/Textarea.php index a3b9651c0b3..e039e62a96c 100644 --- a/lib/Varien/Data/Form/Element/Textarea.php +++ b/lib/Varien/Data/Form/Element/Textarea.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Time.php b/lib/Varien/Data/Form/Element/Time.php index 34498f47c76..f5ff2b90e42 100644 --- a/lib/Varien/Data/Form/Element/Time.php +++ b/lib/Varien/Data/Form/Element/Time.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Filter/Date.php b/lib/Varien/Data/Form/Filter/Date.php index a924f5019e9..6d074e7d729 100644 --- a/lib/Varien/Data/Form/Filter/Date.php +++ b/lib/Varien/Data/Form/Filter/Date.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Filter/Escapehtml.php b/lib/Varien/Data/Form/Filter/Escapehtml.php index 73e67713ca3..ccfe6a11a5c 100644 --- a/lib/Varien/Data/Form/Filter/Escapehtml.php +++ b/lib/Varien/Data/Form/Filter/Escapehtml.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Filter/Interface.php b/lib/Varien/Data/Form/Filter/Interface.php index abbb87ef778..b443754c950 100644 --- a/lib/Varien/Data/Form/Filter/Interface.php +++ b/lib/Varien/Data/Form/Filter/Interface.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Filter/Striptags.php b/lib/Varien/Data/Form/Filter/Striptags.php index b93ef25caff..22e5e4c1e50 100644 --- a/lib/Varien/Data/Form/Filter/Striptags.php +++ b/lib/Varien/Data/Form/Filter/Striptags.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Tree.php b/lib/Varien/Data/Tree.php index 8fab55606fa..ba43ef64483 100644 --- a/lib/Varien/Data/Tree.php +++ b/lib/Varien/Data/Tree.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Tree/Db.php b/lib/Varien/Data/Tree/Db.php index 9398bf06197..31cbdcfae38 100644 --- a/lib/Varien/Data/Tree/Db.php +++ b/lib/Varien/Data/Tree/Db.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Tree/Dbp.php b/lib/Varien/Data/Tree/Dbp.php index fefc0cbaec5..277e8c0aa1a 100644 --- a/lib/Varien/Data/Tree/Dbp.php +++ b/lib/Varien/Data/Tree/Dbp.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Tree/Node.php b/lib/Varien/Data/Tree/Node.php index b83dd5bc8ad..2014445f300 100644 --- a/lib/Varien/Data/Tree/Node.php +++ b/lib/Varien/Data/Tree/Node.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Tree/Node/Collection.php b/lib/Varien/Data/Tree/Node/Collection.php index 8dd0396eaac..91541e35c60 100644 --- a/lib/Varien/Data/Tree/Node/Collection.php +++ b/lib/Varien/Data/Tree/Node/Collection.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Date.php b/lib/Varien/Date.php index 5b7a40833e3..bbd815bd3dd 100644 --- a/lib/Varien/Date.php +++ b/lib/Varien/Date.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Date - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Adapter/Interface.php b/lib/Varien/Db/Adapter/Interface.php index 08fd4ddf06a..85af7e2f0ad 100644 --- a/lib/Varien/Db/Adapter/Interface.php +++ b/lib/Varien/Db/Adapter/Interface.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -821,6 +821,16 @@ interface Varien_Db_Adapter_Interface */ public function getDatePartSql($date); + /** + * Prepare substring sql function + * + * @param Zend_Db_Expr|string $stringExpression quoted field name or SQL statement + * @param int|string|Zend_Db_Expr $pos + * @param int|string|Zend_Db_Expr|null $len + * @return Zend_Db_Expr + */ + public function getSubstringSql($stringExpression, $pos, $len = null); + /** * Extract part of a date * diff --git a/lib/Varien/Db/Adapter/Mysqli.php b/lib/Varien/Db/Adapter/Mysqli.php index 9cc1d51a142..26c8242912c 100644 --- a/lib/Varien/Db/Adapter/Mysqli.php +++ b/lib/Varien/Db/Adapter/Mysqli.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php index afa243860be..035e2ce1a40 100644 --- a/lib/Varien/Db/Adapter/Pdo/Mysql.php +++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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,6 +48,11 @@ class Varien_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements V const LENGTH_INDEX_NAME = 64; const LENGTH_FOREIGN_NAME = 64; + /** + * MEMORY engine type for MySQL tables + */ + const ENGINE_MEMORY = 'MEMORY'; + /** * Default class name for a DB statement. * @@ -429,21 +434,6 @@ class Varien_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements V } } - if (strpos($sql, ':') !== false || strpos($sql, '?') !== false) { - $before = count($bind); - $this->_bindParams = $bind; // Used by callback - $sql = preg_replace_callback('#(([\'"])((\\2)|((.*?[^\\\\])\\2)))#', - array($this, 'proccessBindCallback'), - $sql); - Varien_Exception::processPcreError(); - $bind = $this->_bindParams; - - // If _processBindCallbacks() has added named entries to positional bind - normalize it to positional - if (!$isNamedBind && $before && (count($bind) != $before)) { - $this->_convertMixedBind($sql, $bind); - } - } - // Special query hook if ($this->_queryHook) { $object = $this->_queryHook['object']; @@ -2002,23 +1992,10 @@ class Varien_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements V } $columns = array(); - $columnsDefinition = $table->getColumns(); foreach ($indexData['COLUMNS'] as $columnData) { - $columnCode = strtoupper($columnData['NAME']); $column = $this->quoteIdentifier($columnData['NAME']); if (!empty($columnData['SIZE'])) { $column .= sprintf('(%d)', $columnData['SIZE']); - } else if (isset($columnsDefinition[$columnCode]['DATA_TYPE']) - && in_array($columnsDefinition[$columnCode]['DATA_TYPE'], - array(Varien_Db_Ddl_Table::TYPE_BLOB, Varien_Db_Ddl_Table::TYPE_TEXT)) - ) { - if (!empty($columnsDefinition[$columnCode]['LENGTH']) - && is_numeric($columnsDefinition[$columnCode]['LENGTH']) - ) { - $column .= "({$columnsDefinition[$columnCode]['LENGTH']})"; - } else { - $column .= '(255)'; - } } $columns[] = $column; } @@ -2361,19 +2338,7 @@ class Varien_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements V $field, $tableName); throw new Zend_Db_Exception($msg); } - $prefix = ''; - $fieldUpperCase = strtoupper($field); - if (isset($columns[$fieldUpperCase]['DATA_TYPE']) - && in_array($columns[$fieldUpperCase]['DATA_TYPE'], - array(Varien_Db_Ddl_Table::TYPE_BLOB, Varien_Db_Ddl_Table::TYPE_TEXT)) - ) { - if (!empty($columns[$fieldUpperCase]['LENGTH']) && is_numeric($columns[$fieldUpperCase]['LENGTH'])) { - $prefix .= "({$columns[$fieldUpperCase]['LENGTH']})"; - } else { - $prefix .= '(255)'; - } - } - $fieldSql[] = $this->quoteIdentifier($field) . $prefix; + $fieldSql[] = $this->quoteIdentifier($field); } $fieldSql = implode(',', $fieldSql); @@ -2700,7 +2665,9 @@ class Varien_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements V $value = (int)$value; break; case 'bigint': - // Can't cast to int on 32 bit systems here: BIGINT is larger than such systems' MAX_INT + if (!is_integer($value)) { + $value = sprintf('%.0f', (float)$value); + } break; case 'decimal': @@ -2941,6 +2908,22 @@ class Varien_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements V return new Zend_Db_Expr(sprintf('DATE(%s)', $date)); } + /** + * Prepare substring sql function + * + * @param Zend_Db_Expr|string $stringExpression quoted field name or SQL statement + * @param int|string|Zend_Db_Expr $pos + * @param int|string|Zend_Db_Expr|null $len + * @return Zend_Db_Expr + */ + public function getSubstringSql($stringExpression, $pos, $len = null) + { + if (is_null($len)) { + return new Zend_Db_Expr(sprintf('SUBSTRING(%s, %s)', $stringExpression, $pos)); + } + return new Zend_Db_Expr(sprintf('SUBSTRING(%s, %s, %s)', $stringExpression, $pos, $len)); + } + /** * Extract part of a date * diff --git a/lib/Varien/Db/Ddl/Table.php b/lib/Varien/Db/Ddl/Table.php index 5de68c40cf9..1f179f049cb 100644 --- a/lib/Varien/Db/Ddl/Table.php +++ b/lib/Varien/Db/Ddl/Table.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Exception.php b/lib/Varien/Db/Exception.php index 771a3f04067..ba18848544e 100644 --- a/lib/Varien/Db/Exception.php +++ b/lib/Varien/Db/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Helper.php b/lib/Varien/Db/Helper.php index f356a539d08..72438fcaeaf 100644 --- a/lib/Varien/Db/Helper.php +++ b/lib/Varien/Db/Helper.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Select.php b/lib/Varien/Db/Select.php index 5f89ef28e96..3ee9b4d8bf7 100644 --- a/lib/Varien/Db/Select.php +++ b/lib/Varien/Db/Select.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Statement/Parameter.php b/lib/Varien/Db/Statement/Parameter.php index c1cb98160f0..60649613f6d 100644 --- a/lib/Varien/Db/Statement/Parameter.php +++ b/lib/Varien/Db/Statement/Parameter.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Statement/Pdo/Mysql.php b/lib/Varien/Db/Statement/Pdo/Mysql.php index 1bc05919c43..3b26fe4f7af 100644 --- a/lib/Varien/Db/Statement/Pdo/Mysql.php +++ b/lib/Varien/Db/Statement/Pdo/Mysql.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Statement/Sqlsrv.php b/lib/Varien/Db/Statement/Sqlsrv.php index b564bf9e233..3cdf0b06ed7 100644 --- a/lib/Varien/Db/Statement/Sqlsrv.php +++ b/lib/Varien/Db/Statement/Sqlsrv.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Tree.php b/lib/Varien/Db/Tree.php index 1485a529388..0535ea159b8 100644 --- a/lib/Varien/Db/Tree.php +++ b/lib/Varien/Db/Tree.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Tree/Exception.php b/lib/Varien/Db/Tree/Exception.php index 9b8a8fffecf..f92b3cc7cad 100644 --- a/lib/Varien/Db/Tree/Exception.php +++ b/lib/Varien/Db/Tree/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Tree/Node.php b/lib/Varien/Db/Tree/Node.php index c230bdb025c..44eb501d32b 100644 --- a/lib/Varien/Db/Tree/Node.php +++ b/lib/Varien/Db/Tree/Node.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Tree/Node/Exception.php b/lib/Varien/Db/Tree/Node/Exception.php index 69f7f02f215..ddb14ad09c1 100644 --- a/lib/Varien/Db/Tree/Node/Exception.php +++ b/lib/Varien/Db/Tree/Node/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Tree/NodeSet.php b/lib/Varien/Db/Tree/NodeSet.php index 621e7556c7c..96050c8dc1c 100644 --- a/lib/Varien/Db/Tree/NodeSet.php +++ b/lib/Varien/Db/Tree/NodeSet.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Tree/NodeSet/Exception.php b/lib/Varien/Db/Tree/NodeSet/Exception.php index 86dc4d91347..e53514af430 100644 --- a/lib/Varien/Db/Tree/NodeSet/Exception.php +++ b/lib/Varien/Db/Tree/NodeSet/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Debug.php b/lib/Varien/Debug.php index 8c4aaaeeed1..29e3ed1df74 100644 --- a/lib/Varien/Debug.php +++ b/lib/Varien/Debug.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Debug - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Directory/Collection.php b/lib/Varien/Directory/Collection.php index abff04334b6..b4a411e3f99 100644 --- a/lib/Varien/Directory/Collection.php +++ b/lib/Varien/Directory/Collection.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_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/lib/Varien/Directory/Factory.php b/lib/Varien/Directory/Factory.php index 6012d568010..9af51379ae7 100644 --- a/lib/Varien/Directory/Factory.php +++ b/lib/Varien/Directory/Factory.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_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/lib/Varien/Directory/IFactory.php b/lib/Varien/Directory/IFactory.php index 72e35480a0d..0d873c070f7 100644 --- a/lib/Varien/Directory/IFactory.php +++ b/lib/Varien/Directory/IFactory.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_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/lib/Varien/Event.php b/lib/Varien/Event.php index f03ca40105f..5dfea2c2fd3 100644 --- a/lib/Varien/Event.php +++ b/lib/Varien/Event.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Event - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Event/Collection.php b/lib/Varien/Event/Collection.php index 1d582be20f7..cfebaf7dd15 100644 --- a/lib/Varien/Event/Collection.php +++ b/lib/Varien/Event/Collection.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Event - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Event/Observer.php b/lib/Varien/Event/Observer.php index 35bec5266dc..a1b7c997e77 100644 --- a/lib/Varien/Event/Observer.php +++ b/lib/Varien/Event/Observer.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Event - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Event/Observer/Collection.php b/lib/Varien/Event/Observer/Collection.php index 6719eaad5f6..1ce82b14f98 100644 --- a/lib/Varien/Event/Observer/Collection.php +++ b/lib/Varien/Event/Observer/Collection.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Event - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Event/Observer/Cron.php b/lib/Varien/Event/Observer/Cron.php index 1909c3355d6..308e57e0a70 100644 --- a/lib/Varien/Event/Observer/Cron.php +++ b/lib/Varien/Event/Observer/Cron.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Event - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Event/Observer/Regex.php b/lib/Varien/Event/Observer/Regex.php index 124240452b7..7519f26dd73 100644 --- a/lib/Varien/Event/Observer/Regex.php +++ b/lib/Varien/Event/Observer/Regex.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Event - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Exception.php b/lib/Varien/Exception.php index 56a3d4bfb8e..b1907df44b5 100644 --- a/lib/Varien/Exception.php +++ b/lib/Varien/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Exception - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/File/Csv.php b/lib/Varien/File/Csv.php index c36e0d9b961..e46592c94dd 100644 --- a/lib/Varien/File/Csv.php +++ b/lib/Varien/File/Csv.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_File - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/File/CsvMulty.php b/lib/Varien/File/CsvMulty.php index fc22ea125db..2e3370b0ec1 100644 --- a/lib/Varien/File/CsvMulty.php +++ b/lib/Varien/File/CsvMulty.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_File - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/File/Object.php b/lib/Varien/File/Object.php index 6ee294ab599..26b58053b15 100644 --- a/lib/Varien/File/Object.php +++ b/lib/Varien/File/Object.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_File - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/File/Transfer/Adapter/Http.php b/lib/Varien/File/Transfer/Adapter/Http.php index 2bcd656114d..9022b598e6b 100644 --- a/lib/Varien/File/Transfer/Adapter/Http.php +++ b/lib/Varien/File/Transfer/Adapter/Http.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_File - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/File/Uploader.php b/lib/Varien/File/Uploader.php index 11fc486fd99..bbf34ce47be 100644 --- a/lib/Varien/File/Uploader.php +++ b/lib/Varien/File/Uploader.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_File - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Array.php b/lib/Varien/Filter/Array.php index d4f114b58ec..13fca5c691b 100644 --- a/lib/Varien/Filter/Array.php +++ b/lib/Varien/Filter/Array.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Array/Grid.php b/lib/Varien/Filter/Array/Grid.php index cfc95cca8c8..513e703eb46 100644 --- a/lib/Varien/Filter/Array/Grid.php +++ b/lib/Varien/Filter/Array/Grid.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Email.php b/lib/Varien/Filter/Email.php index 2fd999616a5..c47a320b44a 100644 --- a/lib/Varien/Filter/Email.php +++ b/lib/Varien/Filter/Email.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Money.php b/lib/Varien/Filter/Money.php index 0994e40e63a..35c23b6456e 100644 --- a/lib/Varien/Filter/Money.php +++ b/lib/Varien/Filter/Money.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Object.php b/lib/Varien/Filter/Object.php index 51b87071183..8f5227e720a 100644 --- a/lib/Varien/Filter/Object.php +++ b/lib/Varien/Filter/Object.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Object/Grid.php b/lib/Varien/Filter/Object/Grid.php index d917af5e83b..555e42b1b9c 100644 --- a/lib/Varien/Filter/Object/Grid.php +++ b/lib/Varien/Filter/Object/Grid.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Sprintf.php b/lib/Varien/Filter/Sprintf.php index cb72145d51c..da1ae3302ba 100644 --- a/lib/Varien/Filter/Sprintf.php +++ b/lib/Varien/Filter/Sprintf.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Template.php b/lib/Varien/Filter/Template.php index f23c8417708..06bd6f7f7d8 100644 --- a/lib/Varien/Filter/Template.php +++ b/lib/Varien/Filter/Template.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Template/Simple.php b/lib/Varien/Filter/Template/Simple.php index 60948150708..a8b32f4fe76 100644 --- a/lib/Varien/Filter/Template/Simple.php +++ b/lib/Varien/Filter/Template/Simple.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Template/Tokenizer/Abstract.php b/lib/Varien/Filter/Template/Tokenizer/Abstract.php index 275f8a204ba..841183df054 100644 --- a/lib/Varien/Filter/Template/Tokenizer/Abstract.php +++ b/lib/Varien/Filter/Template/Tokenizer/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Template/Tokenizer/Parameter.php b/lib/Varien/Filter/Template/Tokenizer/Parameter.php index 674fe1ed7ad..aad3c5cdd0d 100644 --- a/lib/Varien/Filter/Template/Tokenizer/Parameter.php +++ b/lib/Varien/Filter/Template/Tokenizer/Parameter.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Template/Tokenizer/Variable.php b/lib/Varien/Filter/Template/Tokenizer/Variable.php index e4ac002709d..7e99aa0f633 100644 --- a/lib/Varien/Filter/Template/Tokenizer/Variable.php +++ b/lib/Varien/Filter/Template/Tokenizer/Variable.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/Content.php b/lib/Varien/Gdata/Gshopping/Content.php index 95a63bf8ecf..8c0ad8164e3 100644 --- a/lib/Varien/Gdata/Gshopping/Content.php +++ b/lib/Varien/Gdata/Gshopping/Content.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/Entry.php b/lib/Varien/Gdata/Gshopping/Entry.php index c365b237586..f703c70ca28 100644 --- a/lib/Varien/Gdata/Gshopping/Entry.php +++ b/lib/Varien/Gdata/Gshopping/Entry.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/Extension/Attribute.php b/lib/Varien/Gdata/Gshopping/Extension/Attribute.php index 7730fd53ee3..745a0f409aa 100644 --- a/lib/Varien/Gdata/Gshopping/Extension/Attribute.php +++ b/lib/Varien/Gdata/Gshopping/Extension/Attribute.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/Extension/Control.php b/lib/Varien/Gdata/Gshopping/Extension/Control.php index b162ebd05cf..c46c1366855 100644 --- a/lib/Varien/Gdata/Gshopping/Extension/Control.php +++ b/lib/Varien/Gdata/Gshopping/Extension/Control.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/Extension/Shipping.php b/lib/Varien/Gdata/Gshopping/Extension/Shipping.php index 759ca8acb05..8c04271ce62 100644 --- a/lib/Varien/Gdata/Gshopping/Extension/Shipping.php +++ b/lib/Varien/Gdata/Gshopping/Extension/Shipping.php @@ -21,7 +21,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/Extension/Tax.php b/lib/Varien/Gdata/Gshopping/Extension/Tax.php index 1413355f716..d57ea1314a7 100644 --- a/lib/Varien/Gdata/Gshopping/Extension/Tax.php +++ b/lib/Varien/Gdata/Gshopping/Extension/Tax.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/HttpException.php b/lib/Varien/Gdata/Gshopping/HttpException.php index e8d312b871b..090737dabc8 100644 --- a/lib/Varien/Gdata/Gshopping/HttpException.php +++ b/lib/Varien/Gdata/Gshopping/HttpException.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/ItemQuery.php b/lib/Varien/Gdata/Gshopping/ItemQuery.php index 5eb66baedf5..0206900dc93 100644 --- a/lib/Varien/Gdata/Gshopping/ItemQuery.php +++ b/lib/Varien/Gdata/Gshopping/ItemQuery.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Http/Adapter/Curl.php b/lib/Varien/Http/Adapter/Curl.php index 9ff8641bf3b..f88a6143a88 100644 --- a/lib/Varien/Http/Adapter/Curl.php +++ b/lib/Varien/Http/Adapter/Curl.php @@ -20,15 +20,15 @@ * * @category Varien * @package Varien_Http - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * HTTP CURL Adapter * - * @category Varien - * @package Varien_Http + * @category Varien + * @package Varien_Http * @author Magento Core Team <core@magentocommerce.com> */ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface @@ -40,27 +40,37 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface */ protected $_config = array(); + /** + * Curl handle + * + * @var resource + */ protected $_resource; + /** + * Allow parameters + * + * @var array + */ + protected $_allowedParams = array('timeout' => CURLOPT_TIMEOUT, 'maxredirects' => CURLOPT_MAXREDIRS, + 'proxy' => CURLOPT_PROXY, 'ssl_cert' => CURLOPT_SSLCERT, 'userpwd' => CURLOPT_USERPWD); + /** * Apply current configuration array to transport resource + * + * @return Varien_Http_Adapter_Curl */ protected function _applyConfig() { - //curl_setopt(); - if (isset($this->_config['timeout'])) { - curl_setopt($this->_getResource(), CURLOPT_TIMEOUT, $this->_config['timeout']); - } - if (isset($this->_config['maxredirects'])) { - curl_setopt($this->_getResource(), CURLOPT_MAXREDIRS, $this->_config['maxredirects']); - } - if (isset($this->_config['proxy'])) { - curl_setopt ($this->_getResource(), CURLOPT_PROXY, $this->_config['proxy']); - } - if (isset($this->_config['ssl_cert'])) { - curl_setopt($this->_getResource(), CURLOPT_SSLCERT, $this->_config['ssl_cert']); + if (empty($this->_config)) { + return $this; } + foreach ($this->_config as $param => $curlOption) { + if (array_key_exists($param, $this->_allowedParams)) { + curl_setopt($this->_getResource(), $this->_allowedParams[$param], $this->_config[$param]); + } + } return $this; } @@ -68,6 +78,7 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface * Set the configuration array for the adapter * * @param array $config + * @return Varien_Http_Adapter_Curl */ public function setConfig($config = array()) { @@ -78,9 +89,11 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface /** * Connect to the remote server * + * @deprecated since 1.4.0.0-rc1 * @param string $host * @param int $port * @param boolean $secure + * @return Varien_Http_Adapter_Curl */ public function connect($host, $port = 80, $secure = false) { @@ -92,7 +105,7 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface curl_setopt($this->_getResource(), CURLOPT_MAXREDIRS, $this->_config['maxredirects']); } if (isset($this->_config['proxy'])) { - curl_setopt ($this->_getResource(), CURLOPT_PROXY, $this->_config['proxy']); + curl_setopt($this->_getResource(), CURLOPT_PROXY, $this->_config['proxy']); } return $this; @@ -126,14 +139,21 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true); } - if( is_array($headers) ) { + if (is_array($headers)) { curl_setopt($this->_getResource(), CURLOPT_HTTPHEADER, $headers); } - curl_setopt($this->_getResource(), CURLOPT_HEADER, true); - curl_setopt($this->_getResource(), CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt($this->_getResource(), CURLOPT_SSL_VERIFYHOST, 0); + /** + * @internal Curl options setter have to be re-factored + */ + $header = isset($this->_config['header']) ? $this->_config['header'] : true; + curl_setopt($this->_getResource(), CURLOPT_HEADER, $header); + + $verifyPeer = isset($this->_config['verifypeer']) ? $this->_config['verifypeer'] : 0; + curl_setopt($this->_getResource(), CURLOPT_SSL_VERIFYPEER, $verifyPeer); + $verifyHost = isset($this->_config['verifyhost']) ? $this->_config['verifyhost'] : 0; + curl_setopt($this->_getResource(), CURLOPT_SSL_VERIFYHOST, $verifyHost); return $body; } @@ -148,8 +168,7 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface $response = curl_exec($this->_getResource()); // Remove 100 and 101 responses headers - if (Zend_Http_Response::extractCode($response) == 100 || - Zend_Http_Response::extractCode($response) == 101) { + if (Zend_Http_Response::extractCode($response) == 100 || Zend_Http_Response::extractCode($response) == 101) { $response = preg_split('/^\r?$/m', $response, 2); $response = trim($response[1]); } @@ -160,6 +179,7 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface /** * Close the connection to the server * + * @return Varien_Http_Adapter_Curl */ public function close() { @@ -168,6 +188,11 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface return $this; } + /** + * Returns a cURL handle on success + * + * @return resource + */ protected function _getResource() { if (is_null($this->_resource)) { @@ -176,11 +201,21 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface return $this->_resource; } + /** + * Get last error number + * + * @return int + */ public function getErrno() { return curl_errno($this->_getResource()); } + /** + * Get string with last error for the current session + * + * @return string + */ public function getError() { return curl_error($this->_getResource()); @@ -234,4 +269,4 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface curl_multi_close($multihandle); return $result; } -} +} \ No newline at end of file diff --git a/lib/Varien/Http/Client.php b/lib/Varien/Http/Client.php index d13d1f2918b..d2a002bb3ff 100644 --- a/lib/Varien/Http/Client.php +++ b/lib/Varien/Http/Client.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Http - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Image.php b/lib/Varien/Image.php index d243fbadfbb..cddc6cc412a 100644 --- a/lib/Varien/Image.php +++ b/lib/Varien/Image.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Image - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Image/Adapter.php b/lib/Varien/Image/Adapter.php index c4269cd2c73..62a66e949e2 100644 --- a/lib/Varien/Image/Adapter.php +++ b/lib/Varien/Image/Adapter.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Image - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Image/Adapter/Abstract.php b/lib/Varien/Image/Adapter/Abstract.php index 43d203e1435..7361ea49d82 100644 --- a/lib/Varien/Image/Adapter/Abstract.php +++ b/lib/Varien/Image/Adapter/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Image - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Image/Adapter/Gd2.php b/lib/Varien/Image/Adapter/Gd2.php index 04f802eb1be..4ece20d0ce3 100644 --- a/lib/Varien/Image/Adapter/Gd2.php +++ b/lib/Varien/Image/Adapter/Gd2.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Image - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Io/Abstract.php b/lib/Varien/Io/Abstract.php index d639f695156..f6f72c231e7 100644 --- a/lib/Varien/Io/Abstract.php +++ b/lib/Varien/Io/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Io - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Io/Exception.php b/lib/Varien/Io/Exception.php index c8fa503be31..1d66d6b006d 100644 --- a/lib/Varien/Io/Exception.php +++ b/lib/Varien/Io/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Convert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Io/File.php b/lib/Varien/Io/File.php index fd362ea8d75..42f2e6317c8 100644 --- a/lib/Varien/Io/File.php +++ b/lib/Varien/Io/File.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Io - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Io/Ftp.php b/lib/Varien/Io/Ftp.php index f4e7424a06d..68797d76bf4 100644 --- a/lib/Varien/Io/Ftp.php +++ b/lib/Varien/Io/Ftp.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Io - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Io/Interface.php b/lib/Varien/Io/Interface.php index 5bde5ae1a3d..25b6c16bc3e 100644 --- a/lib/Varien/Io/Interface.php +++ b/lib/Varien/Io/Interface.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Io - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Io/Sftp.php b/lib/Varien/Io/Sftp.php index 981ba00cb01..814e31531b0 100644 --- a/lib/Varien/Io/Sftp.php +++ b/lib/Varien/Io/Sftp.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Io - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Object.php b/lib/Varien/Object.php index 60ad0f3ef33..400519ae6aa 100644 --- a/lib/Varien/Object.php +++ b/lib/Varien/Object.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Object - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Object/Cache.php b/lib/Varien/Object/Cache.php index 737badd2e57..10a0189fc11 100644 --- a/lib/Varien/Object/Cache.php +++ b/lib/Varien/Object/Cache.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Object - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Object/Mapper.php b/lib/Varien/Object/Mapper.php index 0ef84b62210..6895d2575c4 100644 --- a/lib/Varien/Object/Mapper.php +++ b/lib/Varien/Object/Mapper.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Object - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Pear.php b/lib/Varien/Pear.php index 0d445ffafe4..93220368576 100644 --- a/lib/Varien/Pear.php +++ b/lib/Varien/Pear.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Pear - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Pear/Frontend.php b/lib/Varien/Pear/Frontend.php index 106ad3eaee2..56011af0cc1 100644 --- a/lib/Varien/Pear/Frontend.php +++ b/lib/Varien/Pear/Frontend.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Pear - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Pear/Package.php b/lib/Varien/Pear/Package.php index 81d606b0de4..a24c4d0e598 100644 --- a/lib/Varien/Pear/Package.php +++ b/lib/Varien/Pear/Package.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Pear - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Pear/Registry.php b/lib/Varien/Pear/Registry.php index c7f57a091c6..9fc5423a812 100644 --- a/lib/Varien/Pear/Registry.php +++ b/lib/Varien/Pear/Registry.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Pear - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Simplexml/Config.php b/lib/Varien/Simplexml/Config.php index d8afe008f61..1e67925df12 100644 --- a/lib/Varien/Simplexml/Config.php +++ b/lib/Varien/Simplexml/Config.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Simplexml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Simplexml/Config/Cache/Abstract.php b/lib/Varien/Simplexml/Config/Cache/Abstract.php index 39fbdf2724f..5c330e6cb7c 100644 --- a/lib/Varien/Simplexml/Config/Cache/Abstract.php +++ b/lib/Varien/Simplexml/Config/Cache/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Simplexml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Simplexml/Config/Cache/File.php b/lib/Varien/Simplexml/Config/Cache/File.php index 5bd9c2f0d62..04e55a99d1e 100644 --- a/lib/Varien/Simplexml/Config/Cache/File.php +++ b/lib/Varien/Simplexml/Config/Cache/File.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Simplexml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Simplexml/Element.php b/lib/Varien/Simplexml/Element.php index 29bd1ab4daf..6907bfaa197 100644 --- a/lib/Varien/Simplexml/Element.php +++ b/lib/Varien/Simplexml/Element.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Simplexml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Zend/Captcha/Word.php b/lib/Zend/Captcha/Word.php index a9bbbea753f..6170b06da9c 100644 --- a/lib/Zend/Captcha/Word.php +++ b/lib/Zend/Captcha/Word.php @@ -93,10 +93,10 @@ abstract class Zend_Captcha_Word extends Zend_Captcha_Base * @var integer */ protected $_timeout = 300; - + /** * Should generate() keep session or create a new one? - * + * * @var boolean */ protected $_keepSession = false; @@ -219,11 +219,11 @@ abstract class Zend_Captcha_Word extends Zend_Captcha_Base /** * Sets if session should be preserved on generate() - * + * * @param $keepSession Should session be kept on generate()? * @return Zend_Captcha_Word */ - public function setKeepSession($keepSession) + public function setKeepSession($keepSession) { $this->_keepSession = $keepSession; return $this; @@ -231,7 +231,7 @@ abstract class Zend_Captcha_Word extends Zend_Captcha_Base /** * Numbers should be included in the pattern? - * + * * @return bool */ public function getUseNumbers() @@ -241,7 +241,7 @@ abstract class Zend_Captcha_Word extends Zend_Captcha_Base /** * Set if numbers should be included in the pattern - * + * * @param $_useNumbers numbers should be included in the pattern? * @return Zend_Captcha_Word */ @@ -250,7 +250,7 @@ abstract class Zend_Captcha_Word extends Zend_Captcha_Base $this->_useNumbers = $_useNumbers; return $this; } - + /** * Get session object * @@ -348,7 +348,7 @@ abstract class Zend_Captcha_Word extends Zend_Captcha_Base public function generate() { if(!$this->_keepSession) { - $this->_session = null; + $this->_session = null; } $id = $this->_generateRandomId(); $this->_setId($id); diff --git a/lib/flex/uploader/uploader.mxml b/lib/flex/uploader/uploader.mxml index badde73cf8c..cfe2fd34e98 100644 --- a/lib/flex/uploader/uploader.mxml +++ b/lib/flex/uploader/uploader.mxml @@ -19,7 +19,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/lib/flex/uploader/uploaderSingle.mxml b/lib/flex/uploader/uploaderSingle.mxml index 6c0dd0d99c3..486af44765b 100644 --- a/lib/flex/uploader/uploaderSingle.mxml +++ b/lib/flex/uploader/uploaderSingle.mxml @@ -19,7 +19,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/lib/flex/varien/varien/upload/Uploader.as b/lib/flex/varien/varien/upload/Uploader.as index e9d70b4b6f8..ef22bd8d7c1 100644 --- a/lib/flex/varien/varien/upload/Uploader.as +++ b/lib/flex/varien/varien/upload/Uploader.as @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ package varien.upload diff --git a/lib/flex/varien/varien/upload/UploaderEvent.as b/lib/flex/varien/varien/upload/UploaderEvent.as index 1fdf0a1a32d..7e5184bbe7f 100644 --- a/lib/flex/varien/varien/upload/UploaderEvent.as +++ b/lib/flex/varien/varien/upload/UploaderEvent.as @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ package varien.upload diff --git a/lib/flex/varien/varien/upload/UploaderSingle.as b/lib/flex/varien/varien/upload/UploaderSingle.as index 70eeadaa615..4b6dd831e65 100644 --- a/lib/flex/varien/varien/upload/UploaderSingle.as +++ b/lib/flex/varien/varien/upload/UploaderSingle.as @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ package varien.upload diff --git a/pub/cron.php b/pub/cron.php index a432c58833f..2838df7c434 100644 --- a/pub/cron.php +++ b/pub/cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/pub/errors/404.php b/pub/errors/404.php index 31b9da1e807..7f334436603 100644 --- a/pub/errors/404.php +++ b/pub/errors/404.php @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/pub/errors/503.php b/pub/errors/503.php index bd85f185df3..3222f011d7c 100644 --- a/pub/errors/503.php +++ b/pub/errors/503.php @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/pub/errors/default/404.phtml b/pub/errors/default/404.phtml index 21818565229..ae28970a2ee 100644 --- a/pub/errors/default/404.phtml +++ b/pub/errors/default/404.phtml @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/pub/errors/default/503.phtml b/pub/errors/default/503.phtml index 379a7ea813a..4088fa4ddd5 100644 --- a/pub/errors/default/503.phtml +++ b/pub/errors/default/503.phtml @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/pub/errors/default/css/styles.css b/pub/errors/default/css/styles.css index 01641c3c0f4..052af92d74b 100644 --- a/pub/errors/default/css/styles.css +++ b/pub/errors/default/css/styles.css @@ -19,7 +19,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 ================================================================================= */ diff --git a/pub/errors/default/page.phtml b/pub/errors/default/page.phtml index 40f41fd8005..01bd06ba1a5 100644 --- a/pub/errors/default/page.phtml +++ b/pub/errors/default/page.phtml @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/pub/errors/default/report.phtml b/pub/errors/default/report.phtml index 841ec3333f3..dac1dcd48dc 100644 --- a/pub/errors/default/report.phtml +++ b/pub/errors/default/report.phtml @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/pub/errors/design.xml b/pub/errors/design.xml index cbe33232081..af38e26c757 100644 --- a/pub/errors/design.xml +++ b/pub/errors/design.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/pub/errors/local.xml.sample b/pub/errors/local.xml.sample index 232cfc93d66..253bee51727 100644 --- a/pub/errors/local.xml.sample +++ b/pub/errors/local.xml.sample @@ -21,7 +21,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/pub/errors/processor.php b/pub/errors/processor.php index f302052ca7e..3a6cabd5d29 100644 --- a/pub/errors/processor.php +++ b/pub/errors/processor.php @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/pub/errors/report.php b/pub/errors/report.php index eaff181a90d..7ed9dd9788f 100644 --- a/pub/errors/report.php +++ b/pub/errors/report.php @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/pub/get.php b/pub/get.php index 8cf6b18ed72..7e04fc25a85 100644 --- a/pub/get.php +++ b/pub/get.php @@ -21,7 +21,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ require_once '../app/bootstrap.php'; diff --git a/pub/index.php b/pub/index.php index 4de3ac880b1..417ade6b700 100644 --- a/pub/index.php +++ b/pub/index.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/pub/js/jquery/jquery-1.7.1.min.js b/pub/js/jquery/jquery-1.7.1.min.js new file mode 100644 index 00000000000..198b3ff07d8 --- /dev/null +++ b/pub/js/jquery/jquery-1.7.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test("Â ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.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|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/pub/js/jquery/jquery-no-conflict.js b/pub/js/jquery/jquery-no-conflict.js new file mode 100644 index 00000000000..f0bcbcfc918 --- /dev/null +++ b/pub/js/jquery/jquery-no-conflict.js @@ -0,0 +1,26 @@ +/** + * 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 jquery + * @package js + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +jQuery.noConflict(); diff --git a/pub/js/lib/dropdown.js b/pub/js/lib/dropdown.js index a7d79cceda6..acedb6d84cc 100644 --- a/pub/js/lib/dropdown.js +++ b/pub/js/lib/dropdown.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ dropdown = function() { diff --git a/pub/js/lib/flex.js b/pub/js/lib/flex.js index 4ba34b6f916..4317e27759c 100644 --- a/pub/js/lib/flex.js +++ b/pub/js/lib/flex.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/accordion.js b/pub/js/mage/adminhtml/accordion.js index b6604677710..dbc456691bd 100644 --- a/pub/js/mage/adminhtml/accordion.js +++ b/pub/js/mage/adminhtml/accordion.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 varienAccordion = new Class.create(); diff --git a/pub/js/mage/adminhtml/backup.js b/pub/js/mage/adminhtml/backup.js new file mode 100644 index 00000000000..0b28a2ab0ba --- /dev/null +++ b/pub/js/mage/adminhtml/backup.js @@ -0,0 +1,189 @@ +/** + * 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_Adminhtml + * @copyright 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 AdminBackup = new Class.create(); +AdminBackup.prototype = { + initialize : function(a, b){ + this.reset(); + this.rollbackUrl = this.backupUrl = ''; + this.rollbackValidator = new Validation($('rollback-form')); + this.backupValidator = new Validation($('backup-form')); + }, + + reset: function() { + this.time = 0; + this.type = ''; + $('use-ftp-checkbox-row').hide(); + $('use_ftp').checked = false; + $('ftp-credentials-container').hide(); + $('backup_maintenance_mode').checked = false; + $('rollback_maintenance_mode').checked = false; + $('exclude_media').checked = false; + $('password').value = ''; + $('backup_name').value = ''; + $$('.validation-advice').invoke('remove'); + $$('input').invoke('removeClassName', 'validation-failed'); + $$('input').invoke('removeClassName', 'validation-passed'); + $$('.backup-messages').invoke('hide'); + $$('#ftp-credentials-container input').each(function(item) { + item.value = ''; + }); + }, + + backup: function(type) { + this.reset(); + this.type = type; + this.showBackupWarning(); + return false; + }, + + rollback: function(type, time) { + this.reset(); + this.time = time; + this.type = type; + this.showRollbackWarning(); + return false; + }, + + showBackupWarning: function() { + this.showPopup('backup-warning'); + }, + + showRollbackWarning: function() { + this.showPopup('rollback-warning'); + }, + + requestBackupOptions: function() { + this.hidePopups(); + var action = this.type != 'snapshot' ? 'hide' : 'show'; + $$('#exclude-media-checkbox-container').invoke(action); + this.showPopup('backup-options'); + }, + + requestPassword: function() { + this.hidePopups(); + this.type != 'db' ? $('use-ftp-checkbox-row').show() : $('use-ftp-checkbox-row').hide(); + this.showPopup('rollback-request-password'); + }, + + toggleFtpCredentialsForm: function() { + $('use_ftp').checked ? $('ftp-credentials-container').show() + : $('ftp-credentials-container').hide(); + var divId = 'rollback-request-password'; + + $$('#ftp-credentials-container input').each(function(item) { + if (item.name == 'ftp_path') return; + $('use_ftp').checked ? item.addClassName('required-entry') : item.removeClassName('required-entry'); + }); + + $(divId).show().setStyle({ + 'marginTop': -$(divId).getDimensions().height / 2 + 'px' + }); + }, + + submitBackup: function () { + if (!!this.backupValidator && this.backupValidator.validate()) { + this.hidePopups(); + var data = { + 'type': this.type, + 'maintenance_mode': $('backup_maintenance_mode').checked ? 1 : 0, + 'backup_name': $('backup_name').value, + 'exclude_media': $('exclude_media').checked ? 1 : 0 + }; + + new Ajax.Request(this.backupUrl, { + onSuccess: function(transport) { + this.processResponse(transport, 'backup-options'); + }.bind(this), + method: 'post', + parameters: data + }); + } + return false; + }, + + submitRollback: function() { + if (!!this.rollbackValidator && this.rollbackValidator.validate()) { + var data = this.getPostData(); + this.hidePopups(); + new Ajax.Request(this.rollbackUrl, { + onSuccess: function(transport) { + this.processResponse(transport, 'rollback-request-password'); + }.bind(this), + method: 'post', + parameters: data + }); + } + return false; + }, + + processResponse: function(transport, popupId) { + if (!transport.responseText.isJSON()) { + return; + } + + var json = transport.responseText.evalJSON(); + + if (!!json.error) { + this.displayError(popupId, json.error); + this.showPopup(popupId); + return; + } + + if (!!json.redirect_url) { + setLocation(json.redirect_url); + } + }, + + displayError: function(parentContainer, message) { + var messageHtml = this.getErrorMessageHtml(message); + $$('#' + parentContainer + ' .backup-messages .messages').invoke('update', messageHtml); + $$('#' + parentContainer + ' .backup-messages').invoke('show'); + }, + + getErrorMessageHtml: function(message) { + return '<li class="error-msg"><ul><li><span>' + message + '</span></li></ul></li>'; + }, + + getPostData: function() { + var data = $('rollback-form').serialize(true); + data['time'] = this.time; + data['type'] = this.type; + return data; + }, + + showPopup: function(divId) { + $(divId).show().setStyle({ + 'marginTop': -$(divId).getDimensions().height / 2 + 'px' + }); + $('popup-window-mask').setStyle({ + height: $('html-body').getHeight() + 'px' + }).show(); + }, + + hidePopups: function() { + $$('.backup-dialog').each(Element.hide); + $('popup-window-mask').hide(); + } +} diff --git a/pub/js/mage/adminhtml/browser.js b/pub/js/mage/adminhtml/browser.js index 75bcb5589d2..66a841c3415 100644 --- a/pub/js/mage/adminhtml/browser.js +++ b/pub/js/mage/adminhtml/browser.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ MediabrowserUtility = { diff --git a/pub/js/mage/adminhtml/events.js b/pub/js/mage/adminhtml/events.js index 3c60a7083ae..0908b0db409 100644 --- a/pub/js/mage/adminhtml/events.js +++ b/pub/js/mage/adminhtml/events.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ // from http://www.someelement.com/2007/03/eventpublisher-custom-events-la-pubsub.html diff --git a/pub/js/mage/adminhtml/fix-extjs-defer-before.js b/pub/js/mage/adminhtml/fix-extjs-defer-before.js new file mode 100644 index 00000000000..50aa3d0ebaa --- /dev/null +++ b/pub/js/mage/adminhtml/fix-extjs-defer-before.js @@ -0,0 +1,42 @@ +/** + * 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 js + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/*@cc_on +// code only for IE7 when ExtJs overwrite "defer" function in PrototypeJs +(function(){ + var last = null; + var ie7 = @if(@_jscript_version==5.7) 1 @end + 0; + if (ie7) { + var eDefer = Function.prototype.defer; + Function.prototype.defer = function() { + // prevent throw stack overflow exception + if (last !== this) { + last = this; + eDefer.apply(last, arguments); + } + return this; + }; + } +})(); +@*/ diff --git a/pub/js/mage/adminhtml/fix-extjs-defer.js b/pub/js/mage/adminhtml/fix-extjs-defer.js index e0cacf19a4f..13b95075709 100644 --- a/pub/js/mage/adminhtml/fix-extjs-defer.js +++ b/pub/js/mage/adminhtml/fix-extjs-defer.js @@ -15,12 +15,12 @@ * * 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. + * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage * @package js - * @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) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ (function(){ @@ -32,6 +32,6 @@ return this.delay.curry(0.01).apply(this, arguments); } - return eDefer.apply(this, args); + return eDefer.apply(this, arguments); } })(); \ No newline at end of file diff --git a/pub/js/mage/adminhtml/flexuploader.js b/pub/js/mage/adminhtml/flexuploader.js index ba4c5ee1783..ab1647d78e7 100644 --- a/pub/js/mage/adminhtml/flexuploader.js +++ b/pub/js/mage/adminhtml/flexuploader.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/form.js b/pub/js/mage/adminhtml/form.js index 36ecd49cd35..4b5a657ad09 100644 --- a/pub/js/mage/adminhtml/form.js +++ b/pub/js/mage/adminhtml/form.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 varienForm = new Class.create(); @@ -231,7 +231,8 @@ RegionUpdater.prototype = { option = document.createElement('OPTION'); option.value = regionId; - option.text = region.name; + option.text = region.name.stripTags(); + option.title = region.name; if (this.regionSelectEl.options.add) { this.regionSelectEl.options.add(option); @@ -387,7 +388,6 @@ SelectUpdater.prototype = { /** * Observer that watches for dependent form elements * If an element depends on 1 or more of other elements, it should show up only when all of them gain specified values - * TODO: implement multiple values per "master" elements */ FormElementDependenceController = Class.create(); FormElementDependenceController.prototype = { @@ -396,6 +396,7 @@ FormElementDependenceController.prototype = { * 'id_of_dependent_element' : { * 'id_of_master_element_1' : 'reference_value', * 'id_of_master_element_2' : 'reference_value' + * 'id_of_master_element_3' : ['reference_value1', 'reference_value2'] * ... * } * } @@ -441,8 +442,14 @@ FormElementDependenceController.prototype = { var shouldShowUp = true; for (var idFrom in valuesFrom) { var from = $(idFrom); - if (!from || from.value != valuesFrom[idFrom]) { - shouldShowUp = false; + if (valuesFrom[idFrom] instanceof Array) { + if (!from || valuesFrom[idFrom].indexOf(from.value) == -1) { + shouldShowUp = false; + } + } else { + if (!from || from.value != valuesFrom[idFrom]) { + shouldShowUp = false; + } } } diff --git a/pub/js/mage/adminhtml/grid.js b/pub/js/mage/adminhtml/grid.js index 343983f8875..36cbd7932e8 100644 --- a/pub/js/mage/adminhtml/grid.js +++ b/pub/js/mage/adminhtml/grid.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 varienGrid = new Class.create(); @@ -240,20 +240,27 @@ varienGrid.prototype = { _processFailure : function(transport){ location.href = BASE_URL; }, - addVarToUrl : function(varName, varValue){ + _addVarToUrl : function(url, varName, varValue){ var re = new RegExp('\/('+varName+'\/.*?\/)'); - var parts = this.url.split(new RegExp('\\?')); - this.url = parts[0].replace(re, '/'); - this.url+= varName+'/'+varValue+'/'; + var parts = url.split(new RegExp('\\?')); + url = parts[0].replace(re, '/'); + url+= varName+'/'+varValue+'/'; if(parts.size()>1) { - this.url+= '?' + parts[1]; + url+= '?' + parts[1]; } - //this.url = this.url.replace(/([^:])\/{2,}/g, '$1/'); + return url; + }, + addVarToUrl : function(varName, varValue){ + this.url = this._addVarToUrl(this.url, varName, varValue); return this.url; }, doExport : function(){ if($(this.containerId+'_export')){ - location.href = $(this.containerId+'_export').value; + var exportUrl = $(this.containerId+'_export').value; + if(this.massaction && this.massaction.checkedString) { + exportUrl = this._addVarToUrl(exportUrl, this.massaction.formFieldNameInternal, this.massaction.checkedString); + } + location.href = exportUrl; } }, bindFilterFields : function(){ @@ -353,6 +360,7 @@ varienGridMassaction.prototype = { this.useAjax = false; this.grid = grid; + this.grid.massaction = this; this.containerId = containerId; this.initMassactionElements(); diff --git a/pub/js/mage/adminhtml/image.js b/pub/js/mage/adminhtml/image.js index c3ac5016910..ed9bda38a1b 100644 --- a/pub/js/mage/adminhtml/image.js +++ b/pub/js/mage/adminhtml/image.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/loader.js b/pub/js/mage/adminhtml/loader.js index 77306878aa4..9291bf09323 100644 --- a/pub/js/mage/adminhtml/loader.js +++ b/pub/js/mage/adminhtml/loader.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/tabs.js b/pub/js/mage/adminhtml/tabs.js index 4aafd1f1b30..702953b2e1b 100644 --- a/pub/js/mage/adminhtml/tabs.js +++ b/pub/js/mage/adminhtml/tabs.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 varienTabs = new Class.create(); diff --git a/pub/js/mage/adminhtml/tools.js b/pub/js/mage/adminhtml/tools.js index cf3d3975e97..89478f8a148 100644 --- a/pub/js/mage/adminhtml/tools.js +++ b/pub/js/mage/adminhtml/tools.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ function setLocation(url){ diff --git a/pub/js/mage/adminhtml/uploader.js b/pub/js/mage/adminhtml/uploader.js index 913d3ab1d72..b68b178ecb2 100644 --- a/pub/js/mage/adminhtml/uploader.js +++ b/pub/js/mage/adminhtml/uploader.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js index 60f8971a237..4ad98c88ec5 100644 --- a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js +++ b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js index 7519bd879ce..7154fcfcdec 100644 --- a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js +++ b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ tinyMCE.addI18n({en:{ diff --git a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js index e4500d84fc7..7e4a5621da7 100644 --- a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js +++ b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css index 08b0098a15f..1728f5b5399 100644 --- a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css +++ b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css index cf23ae03988..8fb1c3a8468 100644 --- a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css +++ b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/wysiwyg/widget.js b/pub/js/mage/adminhtml/wysiwyg/widget.js index 510a7b469b7..286acb6e4bd 100644 --- a/pub/js/mage/adminhtml/wysiwyg/widget.js +++ b/pub/js/mage/adminhtml/wysiwyg/widget.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 @@ var widgetTools = { closable:true, className:'magento', windowClassName:"popup-window", - title:'Insert Widget', + title:Translator.translate('Insert Widget...'), top:50, width:950, //height:450, @@ -88,7 +88,9 @@ WysiwygWidget.Widget.prototype = { this.optionsUrl = optionsSourceUrl; this.optionValues = new Hash({}); this.widgetTargetId = widgetTargetId; - this.bMark = tinyMCE.activeEditor.selection.getBookmark(); + if (typeof(tinyMCE) != "undefined" && tinyMCE.activeEditor) { + this.bMark = tinyMCE.activeEditor.selection.getBookmark(); + } Event.observe(this.widgetEl, "change", this.loadOptions.bind(this)); @@ -233,8 +235,12 @@ WysiwygWidget.Widget.prototype = { widgetTools.onAjaxSuccess(transport); Windows.close("widget_window"); - tinyMCE.activeEditor.focus(); - tinyMCE.activeEditor.selection.moveToBookmark(this.bMark); + if (typeof(tinyMCE) != "undefined" && tinyMCE.activeEditor) { + tinyMCE.activeEditor.focus(); + if (this.bMark) { + tinyMCE.activeEditor.selection.moveToBookmark(this.bMark); + } + } this.updateContent(transport.responseText); } catch(e) { diff --git a/pub/js/mage/captcha.js b/pub/js/mage/captcha.js new file mode 100644 index 00000000000..7d90c3117e6 --- /dev/null +++ b/pub/js/mage/captcha.js @@ -0,0 +1,87 @@ +/** + * 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 js + * @copyright 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 Captcha = Class.create(); +Captcha.prototype = { + initialize: function(url, formId){ + this.url = url; + this.formId = formId; + }, + refresh: function(elem) { + formId = this.formId; + if (elem) Element.addClassName(elem, 'refreshing'); + new Ajax.Request(this.url, { + onSuccess: function (response) { + if (response.responseText.isJSON()) { + var json = response.responseText.evalJSON(); + if (!json.error && json.imgSrc) { + $(formId).writeAttribute('src', json.imgSrc); + if (elem) Element.removeClassName(elem, 'refreshing'); + } else { + if (elem) Element.removeClassName(elem, 'refreshing'); + } + } + }, + method: 'post', + parameters: { + 'formId' : this.formId + } + }); + } +}; + +document.observe('billing-request:completed', function(event){ + if (window.checkout !== undefined){ + if (window.checkout.method == 'guest' && $('guest_checkout')){ + window.captcha_guest_checkout.refresh() + } + if (window.checkout !== undefined && window.checkout.method== 'register' && $('register_during_checkout')){ + window.captcha_register_during_checkout.refresh() + } + } +}); + + +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(); + + } + 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(); + + } + break; + } +}); diff --git a/pub/js/mage/directpost.js b/pub/js/mage/directpost.js index 4c521b8eb8f..e62fee2973b 100644 --- a/pub/js/mage/directpost.js +++ b/pub/js/mage/directpost.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright 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 directPost = Class.create(); diff --git a/pub/js/mage/translate.js b/pub/js/mage/translate.js index 78b29263a03..6bf101e96d5 100644 --- a/pub/js/mage/translate.js +++ b/pub/js/mage/translate.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/translate_inline.css b/pub/js/mage/translate_inline.css index 9d1f035f7ef..dbd742b2d48 100644 --- a/pub/js/mage/translate_inline.css +++ b/pub/js/mage/translate_inline.css @@ -19,11 +19,13 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -.translate-inline { /* background:black; font-weight:bold; color:red; */ border:dotted 1px red;} +.translate-inline { /* background:black; font-weight:bold; color:red; */ outline: dotted 1px red!important;} +* html .translate-inline, +*+html .translate-inline{ border: dotted 1px red !important;} .translate-inline-script, .translate-inline-title { background:yellow; color:black; font-weight:bold; } #translate-inline-trig { position:absolute;left:-1000px; opacity:.8; filter:alpha(opacity=80); cursor:pointer; margin-top:10px; z-index:1000;} diff --git a/pub/js/mage/translate_inline.js b/pub/js/mage/translate_inline.js index bd64cb61ed8..c78c6255731 100644 --- a/pub/js/mage/translate_inline.js +++ b/pub/js/mage/translate_inline.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -59,16 +59,18 @@ TranslateInline.prototype = { $$('*[translate]').each(this.initializeElement.bind(this)); }, - trigShow: function (el) { - this.trigHideClear(); + trigShow: function (el, event) { + if (this.trigContentEl != el) { + this.trigHideClear(); + this.trigContentEl = el; - var p = Element.cumulativeOffset(el); + var p = Element.cumulativeOffset(el); - this.trigEl.style.left = p[0]+'px'; - this.trigEl.style.top = p[1]+'px'; - this.trigEl.style.display = 'block'; - - this.trigContentEl = el; + this.trigEl.style.left = p[0]+'px'; + this.trigEl.style.top = p[1]+'px'; + this.trigEl.style.display = 'block'; + Event.stop(event); + }; }, trigHide: function() { diff --git a/pub/js/prototype/prototype.js b/pub/js/prototype/prototype.js index 0f36ae57767..474b2231bbd 100644 --- a/pub/js/prototype/prototype.js +++ b/pub/js/prototype/prototype.js @@ -5830,7 +5830,7 @@ Form.EventObserver = Class.create(Abstract.EventObserver, { function pollDoScroll() { try { document.documentElement.doScroll('left'); } catch(e) { - timer = this.defer(); + timer = pollDoScroll.defer(); return; } fireContentLoadedEvent(); diff --git a/pub/js/prototype/validation.js b/pub/js/prototype/validation.js index 8765876f7aa..92dd31ff054 100644 --- a/pub/js/prototype/validation.js +++ b/pub/js/prototype/validation.js @@ -408,7 +408,7 @@ Object.extend(Validation, { }); Validation.add('IsEmpty', '', function(v) { - return (v == '' || (v == null) || (v.length == 0) || /^\s+$/.test(v)); // || /^\s+$/.test(v)); + return (v == '' || (v == null) || (v.length == 0) || /^\s+$/.test(v)); }); Validation.addAllThese([ @@ -421,8 +421,33 @@ Validation.addAllThese([ ['required-entry', 'This is a required field.', function(v) { return !Validation.get('IsEmpty').test(v); }], - ['validate-number', 'Please enter a valid number in this field.', function(v) { - return Validation.get('IsEmpty').test(v) || (!isNaN(parseNumber(v)) && !/^\s+$/.test(parseNumber(v))); + ['validate-number', 'Please enter a valid number in this field.', function(v, elm) { + if (elm.hasClassName('required-entry') && !Validation.get('required-entry').test(v)) { + return true; // hardcode, should be achieved by CSS classes ordering + } + + return !Validation.get('IsEmpty').test(v) + && !isNaN(parseNumber(v)) && /^\s*-?\d*([.,]\d*)?\s*$/.test(v); + }], + ['validate-number-range', 'The value is not within the specified range.', function(v, elm) { + var numValue = parseNumber(v); + if (Validation.get('IsEmpty').test(v) || isNaN(numValue)) { + return false; + } + + var reRange = /^number-range-([-\d.,]+)-([-\d.,]+)$/, + result = true; + + $w(elm.className).each(function(name) { + var m = reRange.exec(name), min, max; + if (m) { + min = parseNumber(m[1]); + max = parseNumber(m[2]); + result = result && numValue >= min && numValue <= max; + } + }); + + return result; }], ['validate-digits', 'Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.', function(v) { return Validation.get('IsEmpty').test(v) || !/[^\d]/.test(v); @@ -449,6 +474,9 @@ Validation.addAllThese([ ['validate-alphanum', 'Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.', function(v) { return Validation.get('IsEmpty').test(v) || /^[a-zA-Z0-9]+$/.test(v) /*!/\W/.test(v)*/ }], + ['validate-alphanum-with-spaces', 'Please use only letters (a-z or A-Z), numbers (0-9) or spaces only in this field.', function(v) { + return Validation.get('IsEmpty').test(v) || /^[a-zA-Z0-9 ]+$/.test(v) /*!/\W/.test(v)*/ + }], ['validate-street', 'Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.', function(v) { return Validation.get('IsEmpty').test(v) || /^[ \w]{3,}([A-Za-z]\.)?([ \w]*\#\d+)?(\r\n| )[ \w]{3,}/.test(v) }], @@ -571,14 +599,17 @@ Validation.addAllThese([ return false; } }], - ['validate-not-negative-number', 'Please enter a valid number in this field.', function(v) { + ['validate-not-negative-number', 'Please enter a valid number in this field.', function(v, elm) { + if (elm.hasClassName('required-entry') && !Validation.get('required-entry').test(v)) { + return true; // hardcode, should be achieved by CSS classes ordering + } + v = parseNumber(v); - return (!isNaN(v) && v>=0); + return !isNaN(v) && v>=0; }], ['validate-state', 'Please select State/Province.', function(v) { return (v!=0 || v == ''); }], - ['validate-new-password', 'Please enter 6 or more characters. Leading or trailing spaces will be ignored.', function(v) { if (!Validation.get('validate-password').test(v)) return false; if (Validation.get('IsEmpty').test(v) && v != '') return false; @@ -586,13 +617,13 @@ Validation.addAllThese([ }], ['validate-greater-than-zero', 'Please enter a number greater than 0 in this field.', function(v) { if(v.length) - return parseFloat(v) > 0; + return parseNumber(v) > 0; else return true; }], ['validate-zero-or-greater', 'Please enter a number 0 or greater in this field.', function(v) { if(v.length) - return parseFloat(v) >= 0; + return parseNumber(v) >= 0; else return true; }], diff --git a/pub/js/varien/configurable.js b/pub/js/varien/configurable.js index b0851b09d04..68baf730bae 100644 --- a/pub/js/varien/configurable.js +++ b/pub/js/varien/configurable.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ if (typeof Product == 'undefined') { diff --git a/pub/js/varien/form.js b/pub/js/varien/form.js index 6934c9252a9..be90e86bf88 100644 --- a/pub/js/varien/form.js +++ b/pub/js/varien/form.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ VarienForm = Class.create(); @@ -199,7 +199,8 @@ RegionUpdater.prototype = { option = document.createElement('OPTION'); option.value = regionId; - option.text = region.name; + option.text = region.name.stripTags(); + option.title = region.name; if (this.regionSelectEl.options.add) { this.regionSelectEl.options.add(option); diff --git a/pub/js/varien/js.js b/pub/js/varien/js.js index 4ef1f772ce0..a6b67f6c5ee 100644 --- a/pub/js/varien/js.js +++ b/pub/js/varien/js.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ function popWin(url,win,para) { @@ -654,17 +654,16 @@ if (!("console" in window) || !("firebug" in console)) * * @example fireEvent($('my-input', 'click')); */ -function fireEvent(element, event){ - if (document.createEventObject){ - // dispatch for IE - var evt = document.createEventObject(); - return element.fireEvent('on'+event,evt) - } - else{ - // dispatch for firefox + others +function fireEvent(element, event) { + if (document.createEvent) { + // dispatch for all browsers except IE before version 9 var evt = document.createEvent("HTMLEvents"); - evt.initEvent(event, true, true ); // event type,bubbling,cancelable - return !element.dispatchEvent(evt); + evt.initEvent(event, true, true ); // event type, bubbling, cancelable + return element.dispatchEvent(evt); + } else { + // dispatch for IE before version 9 + var evt = document.createEventObject(); + return element.fireEvent('on' + event, evt) } } @@ -681,4 +680,4 @@ if ((typeof Range != "undefined") && !Range.prototype.createContextualFragment) div.outerHTML = html; return frag; }; -} \ No newline at end of file +} diff --git a/pub/js/varien/product.js b/pub/js/varien/product.js index a3efa6bbaca..dd1c43fa0e6 100644 --- a/pub/js/varien/product.js +++ b/pub/js/varien/product.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ if(typeof Product=='undefined') { @@ -491,7 +491,8 @@ Product.Config.prototype = { for(var i=this.settings.length-1;i>=0;i--){ var selected = this.settings[i].options[this.settings[i].selectedIndex]; if(selected.config){ - price+= parseFloat(selected.config.price); + var parsedOldPrice = parseFloat(selected.config.oldPrice); + price += isNaN(parsedOldPrice) ? 0 : parsedOldPrice; } } if (price < 0) @@ -572,8 +573,11 @@ Product.OptionsPrice.prototype = { this.oldMinusDisposition = config.oldMinusDisposition; this.minusDisposition = config.minusDisposition; - this.optionPrices = {}; - this.containers = {}; + this.exclDisposition = config.exclDisposition; + + this.optionPrices = {}; + this.customPrices = {}; + this.containers = {}; this.displayZeroPrice = true; @@ -596,6 +600,9 @@ Product.OptionsPrice.prototype = { this.optionPrices[key] = price; }, + addCustomPrices: function(key, price) { + this.customPrices[key] = price; + }, getOptionPrices: function() { var price = 0; var nonTaxable = 0; @@ -657,6 +664,20 @@ Product.OptionsPrice.prototype = { _priceInclTax += parseFloat(_productPrice) * (100 + this.currentTax) / 100; } + var subPrice = 0; + var subPriceincludeTax = 0; + Object.values(this.customPrices).each(function(el){ + if (el.excludeTax && el.includeTax) { + subPrice += el.excludeTax; + subPriceincludeTax += el.includeTax; + } else { + subPrice += el.price; + subPriceincludeTax += el.price; + } + }); + price += subPrice; + _priceInclTax += subPriceincludeTax; + if (this.specialTaxPrice == 'true') { var excl = price; var incl = _priceInclTax; @@ -671,7 +692,10 @@ Product.OptionsPrice.prototype = { var incl = excl + tax; } - excl += parseFloat(_plusDisposition); + if (typeof this.exclDisposition == 'undefined') { + excl += parseFloat(_plusDisposition); + } + incl += parseFloat(_plusDisposition) + parseFloat(this.plusDispositionTax); excl -= parseFloat(_minusDisposition); incl -= parseFloat(_minusDisposition); @@ -735,7 +759,8 @@ Product.OptionsPrice.prototype = { }; var container = $(this.containers[3]) ? this.containers[3] : this.containers[0]; var price = parsePrice($(container).innerHTML); - var tierPrice = parsePrice($$('.price.tier-' + i)[0].innerHTML); + var tierPrice = $$('.price.tier-' + i); + tierPrice = tierPrice.length ? parseInt(tierPrice[0].innerHTML, 10) : 0; var $percent = Selector.findChildElements(el, ['.percent.tier-' + i]); $percent.each(function (el) { el.innerHTML = Math.ceil(100 - ((100 / price) * tierPrice)); -- GitLab