diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index b09f515d9a..14aaee5514 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,3 +1,630 @@
+==== 1.7.0.0-alpha1 ====
+
+=== Major Highlights ===
+New Layered Navigation price bucket algorithm
+Added captcha functionality
+Implemented different base prices for customer groups
+Added auto generation of coupon codes
+Backup and Rollback functionality
+VAT ID Validation added
+Implemented DHL for Europe
+
+=== Improvements ===
+XmlConnect package release v22.1
+Upgraded TinyMCE to v3.4.7
+Indexers refactoring
+Theme for iPhone was redesigned
+
+=== Changes ===
+Implemented localized PayPal settings for Japan
+Added PayPal Advanced payment method
+
+=== Fixes ===
+Fixed Incorrect translation messages definitions
+Fixed Error message isn't displayed if currency exchange rate not found (in case with DHL Int)
+Fixed Handling Fee doesn't applied Per Package
+Fixed User role with partial access can't edit attributes of configurable products
+Fixed Letter "n" missed in the word "handling"
+Fixed Buttons don't react for pressing on the "Widget Options" section in Insert Widget window
+Fixed Regular price displays incorrect
+Fixed {{base_url}} in (un)secure_url doesn't work since 1.6.1
+Fixed Product selection field gets cleared out with recently added products from latest page
+Fixed "Change" button while checkout doesn't work
+Fixed MySQL BIGINT field type is wrongly casted to integer
+Fixed Magento Connect Manager proceed with installation of extension if error appears on database backup
+Fixed "Set product as New from/to Date" works excluding selected dates
+Fixed Function fireEvent from lib/varien/js.js does not work in IE9
+Fixed Searching with first and last name has no results
+Fixed CMS Pages: Error in IE7 when select CMS page
+Fixed White screen appears instead of 404 Error Page when going to review a product which doesn't exist
+Fixed "Maximum Package Weight" option works incorrect in case with decimal Qty in shopping Cart
+Fixed Unable to create tables for new EAV entity via SQL upgrade script
+Fixed Customer group isn't revalidated on checkout if Enable Automatic Assignment to Customer Group = Yes
+Fixed Mistake in PayPal Payments Advanced fieldset title
+Fixed Zero Subtotal Checkout payment method is used, when it is disabled in settings
+Fixed Some info lost from address when customer sets this address as default for shipping
+Fixed Incorrect calculation logic during distribution products between several pieces (in case with DHL)
+Fixed No ability to get shipping rates from US to another country (in case with DHL)
+Fixed Incorrect calculation of pieces weight (in case with Bundle Product)
+Fixed Product Flat Data index causes replication lag on MySQL master/slave model
+Fixed Exception is shown, when admin user provides filtration of Newsletter problem reports by Subscriber
+Fixed Typo in JavaScript error message
+Fixed Unable to do mass action update for products
+Fixed Error Message isn't displayed if currency exchange rate not found (in case with DHL)
+Fixed Weight field is absent during Quick simple product creation
+Fixed Fixed correct helper resolving
+Fixed Shipping methods are shown twice in DHLs shipping quote
+Fixed Unable to translate shipping and billing forms on the order creation page
+Fixed Drop-down attribute with layered navigation filter doesn't work with value is set to 0
+Fixed Free Shipping options doesn't work (in case with DHL)
+Fixed Handling Fee doesn't applied Per Package
+Fixed Free Shipping options works incorrect
+Fixed WYSIWYG Editor: It's impossible insert Widget to CMS page content
+Fixed Customer's group is not changed if his billing address modified within backend
+Fixed Wrong behaviour and exception while using invalid image
+Fixed Layered navigation for prices displays incorrect price ranges in manual mode
+Fixed Uninformative error message during saving two nodes with the same parameter URL Key
+Fixed Unable to change order addresses in the admin panel
+Fixed PayPal Express always uses default billing address from customer account
+Fixed Unable to place order if customer selects Register on checkout
+Fixed Performance Issue: Most Viewed product reports on large amount of items
+Fixed In "Customer Addresses" block before and after of State name is located symbols ","
+Fixed Lightbox 2.5 with IE7 returns JS error on the page
+Fixed Unable to change customer status (confirmed/not confirmed) when customer logged in
+Fixed Incorrect notification for empty field during creation catalog price rules
+Fixed Unable to save product with non-checked multiple select attribute
+Fixed "Ship Bundle Items" for bundle product works incorrect
+Fixed Package Size setting for DHL
+Fixed No Input Validation for Catalog Fields
+Fixed Row Total Calculation in Refund
+Fixed "Maximum number of price intervals" should be written with capital letters
+Fixed Divide Order Weight options for DHL
+Fixed Incorrect Row Total Calculation in Refund
+Fixed Impossible to create new customer in the backend
+Fixed Catalog data-upgrade-1.6.0.0.4-1.6.0.0.5.php is exteremly slow
+Fixed Free Shipping options doesn't work (in case with DHL International)
+Fixed Mage_Catalog_Helper_Product::getProduct() doesn't load product by its SKU
+Fixed Preview Template doesn't work correctly
+Fixed Some options of Bundle Product disappeared from the Invoice PDF
+Fixed "Allow Countries" affects on "Country of Manufacture" attribute
+Fixed Some phrases are not translated
+Fixed Incorrect Ordered Qty in Order (in case with decimal qty)
+Fixed Trademark character isn't being displayed properly in the PDF invoice
+Fixed Can't search transactions by order_id in manager.paypal.com
+Fixed Inline Translation: Grid headers are displayed incorrect on the Tag Edit page
+Fixed "Create Extension Package" page becomes broken after compilation
+Fixed Price including tax isn't displayed for some kinds of bundle products
+Fixed Layered navigation for prices displays incorrect price ranges in manual mode
+Fixed Pager works wrong with float page number
+Fixed Incorrect foreign key for EAV entity tables
+Fixed Misprint in downloader/lib/Mage/Connect/Command/Install.php
+Fixed URL Rewrites must be case-sensitive
+Fixed Unable to install package via uploader if author name contains dash
+Fixed Fixed invoice subtotals for cases with partial invoice and discount
+Fixed Catalog URL Rewrites works incorrectly on creating categories
+Fixed New Oder Status setting, specified for payment method works incorrectly when only virtual products are present in Order
+Fixed Rounding issue in catalog and product view if price includes tax
+Fixed Wrong status of catalog event is displayed by editing catalog event
+Fixed Role Resources are not saved
+Fixed "Qty for Item's Status to Become Out of Stock" option works incorrect
+Fixed XML parser works incorrect
+Fixed Mage_Reports_Model_Mysql4_Product_Index_Abstract must be declared abstract
+Fixed "Date & Time" and "Time" custom options becomes required when editing product
+Fixed Unable to cancel an order for an expired Authorize.net auth
+Fixed Custom options are not stored when downloadable product is duplicated
+Fixed "Cannot initialize the indexer process" error during Mass "Reindex Data" Action
+Fixed Search by new attribute fails, attribute is not shown in layered navigation
+Fixed Exception when "Price Navigation Step Calculation" set to "Manual" mode and FPT enabled
+Fixed WPPHS: Cancel URL doesn't work as should be
+Fixed Error about insufficient permissions is not appears on database backup creation
+Fixed After rollback admin doesn't redirected to the Log in to Admin Panel page
+Fixed Database Backup must not include indexer table data
+Fixed Scheduled Backup creation/failure isn't logged
+Fixed Deleting backup while it is used by another process
+Fixed Opening *.tar files causes an error "There are no trailing zero-filled records"
+Fixed Unable to search by "Time" and "No" in Backups table
+Fixed Backups are deleted without confirmation
+Fixed Reports must be excluded from database snapshot backup
+Fixed There are no products in filtering results, if step calculation in automatic mode
+Fixed No validation for "Default Price Navigation Step"
+Fixed "Back" button doesn't work on the Create New Order page
+Fixed Incorrect logic of Token expiration in Two Step Password Reset flow
+Fixed Tag is present in tool-tip for field "Number of results (For the last time placed)" on the Edit Search page
+Fixed Unnecessary hard code in Magento Extension
+Fixed Wrong logic in Mage_Core_Model_Resource_Db_Collection_Abstract::join()
+Fixed Description and Short Description are displayed incorrectly for products added with WYSIWYG
+Fixed Adding product to the cart from the product review page leads to 404 page
+Fixed Special symbols in Sort Order field
+Fixed Text is wrong displayed with enabled Inline translation for Admin on back-end
+Fixed Inline Translation: Unable to translate some customer information
+Fixed Useless colon on front-end login page
+Fixed Unable to continue checkout for product with zero price and non-zero shipping price
+Fixed Import news_from_date field is configured poorly. It is not accepting the data from file
+Fixed When updating product data through import, attributes that have a value cannot be assigned a new value that is empty
+Fixed Unable to replace non-complex data for products with empty values during import
+Fixed "Wrong order ID" exception in PayPal Express module under heavy load
+Fixed Tax is applying on the order when creating it in the admin panel for a Customer Group with no taxes
+Fixed Issue with retrieving order statuses for array of states
+Fixed Wrong calculation product price with custom option type = Field and Fixed price
+Fixed Back ordered downloadable product is not available even when it is set to be be accessible when order status is Pending
+Fixed Missing column "position" at table catalog_category_anc_products_index_tmp
+Fixed Incorrect behavior of "Save in address book" option during admin Order creation for a new customer
+- refactored Mage_Adminhtml_Model_Sales_Order_Create::_prepareCustomer()
+Fixed Terms and Conditions is named differently on different pages
+Fixed "Apply" and "Discount Amount" fields appear twice in the Catalog Price Rule
+Fixed Poll shows incorrect percentage
+Fixed Added validation ability for admin configuration forms
+Fixed UPS XML misprint
+Fixed Misprint in uploading files form
+Fixed Unnecessary check boxes for gift options
+Fixed Wrong resource section declaration in Mage_Tag module
+Fixed "Customers Submitted this Tag" section doesn't update when customer has deleted tag from his account
+Fixed Correct product in category position
+Fixed Unable to create folder in Media Storage
+Fixed Translation with single quotes breaks JavaScript
+Fixed Out of memory error with hundreds of thousands of coupons attached to a single sales rule
+Fixed Unable to translate buttons and tabs on the "Manage Category" page
+Fixed Product Categories Tree doesn't expand in Manage Products page
+Fixed Incorrect products qty returns to stock after refund for configurable product
+Fixed Swf Uploader problems with cross domain Flash Player Policy
+Fixed Unable to translate "Layout Updates" block on create/edit widget page
+Fixed IE7: "Remember Me" checkbox visible on billing information step
+Fixed CMS WYSIWYG Editor - widget is inserted as new while editing in IE8
+Fixed Currency code doesn't correspond to the amount in reports
+Fixed Mage_Adminhtml_Block_Sales_Order_View_Tab_History::getFullHistory() doesn't use unique keys for each message
+Fixed Scope labels are shown without translate wrapper
+Fixed Wrong parameters handling in Core Helper formatDate()
+Fixed Apostrophe in store name breaks Google Analytics tracking
+Fixed Customer attribute prefix is not shown on frontend
+Fixed Incorrect rounding for product with custom options (percent price)
+Fixed Invoicing only part of products results in wrong totals calculation
+Fixed Incorrect Row Total Calculation in Refund
+- fixed rounding issues for partial Invoice and Refund
+- refactored delta rounding
+Fixed Filter by "Allow Countries" not working for Customer Address Form in the Backend
+- checking added for set country to be in available list
+Fixed There are sql-installs with empty string used as defaults for table columns, while column is not null able
+Fixed Unable to translate "Note" in "Product Stock Options"
+Fixed Various warning are displayed after creating shipment for 0 items
+Fixed Invalid content in Content-header in the top of page during scrolling during order creation
+Fixed "Online invoice" button present in backend when using Zero Subtotal Checkout
+Fixed String cast type in in_array function
+Fixed Newsletter template content should not disappear when "Show" / "Hide Editor" button was clicked
+Fixed Import feature doesn't validate whether super_products_sku is existing or not
+Fixed Cannot place order with downloadable product and discount code using Paypal Express payment method
+Fixed Product still out of stock after Stock Status reindex
+Fixed No ability to reindex Catalog URL Rewrites, error is shown
+Fixed Automatic reindexing based on matched events doesn't change "Status" and "Last Run" columns at process list grid
+Fixed Save catalog price rule gives trace if full reindex has already started
+Fixed Reindex requires notification is not shown for Stock Status when stock is updated for several products using Mass Action
+Fixed Incorrect FedEx's shipping rates (in case with non-US country origin)
+Fixed After partial reindex MSRP value is not applied (not viewed) in catalog during mass update action
+Fixed Wrong stock reindex on catalog if partial reindex done after full reindex started
+Fixed In error message string "already exists." written twice, when trying to save Product Tax Class with the same name
+Fixed Slow checkout with non-flushed cache
+Fixed Bundle product total is incorrect in Customization block
+Fixed Special price isn't considered for bundle dynamic products in "Your Customization" block
+Fixed Situation when any amount of duplicate reindex process can be running at one time
+Fixed Error with Advanced Search (in case with Date Attribute)
+Fixed Product Flat Data index isn't marked as "Reindex Required" after importing products when Flat Catalog is enabled
+Fixed User can't change root category for the store
+Fixed JS error causes the overwrite of Title field in PayPal Advanced configuration
+Fixed Mass action doesn't partially reindex catalog for product name/description
+Fixed Remove hint about $1 auth amount from informational message text (PayflowLink configuration)
+Fixed Mass action doesn't partially reindex catalog for product prices
+Fixed PayPal Payments Advanced works with $0 Auth instead of Full Auth
+Fixed Impossible to place Order using "Pay with PayPal" button from PayPal Payments Advanced iframe
+Fixed Mass action doesn't partially reindex catalog search for product if searchable attribute was updated
+Fixed "Please wait" AJAX screen doesn't appear in the middle of the page
+Fixed Checkout link on frontend is always referenced as http
+Fixed GET request is incorrectly formed during category creation
+- adjusted assertion to determine last viewed store
+Fixed Display of Tier Pricing with Configurable Products
+- added functionality to dynamically update tier prices accordingly to chosen product configuration
+Fixed Google Analytics e-commerce tracking not working
+Fixed URL key isn't used while product save
+Fixed Added validation class to 'Qty increments'
+Fixed Entered from admin customer date 1970 (or less) is saved as 2070 (or less)
+Fixed cUrl resource must be closed after checking it for errors, not before
+Fixed Exception while products mass update attributes in backend
+Fixed No ability to reindex Catalog URL Rewrites, error is shown
+Fixed Package with Core dependency
+Fixed Stock Availability isn't updated if 1: Run Price Reindex 2: Update Stock Availability on product with mass action/single product
+Fixed Blank page instead shopping cart page when compilation and PSC are enabled
+Fixed Unable to save redirect URL with special characters in search terms
+Fixed Attribute Set field should have client-side validation and appropriate information message
+Fixed "Localhost" isn't a valid domain name for installation
+Fixed Iframe for PayPal Payments Advanced is not loaded
+Fixed Retain the selected tab on editing CMS page
+Fixed Payflow Link Express Checkout (pay with PayPal button) payment
+Fixed Wrong number of reindex options is displayed
+Fixed Wrong phpDocs for Varien_Db_Select
+Fixed JavaScript calendar date range
+- fixed JS calendar behavior to use 4-digits year format
+Fixed Performance issue connected with sales rules on adding product to cart
+Fixed DHL same error message appears several times
+Fixed Item Status says "Mixed" when an order has been completed, should say "Shipped"
+Fixed Product option title is absent in backend order page
+Fixed Incorrect items number during multi shipping checkout
+Fixed User name displays differently in the unsuccessful message and in the text field label (log in form)
+Fixed If one or more indexers have Update Required = Yes and all Status = READY for all indexers than there is no notification for user to do reindex action
+Fixed No space between Address line 1 and line 2 in Shipping Label (in case with FedEx)
+Fixed JS works depends on the position attributes of the product
+Fixed Char set encoding is out-of-date in Settlement reports
+Fixed Settlement reports can't be downloaded if in merchant's account 'Settlement file' is set to 6.0 version
+Fixed Unable to login when secure and unsecure urls are different
+Fixed Customer session lost when using different domain/subdomain names for secure and unsecure urls
+Fixed "Most Viewed" reports ignore Store View switcher
+Fixed Long FPT name (and product name) doesn't fit into "My cart" block
+Fixed Paypal IPN post back failure
+Fixed Customer was unable to receive newsletters when it was created via backend
+Fixed Wrong Comments History in notification of order creation/cancellation
+Fixed Non escaped string causes javascript error
+Fixed Unable to view pictures during product editing
+Fixed Ampersand is saved incorrect in attribute label
+Fixed IE8: JS error appears after pressing 'Add new rule' in catalog price rules menu
+Fixed Exception after sorting newsletter queue
+Fixed Customer is not able to log in from URL without "www" in some cases
+Fixed SQL error on category view with enabled and configured FPT
+Fixed Automatic reindexing based on matched events doesn't change "Status" and "Last Run" columns at process list grid
+Fixed Performance issue with Magento Compiler + APC results in too many I/O calls
+Fixed Website Administrator is able to change default values
+Fixed Some of wishlist blocks and templates still treat the collection of wishlist items as collection of products
+Fixed Unnecessary comments in "Share Wishlist" email
+
+
+
+==== 1.6.x-devel-139014 ====
+
+=== Major Highlights ===
+Implemented different base prices for customer groups
+Added auto generation of coupon codes
+
+=== Fixes ===
+Fixed Incorrect translation messages definitions
+Fixed Error message isn't displayed if currency exchange rate not found (in case with DHL Int)
+Fixed Handling Fee doesn't applied Per Package
+Fixed User role with partial access can't edit attributes of configurable products
+Fixed Letter "n" missed in the word "handling"
+Fixed Buttons don't react for pressing on the "Widget Options" section in Insert Widget window
+Fixed Regular price displays incorrect
+Fixed {{base_url}} in (un)secure_url doesn't work since 1.6.1
+Fixed Product selection field gets cleared out with recently added products from latest page
+Fixed "Change" button while checkout doesn't work
+Fixed MySQL BIGINT field type is wrongly casted to integer
+Fixed Magento Connect Manager proceed with installation of extension if error appears on database backup
+Fixed "Set product as New from/to Date" works excluding selected dates
+Fixed Function fireEvent from lib/varien/js.js does not work in IE9
+Fixed Searching with first and last name has no results
+Fixed CMS Pages: Error in IE7 when select CMS page
+Fixed White screen appears instead of 404 Error Page when going to review a product which doesn't exist
+Fixed "Maximum Package Weight" option works incorrect in case with decimal Qty in shopping Cart
+
+
+
+==== 1.6.x-devel-138051 ====
+Fixed Unable to create tables for new EAV entity via SQL upgrade script
+Fixed Customer group isn't revalidated on checkout if Enable Automatic Assignment to Customer Group = Yes
+Fixed VAT ID validation must not run if added address is outside EU
+Fixed Mistake in PayPal Payments Advanced fieldset title
+Fixed Zero Subtotal Checkout payment method is used, when it is disabled in settings
+Fixed Some info lost from address when customer sets this address as default for shipping
+Fixed Incorrect calculation logic during distribution products between several pieces (in case with DHL)
+Fixed No ability to get shipping rates from US to another country (in case with DHL)
+Fixed Incorrect calculation of pieces weight (in case with Bundle Product)
+Fixed Divide Order Weight options for new DHL
+Fixed Product Flat Data index causes replication lag on MySQL master/slave model
+Fixed Exception is shown, when admin user provides filtration of Newsletter problem reports by Subscriber
+Fixed Gap in the section background appears on the Login page when CAPTCHA is enabled
+Fixed Typo in JavaScript error message
+Fixed Unable to do mass action update for products
+Fixed Error Message isn't displayed if currency exchange rate not found (in case with DHL)
+Fixed Weight field is absent during Quick simple product creation
+Fixed Fixed correct helper resolving
+Fixed Shipping methods are shown twice in DHLs shipping quote
+Fixed Unable to translate shipping and billing forms on the order creation page
+Fixed Drop-down attribute with layered navigation filter doesn't work with value is set to 0
+Fixed Free Shipping options doesn't work (in case with DHL)
+Fixed Handling Fee doesn't applied Per Package
+
+
+
+==== 1.6.x-devel-136760 ====
+Fixed Free Shipping options works incorrect
+Fixed Wrong massage appears if VAT ID is invalid
+Fixed WYSIWYG Editor: It's impossible insert Widget to CMS page content
+Fixed After removing VAT Number, customer continues to be assigned to "Valid VAT ID Domestic" group
+Fixed Customer's group is not changed if his billing address modified within backend
+Fixed Wrong behaviour and exception while using invalid image
+Fixed Layered navigation for prices displays incorrect price ranges in manual mode
+Fixed Uninformative error message during saving two nodes with the same parameter URL Key
+Fixed Unable to change order addresses in the admin panel
+Fixed PayPal Express always uses default billing address from customer account
+Fixed Unable to place order if customer selects Register on checkout
+Fixed Performance Issue: Most Viewed product reports on large amount of items
+Fixed In "Customer Addresses" block before and after of State name is located symbols ","
+Fixed Lightbox 2.5 with IE7 returns JS error on the page
+Fixed Unable to change customer status (confirmed/not confirmed) when customer logged in
+Fixed Incorrect notification for empty field during creation catalog price rules
+Fixed Unable to save product with non-checked multiple select attribute
+Fixed "Ship Bundle Items" for bundle product works incorrect
+Fixed Package Size setting for DHL
+Fixed No Input Validation for Catalog Fields
+Fixed Row Total Calculation in Refund
+Fixed "Maximum number of price intervals" should be written with capital letters
+Fixed Divide Order Weight options for DHL
+
+
+
+==== 1.6.x-devel-135464 ====
+Fixed Incorrect Row Total Calculation in Refund
+Fixed Impossible to create new customer in the backend
+Fixed Catalog data-upgrade-1.6.0.0.4-1.6.0.0.5.php is exteremly slow
+Fixed Free Shipping options doesn't work (in case with DHL International)
+Fixed Mage_Catalog_Helper_Product::getProduct() doesn't load product by its SKU
+Fixed Preview Template doesn't work correctly
+Fixed Some options of Bundle Product disappeared from the Invoice PDF
+Fixed "Allow Countries" affects on "Country of Manufacture" attribute
+Fixed Some phrases are not translated
+Fixed Incorrect Ordered Qty in Order (in case with decimal qty)
+Fixed Trademark character isn't being displayed properly in the PDF invoice
+Fixed Can't search transactions by order_id in manager.paypal.com
+Fixed Inline Translation: Grid headers are displayed incorrect on the Tag Edit page
+Fixed Scheduled Backup creation/failure isn't logged
+Fixed "Create Extension Package" page becomes broken after compilation
+Fixed Price including tax isn't displayed for some kinds of bundle products
+Fixed Layered navigation for prices displays incorrect price ranges in manual mode
+Fixed Pager works wrong with float page number
+Fixed VAT Number for country that isn't selected in "European Union Countries" validated
+Fixed Incorrect foreign key for EAV entity tables
+Fixed VAT ID: Warning message about not-valid VAT Number displayed in green frame
+Fixed Misprint in downloader/lib/Mage/Connect/Command/Install.php
+Fixed URL Rewrites must be case-sensitive
+Fixed Incorrect notification when customer's billing address updated with VAT ID within frontend
+Fixed Unable to install package via uploader if author name contains dash
+Fixed Fixed invoice subtotals for cases with partial invoice and discount
+Fixed Incorrect work of "Disable Automatic Group Changes Based on VAT ID Default Value" option
+Fixed Catalog URL Rewrites works incorrectly on creating categories
+
+
+
+==== 1.6.x-devel-134386 ====
+
+=== Major Highlights ===
+Added VAT ID Validation
+Implemented DHL for Europe
+
+=== Improvements ===
+Theme for iPhone was redesigned
+
+=== Fixes ===
+Fixed New Oder Status setting, specified for payment method works incorrectly when only virtual products are present in Order
+Fixed Rounding issue in catalog and product view if price includes tax
+Fixed Wrong status of catalog event is displayed by editing catalog event
+Fixed Role Resources are not saved
+Fixed "Qty for Item's Status to Become Out of Stock" option works incorrect
+Fixed XML parser works incorrect
+Fixed Mage_Reports_Model_Mysql4_Product_Index_Abstract must be declared abstract
+Fixed "Date & Time" and "Time" custom options becomes required when editing product
+Fixed Unable to cancel an order for an expired Authorize.net auth
+Fixed Custom options are not stored when downloadable product is duplicated
+Fixed "Cannot initialize the indexer process" error during Mass "Reindex Data" Action
+Fixed Search by new attribute fails, attribute is not shown in layered navigation
+Fixed Exception when "Price Navigation Step Calculation" set to "Manual" mode and FPT enabled
+Fixed WPPHS: Cancel URL doesn't work as should be
+Fixed Error about insufficient permissions is not appears on database backup creation
+Fixed After rollback admin doesn't redirected to the Log in to Admin Panel page
+Fixed Database Backup must not include indexer table data
+Fixed Scheduled Backup creation/failure isn't logged
+Fixed Deleting backup while it is used by another process
+Fixed Opening *.tar files causes an error "There are no trailing zero-filled records"
+Fixed Unable to search by "Time" and "No" in Backups table
+Fixed Backups are deleted without confirmation
+Fixed Reports must be excluded from database snapshot backup
+Fixed There are no products in filtering results, if step calculation in automatic mode
+Fixed No validation for "Default Price Navigation Step"
+Fixed "Back" button doesn't work on the Create New Order page
+Fixed Incorrect logic of Token expiration in Two Step Password Reset flow
+Fixed Tag is present in tool-tip for field "Number of results (For the last time placed)" on the Edit Search page
+Fixed Impossible to use CAPTCHA that longer than 12 symbols
+Fixed CAPTCHA with space symbol in it works incorrectly
+Fixed System backup doesn't complete
+Fixed Unnecessary hard code in Magento Extension
+Fixed It's impossible specify form where CAPTCHA could be used
+Fixed Wrong logic in Mage_Core_Model_Resource_Db_Collection_Abstract::join()
+Fixed Description and Short Description are displayed incorrectly for products added with WYSIWYG
+Fixed Adding product to the cart from the product review page leads to 404 page
+Fixed Special symbols in Sort Order field
+Fixed Text is wrong displayed with enabled Inline translation for Admin on back-end
+Fixed Inline Translation: Unable to translate some customer information
+Fixed Useless colon on front-end login page
+Fixed Unable to continue checkout for product with zero price and non-zero shipping price
+Fixed Import news_from_date field is configured poorly. It is not accepting the data from file
+Fixed When updating product data through import, attributes that have a value cannot be assigned a new value that is empty
+Fixed Unable to replace non-complex data for products with empty values during import
+Fixed Customer can't understand is CAPTCHA case sensitive or not
+Fixed Incorrect CAPTCHA's default configuration values
+Fixed "Wrong order ID" exception in PayPal Express module under heavy load
+Fixed Tax is applying on the order when creating it in the admin panel for a Customer Group with no taxes
+Fixed Issue with retrieving order statuses for array of states
+Fixed Wrong calculation product price with custom option type = Field and Fixed price
+Fixed Back ordered downloadable product is not available even when it is set to be be accessible when order status is Pending
+
+
+
+==== 1.6.x-devel-133001 ====
+
+=== Major Highlights ===
+Implemented Backup and Rollback functionality
+
+=== Fixes ===
+Fixed Full Product Price reindex started instead of partial if prices updated with mass action
+Fixed Missing column "position" at table catalog_category_anc_products_index_tmp
+Fixed Incorrect behavior of "Save in address book" option during admin Order creation for a new customer
+- refactored Mage_Adminhtml_Model_Sales_Order_Create::_prepareCustomer()
+Fixed Terms and Conditions is named differently on different pages
+Fixed "Apply" and "Discount Amount" fields appear twice in the Catalog Price Rule
+Fixed Poll shows incorrect percentage
+Fixed Added validation ability for admin configuration forms
+Fixed UPS XML misprint
+Fixed Misprint in uploading files form
+Fixed Unnecessary check boxes for gift options
+Fixed Wrong resource section declaration in Mage_Tag module
+Fixed "Customers Submitted this Tag" section doesn't update when customer has deleted tag from his account
+Fixed Correct product in category position
+Fixed Unable to create folder in Media Storage
+Fixed Translation with single quotes breaks JavaScript
+Fixed Out of memory error with hundreds of thousands of coupons attached to a single sales rule
+Fixed Unable to translate buttons and tabs on the "Manage Category" page
+Fixed Product Categories Tree doesn't expand in Manage Products page
+Fixed Incorrect products qty returns to stock after refund for configurable product
+Fixed Swf Uploader problems with cross domain Flash Player Policy
+Fixed Unable to translate "Layout Updates" block on create/edit widget page
+Fixed IE7: "Remember Me" checkbox visible on billing information step
+Fixed CMS WYSIWYG Editor - widget is inserted as new while editing in IE8
+Fixed Currency code doesn't correspond to the amount in reports
+Fixed Mage_Adminhtml_Block_Sales_Order_View_Tab_History::getFullHistory() doesn't use unique keys for each message
+Fixed Scope labels are shown without translate wrapper
+Fixed Wrong parameters handling in Core Helper formatDate()
+Fixed Apostrophe in store name breaks Google Analytics tracking
+Fixed Customer attribute prefix is not shown on frontend
+Fixed Incorrect rounding for product with custom options (percent price)
+Fixed Invoicing only part of products results in wrong totals calculation
+Fixed Incorrect Row Total Calculation in Refund
+- fixed rounding issues for partial Invoice and Refund
+- refactored delta rounding
+Fixed Filter by "Allow Countries" not working for Customer Address Form in the Backend
+- checking added for set country to be in available list
+Fixed There are sql-installs with empty string used as defaults for table columns, while column is not null able
+Fixed Unable to translate "Note" in "Product Stock Options"
+Fixed Various warning are displayed after creating shipment for 0 items
+Fixed Invalid content in Content-header in the top of page during scrolling during order creation
+Fixed "Online invoice" button present in backend when using Zero Subtotal Checkout
+Fixed String cast type in in_array function
+Fixed Newsletter template content should not disappear when "Show" / "Hide Editor" button was clicked
+Fixed Import feature doesn't validate whether super_products_sku is existing or not
+
+
+
+
+==== 1.6.x-devel-131783 ====
+
+=== Major Highlights ===
+Implemented new Layered Navigation price bucket algorithm
+Added captcha functionality
+
+=== Improvements ===
+XmlConnect package release v22.1
+Upgraded TinyMCE to v3.4.7
+
+=== Fixes ===
+Fixed Cannot place order with downloadable product and discount code using Paypal Express payment method
+Fixed Product still out of stock after Stock Status reindex
+Fixed No ability to reindex Catalog URL Rewrites, error is shown
+Fixed Automatic reindexing based on matched events doesn't change "Status" and "Last Run" columns at process list grid
+Fixed Save catalog price rule gives trace if full reindex has already started
+Fixed Reindex requires notification is not shown for Stock Status when stock is updated for several products using Mass Action
+Fixed Incorrect FedEx's shipping rates (in case with non-US country origin)
+Fixed After partial reindex MSRP value is not applied (not viewed) in catalog during mass update action
+Fixed Wrong stock reindex on catalog if partial reindex done after full reindex started
+Fixed In error message string "already exists." written twice, when trying to save Product Tax Class with the same name
+Fixed Wrong stock reindex on catalog if partial reindex done after full reindex started
+Fixed Slow checkout with non-flushed cache
+
+
+
+==== 1.6.x-devel-130478 ====
+Fixed Bundle product total is incorrect in Customization block
+Fixed Special price isn't considered for bundle dynamic products in "Your Customization" block
+Fixed Situation when any amount of duplicate reindex process can be running at one time
+Fixed Error with Advanced Search (in case with Date Attribute)
+Fixed Product Flat Data index isn't marked as "Reindex Required" after importing products when Flat Catalog is enabled
+Fixed User can't change root category for the store
+Fixed JS error causes the overwrite of Title field in PayPal Advanced configuration
+Fixed Mass action doesn't partially reindex catalog for product name/description
+Fixed Remove hint about $1 auth amount from informational message text (PayflowLink configuration)
+Fixed Mass action doesn't partially reindex catalog for product prices
+Fixed PayPal Payments Advanced works with $0 Auth instead of Full Auth
+Fixed Impossible to place Order using "Pay with PayPal" button from PayPal Payments Advanced iframe
+Fixed Mass action doesn't partially reindex catalog search for product if searchable attribute was updated
+Fixed "Please wait" AJAX screen doesn't appear in the middle of the page
+Fixed Checkout link on frontend is always referenced as http
+Fixed GET request is incorrectly formed during category creation
+- adjusted assertion to determine last viewed store
+Fixed Display of Tier Pricing with Configurable Products
+- added functionality to dynamically update tier prices accordingly to chosen product configuration
+Fixed Google Analytics e-commerce tracking not working
+Fixed URL key isn't used while product save
+Fixed Added validation class to 'Qty increments'
+Fixed Entered from admin customer date 1970 (or less) is saved as 2070 (or less)
+Fixed cUrl resource must be closed after checking it for errors, not before
+Fixed Exception while products mass update attributes in backend
+Fixed Impossible to place Order using Pay with PayPal button from PayflowLink iframe, when Payment Action is Sale
+Fixed No ability to reindex Catalog URL Rewrites, error is shown
+Fixed Package with Core dependency
+
+
+
+==== 1.6.x-devel-129596 ====
+Fixed Stock Availability isn't updated if 1: Run Price Reindex 2: Update Stock Availability on product with mass action/single product
+Fixed PayPal Payments Advanced update descriptions
+Fixed Blank page instead shopping cart page when compilation and PSC are enabled
+Fixed Unable to save redirect URL with special characters in search terms
+Fixed Attribute Set field should have client-side validation and appropriate information message
+Fixed "Localhost" isn't a valid domain name for installation
+Fixed Iframe for PayPal Payments Advanced is not loaded
+Fixed Retain the selected tab on editing CMS page
+Fixed Payflow Link Express Checkout (pay with PayPal button) payment
+Fixed Wrong number of reindex options is displayed
+Fixed Wrong phpDocs for Varien_Db_Select
+Fixed JavaScript calendar date range
+- fixed JS calendar behavior to use 4-digits year format
+Fixed Performance issue connected with sales rules on adding product to cart
+Fixed DHL same error message appears several times
+Fixed Item Status says "Mixed" when an order has been completed, should say "Shipped"
+Fixed Product option title is absent in backend order page
+Fixed Incorrect items number during multi shipping checkout
+Fixed User name displays differently in the unsuccessful message and in the text field label (log in form)
+Fixed If one or more indexers have Update Required = Yes and all Status = READY for all indexers than there is no notification for user to do reindex action
+Fixed No space between Address line 1 and line 2 in Shipping Label (in case with FedEx)
+
+
+
+==== 1.6.x-devel-128838 ====
+
+=== Improvements ===
+Indexers refactoring
+
+=== Changes ===
+Implemented localized PayPal settings for Japan
+Added PayPal Payments Advanced
+
+=== Fixes ===
+Fixed JS works depends on the position attributes of the product
+Fixed Char set encoding is out-of-date in Settlement reports
+Fixed Settlement reports can't be downloaded if in merchant's account 'Settlement file' is set to 6.0 version
+Fixed Unable to login when secure and unsecure urls are different
+Fixed Customer session lost when using different domain/subdomain names for secure and unsecure urls
+Fixed "Most Viewed" reports ignore Store View switcher
+Fixed Long FPT name (and product name) doesn't fit into "My cart" block
+Fixed Paypal IPN post back failure
+Fixed Customer was unable to receive newsletters when it was created via backend
+Fixed Wrong Comments History in notification of order creation/cancellation
+Fixed Non escaped string causes javascript error
+Fixed Unable to view pictures during product editing
+Fixed Ampersand is saved incorrect in attribute label
+Fixed IE8: JS error appears after pressing 'Add new rule' in catalog price rules menu
+Fixed Exception after sorting newsletter queue
+Fixed Customer is not able to log in from URL without "www" in some cases
+Fixed SQL error on category view with enabled and configured FPT
+Fixed Automatic reindexing based on matched events doesn't change "Status" and "Last Run" columns at process list grid
+Fixed Performance issue with Magento Compiler + APC results in too many I/O calls
+Fixed Website Administrator is able to change default values
+Fixed Some of wishlist blocks and templates still treat the collection of wishlist items as collection of products
+Fixed Unnecessary comments in "Share Wishlist" email
+
+
+
==== 1.6.1.0 ====
=== Major Highlights ===
diff --git a/app/Mage.php b/app/Mage.php
index 4d50995d90..f5b1b716f7 100644
--- a/app/Mage.php
+++ b/app/Mage.php
@@ -33,8 +33,8 @@
if (defined('COMPILER_INCLUDE_PATH')) {
$appPath = COMPILER_INCLUDE_PATH;
set_include_path($appPath . PS . Mage::registry('original_include_path'));
- include_once "Mage_Core_functions.php";
- include_once "Varien_Autoload.php";
+ include_once COMPILER_INCLUDE_PATH . DS . "Mage_Core_functions.php";
+ include_once COMPILER_INCLUDE_PATH . DS . "Varien_Autoload.php";
} else {
/**
* Set include path
@@ -138,7 +138,8 @@ final class Mage
public static function getVersion()
{
$i = self::getVersionInfo();
- return trim("{$i['major']}.{$i['minor']}.{$i['revision']}" . ($i['patch'] != '' ? ".{$i['patch']}" : "") . "-{$i['stability']}{$i['number']}", '.-');
+ return trim("{$i['major']}.{$i['minor']}.{$i['revision']}" . ($i['patch'] != '' ? ".{$i['patch']}" : "")
+ . "-{$i['stability']}{$i['number']}", '.-');
}
/**
@@ -151,11 +152,11 @@ public static function getVersionInfo()
{
return array(
'major' => '1',
- 'minor' => '6',
- 'revision' => '1',
+ 'minor' => '7',
+ 'revision' => '0',
'patch' => '0',
- 'stability' => '',
- 'number' => '',
+ 'stability' => 'alpha',
+ 'number' => '1',
);
}
@@ -166,12 +167,14 @@ public static function getVersionInfo()
public static function reset()
{
self::$_registry = array();
+ self::$_appRoot = null;
self::$_app = null;
self::$_config = null;
self::$_events = null;
self::$_objects = null;
self::$_isDownloader = false;
self::$_isDeveloperMode = false;
+ self::$_isInstalled = null;
// do not reset $headersSentThrowsException
}
@@ -424,7 +427,7 @@ public static function dispatchEvent($name, array $data = array())
*
* @link Mage_Core_Model_Config::getModelInstance
* @param string $modelClass
- * @param array $arguments
+ * @param array|object $arguments
* @return Mage_Core_Model_Abstract
*/
public static function getModel($modelClass = '', $arguments = array())
@@ -631,6 +634,12 @@ public static function run($code = '', $type = 'store', $options = array())
Varien_Profiler::start('mage');
self::setRoot();
self::$_app = new Mage_Core_Model_App();
+ if (isset($options['request'])) {
+ self::$_app->setRequest($options['request']);
+ }
+ if (isset($options['response'])) {
+ self::$_app->setResponse($options['response']);
+ }
self::$_events = new Varien_Event_Collection();
self::$_config = new Mage_Core_Model_Config($options);
self::$_app->run(array(
diff --git a/app/code/core/Mage/Admin/Model/Observer.php b/app/code/core/Mage/Admin/Model/Observer.php
index c685beb3c0..0d7816be5e 100644
--- a/app/code/core/Mage/Admin/Model/Observer.php
+++ b/app/code/core/Mage/Admin/Model/Observer.php
@@ -33,6 +33,7 @@
*/
class Mage_Admin_Model_Observer
{
+ const FLAG_NO_LOGIN = 'no-login';
/**
* Handler for controller_action_predispatch event
*
@@ -51,7 +52,8 @@ public function actionPreDispatchAdmin($observer)
'forgotpassword',
'resetpassword',
'resetpasswordpost',
- 'logout'
+ 'logout',
+ 'refresh' // captcha refresh
);
if (in_array($requestedActionName, $openActions)) {
$request->setDispatched(true);
@@ -64,7 +66,7 @@ public function actionPreDispatchAdmin($observer)
$postLogin = $request->getPost('login');
$username = isset($postLogin['username']) ? $postLogin['username'] : '';
$password = isset($postLogin['password']) ? $postLogin['password'] : '';
- $user = $session->login($username, $password, $request);
+ $session->login($username, $password, $request);
$request->setPost('login', null);
}
if (!$request->getParam('forwarded')) {
diff --git a/app/code/core/Mage/Admin/Model/Roles.php b/app/code/core/Mage/Admin/Model/Roles.php
index 0d5db92e88..7110ed9a5d 100644
--- a/app/code/core/Mage/Admin/Model/Roles.php
+++ b/app/code/core/Mage/Admin/Model/Roles.php
@@ -53,42 +53,86 @@ class Mage_Admin_Model_Roles extends Mage_Core_Model_Abstract
*/
protected $_eventPrefix = 'admin_roles';
+ /**
+ * Constructor
+ */
protected function _construct()
{
$this->_init('admin/roles');
}
+ /**
+ * Update object into database
+ *
+ * @return Mage_Admin_Model_Roles
+ */
public function update()
{
$this->getResource()->update($this);
return $this;
}
+ /**
+ * Retrieve users collection
+ *
+ * @return Mage_Admin_Model_Resource_Roles_User_Collection
+ */
public function getUsersCollection()
{
return Mage::getResourceModel('admin/roles_user_collection');
}
+ /**
+ * Return tree of acl resources
+ *
+ * @return array|null|Varien_Simplexml_Element
+ */
public function getResourcesTree()
{
return $this->_buildResourcesArray(null, null, null, null, true);
}
+ /**
+ * Return list of acl resources
+ *
+ * @return array|null|Varien_Simplexml_Element
+ */
public function getResourcesList()
{
return $this->_buildResourcesArray();
}
+ /**
+ * Return list of acl resources in 2D format
+ *
+ * @return array|null|Varien_Simplexml_Element
+ */
public function getResourcesList2D()
{
return $this->_buildResourcesArray(null, null, null, true);
}
+ /**
+ * Return users for role
+ *
+ * @return array|false
+ */
public function getRoleUsers()
{
return $this->getResource()->getRoleUsers($this);
}
+ /**
+ * Build resources array process
+ *
+ * @param null|Varien_Simplexml_Element $resource
+ * @param null $parentName
+ * @param int $level
+ * @param null $represent2Darray
+ * @param bool $rawNodes
+ * @param string $module
+ * @return array|null|Varien_Simplexml_Element
+ */
protected function _buildResourcesArray(Varien_Simplexml_Element $resource = null,
$parentName = null, $level = 0, $represent2Darray = null, $rawNodes = false, $module = 'adminhtml')
{
@@ -99,7 +143,7 @@ protected function _buildResourcesArray(Varien_Simplexml_Element $resource = nul
$level = -1;
} else {
$resourceName = $parentName;
- if ($resource->getName() != 'title' && $resource->getName() != 'sort_order' && $resource->getName() != 'children') {
+ if (!in_array($resource->getName(), array('title', 'sort_order', 'children', 'disabled'))) {
$resourceName = (is_null($parentName) ? '' : $parentName . '/') . $resource->getName();
//assigning module for its' children nodes
@@ -121,22 +165,20 @@ protected function _buildResourcesArray(Varien_Simplexml_Element $resource = nul
}
}
+ //check children and run recursion if they exists
$children = $resource->children();
- if (empty($children)) {
- if ($rawNodes) {
- return $resource;
- } else {
- return $result;
+ foreach ($children as $key => $child) {
+ if (1 == $child->disabled) {
+ $resource->{$key} = null;
+ continue;
}
- }
- foreach ($children as $child) {
$this->_buildResourcesArray($child, $resourceName, $level + 1, $represent2Darray, $rawNodes, $module);
}
+
if ($rawNodes) {
return $resource;
} else {
return $result;
}
}
-
}
diff --git a/app/code/core/Mage/Admin/Model/Session.php b/app/code/core/Mage/Admin/Model/Session.php
index 3f5cecba66..7f30aca610 100644
--- a/app/code/core/Mage/Admin/Model/Session.php
+++ b/app/code/core/Mage/Admin/Model/Session.php
@@ -86,7 +86,7 @@ public function login($username, $password, $request = null)
}
try {
- /* @var $user Mage_Admin_Model_User */
+ /** @var $user Mage_Admin_Model_User */
$user = Mage::getModel('admin/user');
$user->login($username, $password);
if ($user->getId()) {
@@ -98,19 +98,19 @@ public function login($username, $password, $request = null)
$this->setIsFirstPageAfterLogin(true);
$this->setUser($user);
$this->setAcl(Mage::getResourceModel('admin/acl')->loadAcl());
- if ($requestUri = $this->_getRequestUri($request)) {
+
+ $requestUri = $this->_getRequestUri($request);
+ if ($requestUri) {
Mage::dispatchEvent('admin_session_user_login_success', array('user' => $user));
header('Location: ' . $requestUri);
exit;
}
+ } else {
+ Mage::throwException(Mage::helper('adminhtml')->__('Invalid User Name or Password.'));
}
- else {
- Mage::throwException(Mage::helper('adminhtml')->__('Invalid Username or Password.'));
- }
- }
- catch (Mage_Core_Exception $e) {
+ } catch (Mage_Core_Exception $e) {
Mage::dispatchEvent('admin_session_user_login_failed',
- array('user_name' => $username, 'exception' => $e));
+ array('user_name' => $username, 'exception' => $e));
if ($request && !$request->getParam('messageSent')) {
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
$request->setParam('messageSent', true);
diff --git a/app/code/core/Mage/Admin/Model/User.php b/app/code/core/Mage/Admin/Model/User.php
index f9b37bebcd..d3e56d0097 100644
--- a/app/code/core/Mage/Admin/Model/User.php
+++ b/app/code/core/Mage/Admin/Model/User.php
@@ -328,6 +328,10 @@ public function authenticate($username, $password)
$result = false;
try {
+ Mage::dispatchEvent('admin_user_authenticate_before', array(
+ 'username' => $username,
+ 'user' => $this
+ ));
$this->loadByUsername($username);
$sensitive = ($config) ? $username == $this->getUsername() : true;
@@ -556,7 +560,7 @@ public function changeResetPasswordLinkToken($newResetPasswordLinkToken) {
throw Mage::exception('Mage_Core', Mage::helper('adminhtml')->__('Invalid password reset token.'));
}
$this->setRpToken($newResetPasswordLinkToken);
- $currentDate = Varien_Date::now(true);
+ $currentDate = Varien_Date::now();
$this->setRpTokenCreatedAt($currentDate);
return $this;
@@ -578,7 +582,7 @@ public function isResetPasswordLinkTokenExpired()
$tokenExpirationPeriod = Mage::helper('admin')->getResetPasswordLinkExpirationPeriod();
- $currentDate = Varien_Date::now(true);
+ $currentDate = Varien_Date::now();
$currentTimestamp = Varien_Date::toTimestamp($currentDate);
$tokenTimestamp = Varien_Date::toTimestamp($resetPasswordLinkTokenCreatedAt);
if ($tokenTimestamp > $currentTimestamp) {
diff --git a/app/code/core/Mage/Admin/etc/config.xml b/app/code/core/Mage/Admin/etc/config.xml
index 8446743297..651f398f2b 100644
--- a/app/code/core/Mage/Admin/etc/config.xml
+++ b/app/code/core/Mage/Admin/etc/config.xml
@@ -79,7 +79,7 @@
admin_emails_forgot_email_templategeneral
- 3
+ 1
diff --git a/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php b/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php
index fd167fd6f3..f222ff2398 100644
--- a/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php
+++ b/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php
@@ -41,8 +41,8 @@
'primary' => true,
), 'Assert ID')
->addColumn('assert_type', Varien_Db_Ddl_Table::TYPE_TEXT, 20, array(
- 'nullable' => false,
- 'default' => '',
+ 'nullable' => true,
+ 'default' => null,
), 'Assert Type')
->addColumn('assert_data', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array(
), 'Assert Data')
@@ -85,8 +85,8 @@
'default' => '0',
), 'User ID')
->addColumn('role_name', Varien_Db_Ddl_Table::TYPE_TEXT, 50, array(
- 'nullable' => false,
- 'default' => '',
+ 'nullable' => true,
+ 'default' => null,
), 'Role Name')
->addIndex($installer->getIdxName('admin/role', array('parent_id', 'sort_order')),
array('parent_id', 'sort_order'))
@@ -112,8 +112,8 @@
'default' => '0',
), 'Role ID')
->addColumn('resource_id', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
- 'nullable' => false,
- 'default' => '',
+ 'nullable' => true,
+ 'default' => null,
), 'Resource ID')
->addColumn('privileges', Varien_Db_Ddl_Table::TYPE_TEXT, 20, array(
'nullable' => true,
diff --git a/app/code/core/Mage/AdminNotification/Helper/Data.php b/app/code/core/Mage/AdminNotification/Helper/Data.php
index d7214748bd..a1b7b9a8e8 100644
--- a/app/code/core/Mage/AdminNotification/Helper/Data.php
+++ b/app/code/core/Mage/AdminNotification/Helper/Data.php
@@ -129,6 +129,8 @@ public function isReadablePopupObject()
$this->_popupReadable = true;
}
}
+
+ $curl->close();
}
return $this->_popupReadable;
}
diff --git a/app/code/core/Mage/AdminNotification/Model/Survey.php b/app/code/core/Mage/AdminNotification/Model/Survey.php
index b9bb7431b1..14c43fda6c 100644
--- a/app/code/core/Mage/AdminNotification/Model/Survey.php
+++ b/app/code/core/Mage/AdminNotification/Model/Survey.php
@@ -50,6 +50,8 @@ public static function isSurveyUrlValid()
$curl->setConfig(array('timeout' => 5))
->write(Zend_Http_Client::GET, self::getSurveyUrl(), '1.0');
$response = $curl->read();
+ $curl->close();
+
if (Zend_Http_Response::extractCode($response) == 200) {
return true;
}
diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php
index d38cc618be..478f257fa7 100644
--- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php
+++ b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php
@@ -38,7 +38,9 @@ public function __construct() {
$selrids = array();
foreach ($rules_set->getItems() as $item) {
- if (array_key_exists(strtolower($item->getResource_id()), $resources) && $item->getPermission() == 'allow') {
+ if (array_key_exists(strtolower($item->getResource_id()), $resources)
+ && $item->getApiPermission() == 'allow')
+ {
$resources[$item->getResource_id()]['checked'] = true;
array_push($selrids, $item->getResource_id());
}
diff --git a/app/code/core/Mage/Adminhtml/Block/Backup.php b/app/code/core/Mage/Adminhtml/Block/Backup.php
index 25b0a7ea9d..9e3b484244 100644
--- a/app/code/core/Mage/Adminhtml/Block/Backup.php
+++ b/app/code/core/Mage/Adminhtml/Block/Backup.php
@@ -31,14 +31,14 @@
* @package Mage_Adminhtml
* @author Magento Core Team
*/
-
class Mage_Adminhtml_Block_Backup extends Mage_Adminhtml_Block_Template
{
- public function __construct()
- {
- parent::__construct();
- $this->setTemplate('backup/list.phtml');
- }
+ /**
+ * Block's template
+ *
+ * @var string
+ */
+ protected $_template = 'backup/list.phtml';
protected function _prepareLayout()
{
@@ -46,14 +46,32 @@ protected function _prepareLayout()
$this->setChild('createButton',
$this->getLayout()->createBlock('adminhtml/widget_button')
->setData(array(
- 'label' => Mage::helper('backup')->__('Create Backup'),
- 'onclick' => "window.location.href='" . $this->getUrl('*/*/create') . "'",
+ 'label' => Mage::helper('backup')->__('Database Backup'),
+ 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_DB . "')",
'class' => 'task'
))
);
+ $this->setChild('createSnapshotButton',
+ $this->getLayout()->createBlock('adminhtml/widget_button')
+ ->setData(array(
+ 'label' => Mage::helper('backup')->__('System Backup'),
+ 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT . "')",
+ 'class' => ''
+ ))
+ );
+ $this->setChild('createMediaBackupButton',
+ $this->getLayout()->createBlock('adminhtml/widget_button')
+ ->setData(array(
+ 'label' => Mage::helper('backup')->__('Database and Media Backup'),
+ 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_MEDIA . "')",
+ 'class' => ''
+ ))
+ );
$this->setChild('backupsGrid',
$this->getLayout()->createBlock('adminhtml/backup_grid')
);
+
+ $this->setChild('dialogs', $this->getLayout()->createBlock('adminhtml/backup_dialogs'));
}
public function getCreateButtonHtml()
@@ -61,8 +79,38 @@ public function getCreateButtonHtml()
return $this->getChildHtml('createButton');
}
+ /**
+ * Generate html code for "Create System Snapshot" button
+ *
+ * @return string
+ */
+ public function getCreateSnapshotButtonHtml()
+ {
+ return $this->getChildHtml('createSnapshotButton');
+ }
+
+ /**
+ * Generate html code for "Create Media Backup" button
+ *
+ * @return string
+ */
+ public function getCreateMediaBackupButtonHtml()
+ {
+ return $this->getChildHtml('createMediaBackupButton');
+ }
+
public function getGridHtml()
{
return $this->getChildHtml('backupsGrid');
}
+
+ /**
+ * Generate html code for pop-up messages that will appear when user click on "Rollback" link
+ *
+ * @return string
+ */
+ public function getDialogsHtml()
+ {
+ return $this->getChildHtml('dialogs');
+ }
}
diff --git a/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php b/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php
new file mode 100644
index 0000000000..21f57799e5
--- /dev/null
+++ b/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php
@@ -0,0 +1,53 @@
+
+ */
+class Mage_Adminhtml_Block_Backup_Dialogs extends Mage_Adminhtml_Block_Template
+{
+ /**
+ * Block's template
+ *
+ * @var string
+ */
+ protected $_template = 'backup/dialogs.phtml';
+
+ /**
+ * Include backup.js file in page before rendering
+ *
+ * @see Mage_Core_Block_Abstract::_prepareLayout()
+ */
+ protected function _prepareLayout()
+ {
+ $this->getLayout()->getBlock('head')->addJs('mage/adminhtml/backup.js');
+ parent::_prepareLayout();
+ }
+}
diff --git a/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php b/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php
index 8b8308aa7a..bdb381c38e 100644
--- a/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php
@@ -51,8 +51,29 @@ protected function _prepareCollection()
return parent::_prepareCollection();
}
+ /**
+ * Prepare mass action controls
+ *
+ * @return Mage_Adminhtml_Block_Backup_Grid
+ */
+ protected function _prepareMassaction()
+ {
+ $this->setMassactionIdField('id');
+ $this->getMassactionBlock()->setFormFieldName('ids');
+
+ $this->getMassactionBlock()->addItem('delete', array(
+ 'label'=> Mage::helper('adminhtml')->__('Delete'),
+ 'url' => $this->getUrl('*/*/massDelete'),
+ 'confirm' => Mage::helper('backup')->__('Are you sure you want to delete the selected backup(s)?')
+ ));
+
+ return $this;
+ }
+
/**
* Configuration of grid
+ *
+ * @return Mage_Adminhtml_Block_Backup_Grid
*/
protected function _prepareColumns()
{
@@ -68,39 +89,42 @@ protected function _prepareColumns()
'header' => Mage::helper('backup')->__('Size, Bytes'),
'index' => 'size',
'type' => 'number',
- 'sortable' => false,
+ 'sortable' => true,
'filter' => false
));
$this->addColumn('type', array(
'header' => Mage::helper('backup')->__('Type'),
'type' => 'options',
- 'options' => array('db' => Mage::helper('backup')->__('DB')),
+ 'options' => Mage::helper('backup')->getBackupTypes(),
'index' =>'type'
));
$this->addColumn('download', array(
'header' => Mage::helper('backup')->__('Download'),
- 'format' => 'gz ('.$url7zip.')',
+ 'format' => '$extension ('.$url7zip.')',
'index' => 'type',
'sortable' => false,
'filter' => false
));
- $this->addColumn('action', array(
- 'header' => Mage::helper('backup')->__('Action'),
- 'type' => 'action',
- 'width' => '80px',
- 'filter' => false,
- 'sortable' => false,
- 'actions' => array(array(
- 'url' => $this->getUrl('*/*/delete', array('time' => '$time', 'type' => '$type')),
- 'caption' => Mage::helper('adminhtml')->__('Delete'),
- 'confirm' => Mage::helper('adminhtml')->__('Are you sure you want to do this?')
- )),
- 'index' => 'type',
- 'sortable' => false
- ));
+ if (Mage::helper('backup')->isRollbackAllowed()){
+ $this->addColumn('action', array(
+ 'header' => Mage::helper('backup')->__('Action'),
+ 'type' => 'action',
+ 'width' => '80px',
+ 'filter' => false,
+ 'sortable' => false,
+ 'actions' => array(array(
+ 'url' => '#',
+ 'caption' => Mage::helper('backup')->__('Rollback'),
+ 'onclick' => 'return backup.rollback(\'$type\', \'$time\');'
+ )),
+ 'index' => 'type',
+ 'sortable' => false
+ ));
+ }
return $this;
}
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php
index 2fe8576125..c1f07d1a4b 100644
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php
@@ -31,7 +31,8 @@
* @package Mage_Adminhtml
* @author Magento Core Team
*/
-class Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element
+class Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element
+ extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element
{
/**
* Initialize block template
@@ -101,8 +102,9 @@ public function usedDefault()
if (!$this->getDataObject()->getExistsStoreValueFlag($attributeCode)) {
return true;
- } else if ($this->getElement()->getValue() == $defaultValue &&
- $this->getDataObject()->getStoreId() != $this->_getDefaultStoreId()) {
+ } else if ($this->getElement()->getValue() == $defaultValue &&
+ $this->getDataObject()->getStoreId() != $this->_getDefaultStoreId()
+ ) {
return false;
}
if ($defaultValue === false && !$this->getAttribute()->getIsRequired() && $this->getElement()->getValue()) {
@@ -139,13 +141,11 @@ public function getScopeLabel()
return $html;
}
if ($attribute->isScopeGlobal()) {
- $html.= '[GLOBAL]';
- }
- elseif ($attribute->isScopeWebsite()) {
- $html.= '[WEBSITE]';
- }
- elseif ($attribute->isScopeStore()) {
- $html.= '[STORE VIEW]';
+ $html .= Mage::helper('adminhtml')->__('[GLOBAL]');
+ } elseif ($attribute->isScopeWebsite()) {
+ $html .= Mage::helper('adminhtml')->__('[WEBSITE]');
+ } elseif ($attribute->isScopeStore()) {
+ $html .= Mage::helper('adminhtml')->__('[STORE VIEW]');
}
return $html;
@@ -158,7 +158,12 @@ public function getScopeLabel()
*/
public function getElementLabelHtml()
{
- return $this->getElement()->getLabelHtml();
+ $element = $this->getElement();
+ $label = $element->getLabel();
+ if (empty($label)) {
+ $element->setLabel($this->__($label));
+ }
+ return $element->getLabelHtml();
}
/**
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php
index 2e2fb38f5f..5c1f274a0d 100644
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php
@@ -37,6 +37,10 @@ public function __construct()
parent::__construct();
}
+ /**
+ * Prepares attribute set form
+ *
+ */
protected function _prepareForm()
{
$data = Mage::getModel('eav/entity_attribute_set')
@@ -44,21 +48,19 @@ protected function _prepareForm()
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset('set_name', array('legend'=> Mage::helper('catalog')->__('Edit Set Name')));
- $fieldset->addField('attribute_set_name', 'text',
- array(
- 'label' => Mage::helper('catalog')->__('Name'),
- 'note' => Mage::helper('catalog')->__('For internal use.'),
- 'name' => 'attribute_set_name',
- 'required' => true,
- 'class' => 'required-entry',
- 'value' => $data->getAttributeSetName()
+ $fieldset->addField('attribute_set_name', 'text', array(
+ 'label' => Mage::helper('catalog')->__('Name'),
+ 'note' => Mage::helper('catalog')->__('For internal use.'),
+ 'name' => 'attribute_set_name',
+ 'required' => true,
+ 'class' => 'required-entry validate-no-html-tags',
+ 'value' => $data->getAttributeSetName()
));
if( !$this->getRequest()->getParam('id', false) ) {
- $fieldset->addField('gotoEdit', 'hidden',
- array(
- 'name' => 'gotoEdit',
- 'value' => '1'
+ $fieldset->addField('gotoEdit', 'hidden', array(
+ 'name' => 'gotoEdit',
+ 'value' => '1'
));
$sets = Mage::getModel('eav/entity_attribute_set')
@@ -67,13 +69,12 @@ protected function _prepareForm()
->load()
->toOptionArray();
- $fieldset->addField('skeleton_set', 'select',
- array(
- 'label' => Mage::helper('catalog')->__('Based On'),
- 'name' => 'skeleton_set',
- 'required' => true,
- 'class' => 'required-entry',
- 'values' => $sets,
+ $fieldset->addField('skeleton_set', 'select', array(
+ 'label' => Mage::helper('catalog')->__('Based On'),
+ 'name' => 'skeleton_set',
+ 'required' => true,
+ 'class' => 'required-entry',
+ 'values' => $sets,
));
}
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php
index 90d3312bc6..f10283945a 100644
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php
@@ -79,6 +79,7 @@ protected function _getAdditionalElementTypes()
{
return array(
'price' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_price'),
+ 'weight' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_weight'),
'image' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_image'),
'boolean' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_boolean')
);
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php
index 603e5e4549..1d22ca2ff8 100644
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php
@@ -29,69 +29,79 @@
*
* @category Mage
* @package Mage_Adminhtml
- * @author Magento Core Team
+ * @author Magento Core Team
*/
class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Adminhtml_Block_Catalog_Form
{
/**
- * Load Wysiwyg on demand and Prepare layout
+ * Load Wysiwyg on demand and prepare layout
*/
protected function _prepareLayout()
{
parent::_prepareLayout();
- if (Mage::helper('catalog')->isModuleEnabled('Mage_Cms')) {
- if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
- $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
- }
+ if (Mage::helper('catalog')->isModuleEnabled('Mage_Cms')
+ && Mage::getSingleton('cms/wysiwyg_config')->isEnabled()
+ ) {
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
}
}
+ /**
+ * Prepare attributes form
+ *
+ * @return null
+ */
protected function _prepareForm()
{
- if ($group = $this->getGroup()) {
+ $group = $this->getGroup();
+ if ($group) {
$form = new Varien_Data_Form();
- /**
- * Initialize product object as form property
- * for using it in elements generation
- */
+
+ // Initialize product object as form property to use it during elements generation
$form->setDataObject(Mage::registry('product'));
- $fieldset = $form->addFieldset('group_fields'.$group->getId(),
- array(
- 'legend'=>Mage::helper('catalog')->__($group->getAttributeGroupName()),
- 'class'=>'fieldset-wide',
+ $fieldset = $form->addFieldset('group_fields' . $group->getId(), array(
+ 'legend' => Mage::helper('catalog')->__($group->getAttributeGroupName()),
+ 'class' => 'fieldset-wide'
));
$attributes = $this->getGroupAttributes();
$this->_setFieldset($attributes, $fieldset, array('gallery'));
- if ($urlKey = $form->getElement('url_key')) {
+ $urlKey = $form->getElement('url_key');
+ if ($urlKey) {
$urlKey->setRenderer(
$this->getLayout()->createBlock('adminhtml/catalog_form_renderer_attribute_urlkey')
);
}
- if ($tierPrice = $form->getElement('tier_price')) {
+ $tierPrice = $form->getElement('tier_price');
+ if ($tierPrice) {
$tierPrice->setRenderer(
$this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_price_tier')
);
}
- if ($recurringProfile = $form->getElement('recurring_profile')) {
+ $groupPrice = $form->getElement('group_price');
+ if ($groupPrice) {
+ $groupPrice->setRenderer(
+ $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_price_group')
+ );
+ }
+
+ $recurringProfile = $form->getElement('recurring_profile');
+ if ($recurringProfile) {
$recurringProfile->setRenderer(
$this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_price_recurring')
);
}
- /**
- * Add new attribute button if not image tab
- */
+ // Add new attribute button if it is not an image tab
if (!$form->getElement('media_gallery')
- && Mage::getSingleton('admin/session')->isAllowed('catalog/attributes/attributes')) {
- $headerBar = $this->getLayout()->createBlock(
- 'adminhtml/catalog_product_edit_tab_attributes_create'
- );
+ && Mage::getSingleton('admin/session')->isAllowed('catalog/attributes/attributes')
+ ) {
+ $headerBar = $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_attributes_create');
$headerBar->getConfig()
->setTabId('group_' . $group->getId())
@@ -101,9 +111,7 @@ protected function _prepareForm()
->setTypeId($form->getDataObject()->getTypeId())
->setProductId($form->getDataObject()->getId());
- $fieldset->setHeaderBar(
- $headerBar->toHtml()
- );
+ $fieldset->setHeaderBar($headerBar->toHtml());
}
if ($form->getElement('meta_description')) {
@@ -111,9 +119,8 @@ protected function _prepareForm()
}
$values = Mage::registry('product')->getData();
- /**
- * Set attribute default values for new product
- */
+
+ // Set default attribute values for new product
if (!Mage::registry('product')->getId()) {
foreach ($attributes as $attribute) {
if (!isset($values[$attribute->getAttributeCode()])) {
@@ -124,7 +131,8 @@ protected function _prepareForm()
if (Mage::registry('product')->hasLockedAttributes()) {
foreach (Mage::registry('product')->getLockedAttributes() as $attribute) {
- if ($element = $form->getElement($attribute)) {
+ $element = $form->getElement($attribute);
+ if ($element) {
$element->setReadonly(true, true);
}
}
@@ -132,16 +140,22 @@ protected function _prepareForm()
$form->addValues($values);
$form->setFieldNameSuffix('product');
- Mage::dispatchEvent('adminhtml_catalog_product_edit_prepare_form', array('form'=>$form));
+ Mage::dispatchEvent('adminhtml_catalog_product_edit_prepare_form', array('form' => $form));
$this->setForm($form);
}
}
+ /**
+ * Retrieve additional element types
+ *
+ * @return array
+ */
protected function _getAdditionalElementTypes()
{
$result = array(
'price' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_price'),
+ 'weight' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_weight'),
'gallery' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_gallery'),
'image' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_image'),
'boolean' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_boolean'),
@@ -150,9 +164,9 @@ protected function _getAdditionalElementTypes()
$response = new Varien_Object();
$response->setTypes(array());
- Mage::dispatchEvent('adminhtml_catalog_product_edit_element_types', array('response'=>$response));
+ Mage::dispatchEvent('adminhtml_catalog_product_edit_element_types', array('response' => $response));
- foreach ($response->getTypes() as $typeName=>$typeClass) {
+ foreach ($response->getTypes() as $typeName => $typeClass) {
$result[$typeName] = $typeClass;
}
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php
index 8047c61e42..f10e04f1c9 100644
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php
@@ -29,13 +29,16 @@
*
* @category Mage
* @package Mage_Adminhtml
- * @author Magento Core Team
+ * @author Magento Core Team
*/
class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Categories extends Mage_Adminhtml_Block_Catalog_Category_Tree
{
protected $_categoryIds;
protected $_selectedNodes = null;
+ /**
+ * Specify template to use
+ */
public function __construct()
{
parent::__construct();
@@ -62,19 +65,33 @@ public function isReadonly()
return $this->getProduct()->getCategoriesReadonly();
}
+ /**
+ * Return array with category IDs which the product is assigned to
+ *
+ * @return array
+ */
protected function getCategoryIds()
{
return $this->getProduct()->getCategoryIds();
}
+ /**
+ * Forms string out of getCategoryIds()
+ *
+ * @return string
+ */
public function getIdsString()
{
return implode(',', $this->getCategoryIds());
}
+ /**
+ * Returns root node and sets 'checked' flag (if necessary)
+ *
+ * @return Varien_Data_Tree_Node
+ */
public function getRootNode()
{
-// $root = parent::getRoot();
$root = $this->getRoot();
if ($root && in_array($root->getId(), $this->getCategoryIds())) {
$root->setChecked(true);
@@ -82,7 +99,14 @@ public function getRootNode()
return $root;
}
- public function getRoot($parentNodeCategory=null, $recursionLevel=3)
+ /**
+ * Returns root node
+ *
+ * @param Mage_Catalog_Model_Category|null $parentNodeCategory
+ * @param int $recursionLevel
+ * @return Varien_Data_Tree_Node
+ */
+ public function getRoot($parentNodeCategory = null, $recursionLevel = 3)
{
if (!is_null($parentNodeCategory) && $parentNodeCategory->getId()) {
return $this->getNode($parentNodeCategory, $recursionLevel);
@@ -127,21 +151,21 @@ public function getRoot($parentNodeCategory=null, $recursionLevel=3)
return $root;
}
- protected function _getNodeJson($node, $level=1)
+ /**
+ * Returns array with configuration of current node
+ *
+ * @param Varien_Data_Tree_Node $node
+ * @param int $level How deep is the node in the tree
+ * @return array
+ */
+ protected function _getNodeJson($node, $level = 1)
{
$item = parent::_getNodeJson($node, $level);
- $isParent = $this->_isParentSelectedCategory($node);
-
- if ($isParent) {
+ if ($this->_isParentSelectedCategory($node)) {
$item['expanded'] = true;
}
-// if ($node->getLevel() > 1 && !$isParent && isset($item['children'])) {
-// $item['children'] = array();
-// }
-
-
if (in_array($node->getId(), $this->getCategoryIds())) {
$item['checked'] = true;
}
@@ -149,23 +173,41 @@ protected function _getNodeJson($node, $level=1)
if ($this->isReadonly()) {
$item['disabled'] = true;
}
+
return $item;
}
+ /**
+ * Returns whether $node is a parent (not exactly direct) of a selected node
+ *
+ * @param Varien_Data_Tree_Node $node
+ * @return bool
+ */
protected function _isParentSelectedCategory($node)
{
- foreach ($this->_getSelectedNodes() as $selected) {
- if ($selected) {
- $pathIds = explode('/', $selected->getPathId());
- if (in_array($node->getId(), $pathIds)) {
- return true;
+ $result = false;
+ // Contains string with all category IDs of children (not exactly direct) of the node
+ $allChildren = $node->getAllChildren();
+ if ($allChildren) {
+ $selectedCategoryIds = $this->getCategoryIds();
+ $allChildrenArr = explode(',', $allChildren);
+ for ($i = 0, $cnt = count($selectedCategoryIds); $i < $cnt; $i++) {
+ $isSelf = $node->getId() == $selectedCategoryIds[$i];
+ if (!$isSelf && in_array($selectedCategoryIds[$i], $allChildrenArr)) {
+ $result = true;
+ break;
}
}
}
- return false;
+ return $result;
}
+ /**
+ * Returns array with nodes those are selected (contain current product)
+ *
+ * @return array
+ */
protected function _getSelectedNodes()
{
if ($this->_selectedNodes === null) {
@@ -181,6 +223,12 @@ protected function _getSelectedNodes()
return $this->_selectedNodes;
}
+ /**
+ * Returns JSON-encoded array of category children
+ *
+ * @param int $categoryId
+ * @return string
+ */
public function getCategoryChildrenJson($categoryId)
{
$category = Mage::getModel('catalog/category')->load($categoryId);
@@ -198,15 +246,21 @@ public function getCategoryChildrenJson($categoryId)
return Mage::helper('core')->jsonEncode($children);
}
- public function getLoadTreeUrl($expanded=null)
+ /**
+ * Returns URL for loading tree
+ *
+ * @param null $expanded
+ * @return string
+ */
+ public function getLoadTreeUrl($expanded = null)
{
- return $this->getUrl('*/*/categoriesJson', array('_current'=>true));
+ return $this->getUrl('*/*/categoriesJson', array('_current' => true));
}
/**
* Return distinct path ids of selected categories
*
- * @param int $rootId Root category Id for context
+ * @param mixed $rootId Root category Id for context
* @return array
*/
public function getSelectedCategoriesPathIds($rootId = false)
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php
new file mode 100644
index 0000000000..f305e78046
--- /dev/null
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php
@@ -0,0 +1,96 @@
+
+ */
+class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group
+ extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract
+{
+ /**
+ * Initialize block
+ */
+ public function __construct()
+ {
+ $this->setTemplate('catalog/product/edit/price/group.phtml');
+ }
+
+ /**
+ * Sort values
+ *
+ * @param array $data
+ * @return array
+ */
+ protected function _sortValues($data)
+ {
+ usort($data, array($this, '_sortGroupPrices'));
+ return $data;
+ }
+
+ /**
+ * Sort group price values callback method
+ *
+ * @param array $a
+ * @param array $b
+ * @return int
+ */
+ protected function _sortGroupPrices($a, $b)
+ {
+ if ($a['website_id'] != $b['website_id']) {
+ return $a['website_id'] < $b['website_id'] ? -1 : 1;
+ }
+ if ($a['cust_group'] != $b['cust_group']) {
+ return $this->getCustomerGroups($a['cust_group']) < $this->getCustomerGroups($b['cust_group']) ? -1 : 1;
+ }
+ return 0;
+ }
+
+ /**
+ * Prepare global layout
+ *
+ * Add "Add Group Price" button to layout
+ *
+ * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group
+ */
+ protected function _prepareLayout()
+ {
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
+ ->setData(array(
+ 'label' => Mage::helper('catalog')->__('Add Group Price'),
+ 'onclick' => 'return groupPriceControl.addItem()',
+ 'class' => 'add'
+ ));
+ $button->setName('add_group_price_item_button');
+
+ $this->setChild('add_button', $button);
+ return parent::_prepareLayout();
+ }
+
+}
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php
new file mode 100644
index 0000000000..89cfbe4488
--- /dev/null
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php
@@ -0,0 +1,347 @@
+
+ */
+abstract class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract
+ extends Mage_Adminhtml_Block_Widget
+ implements Varien_Data_Form_Element_Renderer_Interface
+{
+ /**
+ * Form element instance
+ *
+ * @var Varien_Data_Form_Element_Abstract
+ */
+ protected $_element;
+
+ /**
+ * Customer groups cache
+ *
+ * @var array
+ */
+ protected $_customerGroups;
+
+ /**
+ * Websites cache
+ *
+ * @var array
+ */
+ protected $_websites;
+
+ /**
+ * Retrieve current product instance
+ *
+ * @return Mage_Catalog_Model_Product
+ */
+ public function getProduct()
+ {
+ return Mage::registry('product');
+ }
+
+ /**
+ * Render HTML
+ *
+ * @param Varien_Data_Form_Element_Abstract $element
+ * @return string
+ */
+ public function render(Varien_Data_Form_Element_Abstract $element)
+ {
+ $this->setElement($element);
+ return $this->toHtml();
+ }
+
+ /**
+ * Set form element instance
+ *
+ * @param Varien_Data_Form_Element_Abstract $element
+ * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract
+ */
+ public function setElement(Varien_Data_Form_Element_Abstract $element)
+ {
+ $this->_element = $element;
+ return $this;
+ }
+
+ /**
+ * Retrieve form element instance
+ *
+ * @return Varien_Data_Form_Element_Abstract
+ */
+ public function getElement()
+ {
+ return $this->_element;
+ }
+
+ /**
+ * Prepare group price values
+ *
+ * @return array
+ */
+ public function getValues()
+ {
+ $values = array();
+ $data = $this->getElement()->getValue();
+
+ if (is_array($data)) {
+ $values = $this->_sortValues($data);
+ }
+
+ foreach ($values as &$value) {
+ $value['readonly'] = ($value['website_id'] == 0)
+ && $this->isShowWebsiteColumn()
+ && !$this->isAllowChangeWebsite();
+ }
+
+ return $values;
+ }
+
+ /**
+ * Sort values
+ *
+ * @param array $data
+ * @return array
+ */
+ protected function _sortValues($data)
+ {
+ return $data;
+ }
+
+ /**
+ * Retrieve allowed customer groups
+ *
+ * @param int|null $groupId return name by customer group id
+ * @return array|string
+ */
+ public function getCustomerGroups($groupId = null)
+ {
+ if ($this->_customerGroups === null) {
+ if (!Mage::helper('catalog')->isModuleEnabled('Mage_Customer')) {
+ return array();
+ }
+ $collection = Mage::getModel('customer/group')->getCollection();
+ $this->_customerGroups = $this->_getInitialCustomerGroups();
+
+ foreach ($collection as $item) {
+ /** @var $item Mage_Customer_Model_Group */
+ $this->_customerGroups[$item->getId()] = $item->getCustomerGroupCode();
+ }
+ }
+
+ if ($groupId !== null) {
+ return isset($this->_customerGroups[$groupId]) ? $this->_customerGroups[$groupId] : array();
+ }
+
+ return $this->_customerGroups;
+ }
+
+ /**
+ * Retrieve list of initial customer groups
+ *
+ * @return array
+ */
+ protected function _getInitialCustomerGroups()
+ {
+ return array();
+ }
+
+ /**
+ * Retrieve number of websites
+ *
+ * @return int
+ */
+ public function getWebsiteCount()
+ {
+ return count($this->getWebsites());
+ }
+
+ /**
+ * Show website column and switcher for group price table
+ *
+ * @return bool
+ */
+ public function isMultiWebsites()
+ {
+ return !Mage::app()->isSingleStoreMode();
+ }
+
+ /**
+ * Retrieve allowed for edit websites
+ *
+ * @return array
+ */
+ public function getWebsites()
+ {
+ if (!is_null($this->_websites)) {
+ return $this->_websites;
+ }
+
+ $this->_websites = array(
+ 0 => array(
+ 'name' => Mage::helper('catalog')->__('All Websites'),
+ 'currency' => Mage::app()->getBaseCurrencyCode()
+ )
+ );
+
+ if (!$this->isScopeGlobal() && $this->getProduct()->getStoreId()) {
+ /** @var $website Mage_Core_Model_Website */
+ $website = Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsite();
+
+ $this->_websites[$website->getId()] = array(
+ 'name' => $website->getName(),
+ 'currency' => $website->getBaseCurrencyCode()
+ );
+ } elseif (!$this->isScopeGlobal()) {
+ $websites = Mage::app()->getWebsites(false);
+ $productWebsiteIds = $this->getProduct()->getWebsiteIds();
+ foreach ($websites as $website) {
+ /** @var $website Mage_Core_Model_Website */
+ if (!in_array($website->getId(), $productWebsiteIds)) {
+ continue;
+ }
+ $this->_websites[$website->getId()] = array(
+ 'name' => $website->getName(),
+ 'currency' => $website->getBaseCurrencyCode()
+ );
+ }
+ }
+
+ return $this->_websites;
+ }
+
+ /**
+ * Retrieve default value for customer group
+ *
+ * @return int
+ */
+ public function getDefaultCustomerGroup()
+ {
+ return Mage_Customer_Model_Group::CUST_GROUP_ALL;
+ }
+
+ /**
+ * Retrieve default value for website
+ *
+ * @return int
+ */
+ public function getDefaultWebsite()
+ {
+ if ($this->isShowWebsiteColumn() && !$this->isAllowChangeWebsite()) {
+ return Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsiteId();
+ }
+ return 0;
+ }
+
+ /**
+ * Retrieve 'add group price item' button HTML
+ *
+ * @return string
+ */
+ public function getAddButtonHtml()
+ {
+ return $this->getChildHtml('add_button');
+ }
+
+ /**
+ * Retrieve customized price column header
+ *
+ * @param string $default
+ * @return string
+ */
+ public function getPriceColumnHeader($default)
+ {
+ if ($this->hasData('price_column_header')) {
+ return $this->getData('price_column_header');
+ } else {
+ return $default;
+ }
+ }
+
+ /**
+ * Retrieve customized price column header
+ *
+ * @param string $default
+ * @return string
+ */
+ public function getPriceValidation($default)
+ {
+ if ($this->hasData('price_validation')) {
+ return $this->getData('price_validation');
+ } else {
+ return $default;
+ }
+ }
+
+ /**
+ * Retrieve Group Price entity attribute
+ *
+ * @return Mage_Catalog_Model_Resource_Eav_Attribute
+ */
+ public function getAttribute()
+ {
+ return $this->getElement()->getEntityAttribute();
+ }
+
+ /**
+ * Check group price attribute scope is global
+ *
+ * @return bool
+ */
+ public function isScopeGlobal()
+ {
+ return $this->getAttribute()->isScopeGlobal();
+ }
+
+ /**
+ * Show group prices grid website column
+ *
+ * @return bool
+ */
+ public function isShowWebsiteColumn()
+ {
+ if ($this->isScopeGlobal() || Mage::app()->isSingleStoreMode()) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Check is allow change website value for combination
+ *
+ * @return bool
+ */
+ public function isAllowChangeWebsite()
+ {
+ if (!$this->isShowWebsiteColumn() || $this->getProduct()->getStoreId()) {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php
index bc048fc300..084b703704 100644
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php
@@ -32,33 +32,11 @@
* @author Magento Core Team
*/
class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier
- extends Mage_Adminhtml_Block_Widget
- implements Varien_Data_Form_Element_Renderer_Interface
+ extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract
{
- /**
- * Form element instance
- *
- * @var Varien_Data_Form_Element
- */
- protected $_element;
/**
- * Customer Groups cache
- *
- * @var array
- */
- protected $_customerGroups;
-
- /**
- * Websites cache
- *
- * @var array
- */
- protected $_websites;
-
- /**
- * Define tier price template file
- *
+ * Initialize block
*/
public function __construct()
{
@@ -66,69 +44,25 @@ public function __construct()
}
/**
- * Retrieve current edit product instance
- *
- * @return Mage_Catalog_Model_Product
- */
- public function getProduct()
- {
- return Mage::registry('product');
- }
-
- /**
- * Render HTML
+ * Retrieve list of initial customer groups
*
- * @param Varien_Data_Form_Element_Abstract $element
- * @return string
- */
- public function render(Varien_Data_Form_Element_Abstract $element)
- {
- $this->setElement($element);
- return $this->toHtml();
- }
-
- /**
- * Set form element instance
- *
- * @param Varien_Data_Form_Element_Abstract $element
- * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier
- */
- public function setElement(Varien_Data_Form_Element_Abstract $element)
- {
- $this->_element = $element;
- return $this;
- }
-
- /**
- * Retrieve form element instance
- *
- * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier
+ * @return array
*/
- public function getElement()
+ protected function _getInitialCustomerGroups()
{
- return $this->_element;
+ return array(Mage_Customer_Model_Group::CUST_GROUP_ALL => Mage::helper('catalog')->__('ALL GROUPS'));
}
/**
- * Prepare Tier Price values
+ * Sort values
*
+ * @param array $data
* @return array
*/
- public function getValues()
+ protected function _sortValues($data)
{
- $values = array();
- $data = $this->getElement()->getValue();
-
- if (is_array($data)) {
- usort($data, array($this, '_sortTierPrices'));
- $values = $data;
- }
-
- foreach ($values as &$v) {
- $v['readonly'] = $v['website_id'] == 0 && $this->isShowWebsiteColumn() && !$this->isAllowChangeWebsite();
- }
-
- return $values;
+ usort($data, array($this, '_sortTierPrices'));
+ return $data;
}
/**
@@ -153,123 +87,6 @@ protected function _sortTierPrices($a, $b)
return 0;
}
- /**
- * Retrieve allowed customer groups
- *
- * @param int $groupId return name by customer group id
- * @return array|string
- */
- public function getCustomerGroups($groupId = null)
- {
- if ($this->_customerGroups === null) {
- if (!Mage::helper('catalog')->isModuleEnabled('Mage_Customer')) {
- return array();
- }
- $collection = Mage::getModel('customer/group')->getCollection();
- $this->_customerGroups = array(
- Mage_Customer_Model_Group::CUST_GROUP_ALL => Mage::helper('catalog')->__('ALL GROUPS')
- );
-
- foreach ($collection as $item) {
- /* @var $item Mage_Customer_Model_Group */
- $this->_customerGroups[$item->getId()] = $item->getCustomerGroupCode();
- }
- }
-
- if ($groupId !== null) {
- return isset($this->_customerGroups[$groupId]) ? $this->_customerGroups[$groupId] : array();
- }
-
- return $this->_customerGroups;
- }
-
- /**
- * Retrieve count of websites
- *
- * @return int
- */
- public function getWebsiteCount()
- {
- return count($this->getWebsites());
- }
-
- /**
- * Show Website column and switcher for tier price table
- *
- * @return bool
- */
- public function isMultiWebsites()
- {
- return !Mage::app()->isSingleStoreMode();
- }
-
- /**
- * Retrieve allowed for edit websites
- *
- * @return array
- */
- public function getWebsites()
- {
- if (!is_null($this->_websites)) {
- return $this->_websites;
- }
-
- $this->_websites = array(
- 0 => array(
- 'name' => Mage::helper('catalog')->__('All Websites'),
- 'currency' => Mage::app()->getBaseCurrencyCode()
- )
- );
-
- if (!$this->isScopeGlobal() && $this->getProduct()->getStoreId()) {
- /* @var $website Mage_Core_Model_Website */
- $website = Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsite();
-
- $this->_websites[$website->getId()] = array(
- 'name' => $website->getName(),
- 'currency' => $website->getBaseCurrencyCode()
- );
- } else if (!$this->isScopeGlobal()) {
- $websites = Mage::app()->getWebsites(false);
- $productWebsiteIds = $this->getProduct()->getWebsiteIds();
- foreach ($websites as $website) {
- /* @var $website Mage_Core_Model_Website */
- if (!in_array($website->getId(), $productWebsiteIds)) {
- continue;
- }
- $this->_websites[$website->getId()] = array(
- 'name' => $website->getName(),
- 'currency' => $website->getBaseCurrencyCode()
- );
- }
- }
-
- return $this->_websites;
- }
-
- /**
- * Retrieve default value for customer group
- *
- * @return int
- */
- public function getDefaultCustomerGroup()
- {
- return Mage_Customer_Model_Group::CUST_GROUP_ALL;
- }
-
- /**
- * Retrieve default value for website
- *
- * @return int
- */
- public function getDefaultWebsite()
- {
- if ($this->isShowWebsiteColumn() && !$this->isAllowChangeWebsite()) {
- return Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsiteId();
- }
- return 0;
- }
-
/**
* Prepare global layout
* Add "Add tier" button to layout
@@ -280,9 +97,9 @@ protected function _prepareLayout()
{
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
->setData(array(
- 'label' => Mage::helper('catalog')->__('Add Tier'),
- 'onclick' => 'return tierPriceControl.addItem()',
- 'class' => 'add'
+ 'label' => Mage::helper('catalog')->__('Add Tier'),
+ 'onclick' => 'return tierPriceControl.addItem()',
+ 'class' => 'add'
));
$button->setName('add_tier_price_item_button');
@@ -290,93 +107,4 @@ protected function _prepareLayout()
return parent::_prepareLayout();
}
- /**
- * Retrieve Add Tier Price Item button HTML
- *
- * @return string
- */
- public function getAddButtonHtml()
- {
- return $this->getChildHtml('add_button');
- }
-
- /**
- * Returns customized price column header
- * that was seted through set...
- *
- * @param string $default
- * @return string
- */
- public function getPriceColumnHeader($default)
- {
- if ($this->hasData('price_column_header')) {
- return $this->getData('price_column_header');
- } else {
- return $default;
- }
- }
-
- /**
- * Returns customized price column header
- * that was seted through set...
- *
- * @param string $default
- * @return string
- */
- public function getPriceValidation($default)
- {
- if ($this->hasData('price_validation')) {
- return $this->getData('price_validation');
- } else {
- return $default;
- }
- }
-
- /**
- * Retrieve Tier Price entity attribute
- *
- * @return Mage_Catalog_Model_Resource_Eav_Attribute
- */
- public function getAttribute()
- {
- return $this->getElement()->getEntityAttribute();
- }
-
- /**
- * Check tier price attribute scope is global
- *
- * @return bool
- */
- public function isScopeGlobal()
- {
- return $this->getAttribute()->isScopeGlobal();
- }
-
- /**
- * Show tier prices grid website column
- *
- * @return bool
- */
- public function isShowWebsiteColumn()
- {
- if ($this->isScopeGlobal()) {
- return false;
- } else if (Mage::app()->isSingleStoreMode()) {
- return false;
- }
- return true;
- }
-
- /**
- * Check is allow change website value for combination
- *
- * @return bool
- */
- public function isAllowChangeWebsite()
- {
- if (!$this->isShowWebsiteColumn() || $this->getProduct()->getStoreId()) {
- return false;
- }
- return true;
- }
}
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php
index 31a6a229ee..19a5dd01a8 100644
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php
@@ -66,7 +66,28 @@ public function getTabClass()
*/
public function isReadonly()
{
- return $this->_getProduct()->getCompositeReadonly();
+ return (bool) $this->_getProduct()->getCompositeReadonly();
+ }
+
+ /**
+ * Check whether attributes of configurable products can be editable
+ *
+ * @return boolean
+ */
+ public function isAttributesConfigurationReadonly()
+ {
+ return (bool) $this->_getProduct()->getAttributesConfigurationReadonly();
+ }
+
+ /**
+ * Check whether prices of configurable products can be editable
+ *
+ * @return boolean
+ */
+ public function isAttributesPricesReadonly()
+ {
+ return $this->_getProduct()->getAttributesConfigurationReadonly() ||
+ (Mage::helper('catalog')->isPriceGlobal() && $this->isReadonly());
}
/**
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php
index f37f5ed297..e9bc8ac3ff 100644
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php
@@ -31,7 +31,8 @@
* @package Mage_Adminhtml
* @author Magento Core Team
*/
-class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes
+class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple
+ extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes
{
/**
* Link to currently editing product
@@ -56,7 +57,7 @@ protected function _prepareForm()
'additional' => array('name', 'sku', 'visibility', 'status')
);
- $availableTypes = array('text', 'select', 'multiselect', 'textarea', 'price');
+ $availableTypes = array('text', 'select', 'multiselect', 'textarea', 'price', 'weight');
$attributes = Mage::getModel('catalog/product')
->setTypeId(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE)
@@ -70,10 +71,12 @@ protected function _prepareForm()
// If not applied to configurable
&& !in_array(Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE, $attribute->getApplyTo())
// If not used in configurable
- && !in_array($attribute->getId(),$this->_getProduct()->getTypeInstance(true)->getUsedProductAttributeIds($this->_getProduct())))
+ && !in_array($attribute->getId(),
+ $this->_getProduct()->getTypeInstance(true)->getUsedProductAttributeIds($this->_getProduct()))
+ )
// Or in additional
- || in_array($attribute->getAttributeCode(), $attributesConfig['additional'])) {
-
+ || in_array($attribute->getAttributeCode(), $attributesConfig['additional'])
+ ) {
$inputType = $attribute->getFrontend()->getInputType();
if (!in_array($inputType, $availableTypes)) {
continue;
@@ -112,7 +115,8 @@ protected function _prepareForm()
}
/* Configurable attributes */
- foreach ($this->_getProduct()->getTypeInstance(true)->getUsedProductAttributes($this->_getProduct()) as $attribute) {
+ $usedAttributes = $this->_getProduct()->getTypeInstance(true)->getUsedProductAttributes($this->_getProduct());
+ foreach ($usedAttributes as $attribute) {
$attributeCode = $attribute->getAttributeCode();
$fieldset->addField( 'simple_product_' . $attributeCode, 'select', array(
'label' => $attribute->getFrontend()->getLabel(),
@@ -176,8 +180,6 @@ protected function _prepareForm()
)
));
-
-
$this->setForm($form);
}
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php
index 29699db2ab..25cb6473e5 100644
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php
@@ -73,11 +73,46 @@ protected function _prepareCollection()
//$collection->setStoreId($store->getId());
$adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;
$collection->addStoreFilter($store);
- $collection->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner', $adminStore);
- $collection->joinAttribute('custom_name', 'catalog_product/name', 'entity_id', null, 'inner', $store->getId());
- $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner', $store->getId());
- $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', $store->getId());
- $collection->joinAttribute('price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId());
+ $collection->joinAttribute(
+ 'name',
+ 'catalog_product/name',
+ 'entity_id',
+ null,
+ 'inner',
+ $adminStore
+ );
+ $collection->joinAttribute(
+ 'custom_name',
+ 'catalog_product/name',
+ 'entity_id',
+ null,
+ 'inner',
+ $store->getId()
+ );
+ $collection->joinAttribute(
+ 'status',
+ 'catalog_product/status',
+ 'entity_id',
+ null,
+ 'inner',
+ $store->getId()
+ );
+ $collection->joinAttribute(
+ 'visibility',
+ 'catalog_product/visibility',
+ 'entity_id',
+ null,
+ 'inner',
+ $store->getId()
+ );
+ $collection->joinAttribute(
+ 'price',
+ 'catalog_product/price',
+ 'entity_id',
+ null,
+ 'left',
+ $store->getId()
+ );
}
else {
$collection->addAttributeToSelect('price');
@@ -273,6 +308,7 @@ protected function _prepareMassaction()
));
}
+ Mage::dispatchEvent('adminhtml_catalog_product_grid_prepare_massaction', array('block' => $this));
return $this;
}
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php
index 117ff858aa..f3a0a6d8bb 100644
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php
@@ -92,7 +92,7 @@ public function usedDefault($attribute)
if (!$this->getDataObject()->getExistsStoreValueFlag($attributeCode)) {
return true;
- } else if ($this->getValue() == $defaultValue &&
+ } else if ($this->getValue() == $defaultValue &&
$this->getDataObject()->getStoreId() != $this->_getDefaultStoreId()) {
return false;
}
@@ -118,13 +118,11 @@ public function getScopeLabel($attribute)
}
if ($attribute->isScopeGlobal()) {
- $html.= ' [GLOBAL]';
- }
- elseif ($attribute->isScopeWebsite()) {
- $html.= ' [WEBSITE]';
- }
- elseif ($attribute->isScopeStore()) {
- $html.= ' [STORE VIEW]';
+ $html .= ' ' . Mage::helper('adminhtml')->__('[GLOBAL]');
+ } elseif ($attribute->isScopeWebsite()) {
+ $html .= ' ' . Mage::helper('adminhtml')->__('[WEBSITE]');
+ } elseif ($attribute->isScopeStore()) {
+ $html .= ' ' . Mage::helper('adminhtml')->__('[STORE VIEW]');
}
return $html;
}
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php
new file mode 100644
index 0000000000..cd2819c8b8
--- /dev/null
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php
@@ -0,0 +1,45 @@
+
+ */
+class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight extends Varien_Data_Form_Element_Text
+{
+ /*
+ * Add validate-zero-or-greater css class to weigh field
+ * for input validation
+ */
+ public function __construct($attributes=array())
+ {
+ parent::__construct($attributes);
+ $this->addClass('validate-zero-or-greater');
+ }
+}
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php
index b986a9d212..37e25698a3 100644
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php
@@ -100,8 +100,8 @@ public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
public function getCheckboxCheckCallback()
{
if ($this->getUseMassaction()) {
- return "function (grid, event) {
- $(grid.containerId).fire('product:changed', {});
+ return "function (grid, element) {
+ $(grid.containerId).fire('product:changed', {element: element});
}";
}
}
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php
index 74d01c7022..bec9f801df 100644
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php
@@ -104,48 +104,41 @@ protected function _prepareForm()
if ($model->getId()) {
$fieldset->addField('num_results', 'text', array(
- 'name' => 'num_results',
- 'label' => Mage::helper('catalog')->__('Number of results (For the last time placed)'),
- 'title' => Mage::helper('catalog')->__('Number of results (For the last time placed)'),
- 'required' => true,
+ 'name' => 'num_results',
+ 'label' => Mage::helper('catalog')->__('Number of results'),
+ 'title' => Mage::helper('catalog')->__('Number of results (For the last time placed)'),
+ 'note' => Mage::helper('catalog')->__('For the last time placed.'),
+ 'required' => true,
));
$fieldset->addField('popularity', 'text', array(
- 'name' => 'popularity',
- 'label' => Mage::helper('catalog')->__('Number of Uses'),
- 'title' => Mage::helper('catalog')->__('Number of Uses'),
- 'required' => true,
+ 'name' => 'popularity',
+ 'label' => Mage::helper('catalog')->__('Number of Uses'),
+ 'title' => Mage::helper('catalog')->__('Number of Uses'),
+ 'required' => true,
));
}
- $afterElementHtml = '
'
- . Mage::helper('catalog')->__('(Will make search for the query above return results for this search.)')
- . '