Permalink
Browse files

Merged revisions 32407-33162 via svnmerge from 1.2-trunk

    Changed logic of enabling purchased links (now it depends on order item status, not entire order status)
    Implemented selling downloadable products through bundles, configurable and grouped products
    Added checking for InnoDB support during installation
    Added target country selection in Google Base attribute mappings
    Replaced raw id with hashed value for downloadable product links
    Set http_only flag on cookies, set secure flag on backend cookies
    Added downloading saved links files in admin
    Added indices in sales tables to increase performance
    Optimized translations cache (cache only translated strings)
    Moved resource model unique fields declaration from _construct method to _initUniqueFields which is called just before saving data (that helps to fix store/website error messages and optimizes initialize process)
    Added grouped renderers and changed existing to display renderer of the actual product (sold as part of grouped)
    Changed category deletion process - run one query for delete children instead load all children objects and call delete method
    Improved checking stock status of complex product types
    Blank theme HTML/CSS improvements
    Modern theme HTML/CSS improvements and bugfixes for IE

    fixed bug with store switcher on https
    Set 503 HTTP response code on error reports
    Removed foreign key duplicates
    Moved CMS page load call to frontend area
    Fixing weee tax collapse for all themes
    Fixing admin login and forgot password forms
    Fixed weee taxes for IE
    Fixed upgrade version from config.xml without upgrade file
    Fixed parsing of downloadable link file name form file path in Windows
    Fixed osCommerce import
    Fixed js alert message text on clear compare list
    Fixed error logging in API
    Fixed empty cell for customer reviews list table under IE
    Fixed cookie object, fixed getting request/response objects in cookie
    Fixed checkout of download products as part of bundle or configurable
    Fixed addAttribute function for flat entities and added upgrade for converting DB
    Fixed abstract renderer for simple items in order
    Fixed Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group
    Fixed IE error when toggle didn't change expander class name
    Fixed #5723: Text "View All" not localized in sidebar for all themes excepting default
    Fixed #6560: A few translation fixes for Modern theme.
    Fixed #6746: Customer Information Leak
    Fixed #7086: Configurable Product -> Product View -> Associated products drop-down does not display price incl. tax
    Fixed #7454: Active parent category NOT shown in breadcrumbs
    Fixed #9435: Notify Low Stock RSS gives 404
    Fixed #9664: Adminpanel broken - Parent Role id 'G4' does not exist
    Fixed #9715: Creating Customer on Admin>New Order lacks email Validation
    Fixed #9730: Google Checkout Allowed Methods not working correctly
    Fixed #9755: Authorisenet email address
    Fixed #9780: Downloadable link still enabled in myaccount after disabling the downloadable products module
    Fixed #9782: No support for selling downloadable products through bundles or configurable products
    Fixed #9783: Add new country codes from ISO 3166-1:2006
    Fixed #9787: Zero price on downloadable product view page
    Fixed #9795: Extra symbols in links.phtml
    Fixed #9803: SQL state error when searching newsletter subscribers by any filter
    Fixed #9817: Orders collection counting performance leak
    Fixed #9818: Out of memory crash when changing customers scope
    Fixed #9831: To many downloadable links after PayPal payment
    Fixed #9841: Rebuild Search Index Crashes
    Fixed #9872: Fatal error - Attempting to edit System > Permissions > Roles (related #9970, #9982, #9946, #10059)
    Fixed #9899: Attribute with URL displays HTML code (Added "Allowed HTML-tags on Front-end" option to attribute)
    Fixed #9901: iDeal & discounts on products break payment without error
    Fixed #9904: Product sort breaks on name if layered navigation is after product list
    Fixed #9910: Syntax error can lead to SQL error in directory/region_collection
    Fixed #9925: Mage_Directory_Model_Region -> loadByName
    Fixed #9926: Wrong navigation link class after a catalog cache refresh
    Fixed #9930: google site map with problens when generating via cron job
    Fixed #9933: Wrong date time conversion in Tracking Module
    Fixed #9938: Underfined error during saving product
    Fixed #9960: Not Removing Product from category
    Fixed #9993: Database Log Cleaning
    Fixed #10020: Problem with catalog/block/product/list Best Value sort
    Fixed #10021: Admin Dashboard links not working
    Fixed #10023: Function Special Price does not work!
    Fixed #10071: Unable to create promotions using "search in the SKU table"
    Fixed #10080: Number of My Downloadable Products link are increased after google checkout
    Fixed #10095: Downloadable Product Links Showing Double
    Fixed #10097: GBase - Germany correctly listed but not in search index
    Fixed #10107: Incorrect price shown in the configurable proguct
    Fixed #10115: SYSTEM -> Design doesn't show the Store View Name
    Fixed #10119: Price Tier doesn't display if Custom Options is enabled
    Fixed #10125: Downloadable product tiered pricing doesn't show
    Fixed #10137: Categories negative children count
    Fixed #10140: Tier Price no longer shows up in configurable products
    Fixed #10144: Shipping tax appears on invoice but should not
    Fixed #10147: Tire price is not showing on the product view pageworking for products with custom options
    Fixed #10165: Mysql errors
    Fixed #10166: Pager doesn't go to page 1 when new filter or sorting is applied
    Fixed #10166: Pager doesn't go to page 1 when new filter or sorting is applied
    Fixed #10168: Remove Category not working from Admin > Catalog > Manage Products: Categories
    Fixed #10190: Google base is not using webiste settings
    Fixed #10315: UPS XML gets public rates and not Negotiated Rates
    Fixed #10318: Only global Google website optimizer setting has an effect
    Fixed #10325: Editing Orders Billing Info Leaves Shipping rate as $0.00 on the New Order
    Fixed #10331: Incorrect order status for Invoice (Not Capture) + Shippment
    Fixed #10386: Save product - fatal error as result
    Fixed #10397: Categories tree is absent
    Fixed #10399: Admin Attribute Label/Title Shows in Front-end Store View
    Fixed #10418: Admin user can get to the "Import All Products"
    Fixed #10422: Category name always default when it selected
    Fixed #10437: Function Duplicate, leads to SQL Error.
    Fixed #10440: FPT Tax is no showing on the front end
    Fixed #10463: Database Log cleaning not working
    Fixed #10467: Zero subtotal for downloadable product through google checkout and shipping for discount
    Fixed #10469: Unnecessary information for the customer from the google
    Fixed #10470: Incorrect viewing of "including, excluding tax"
    Fixed #10482: push my "My dowloadable products" and you will redirect to log in page
    Fixed #10482: push my "My dowloadable products" and you will redirect to log in page
    Fixed #10484: No start tag for closing dt
    Fixed #10485: Orders False Date Stamp (Support ticket HCV-135552) - wrong date in order comments history
    Fixed #10513: Admin PDF's show Total Shipping Charges in base currency
    Fixed #10519: Grouped product - Stock availability doesn't changed
    Fixed #10533: Can't see product with visibility Search in quick search results
    Fixed #10535: Problems with editing downloadable product
    Fixed "My Orders" box under IE
    Added fixed product tax to downloadable renderer templates
    Added logic to prevent fatal errors in rules if there's invalid data in core_website table
    Added grouped renderer to Pdf to provide possibility to display renderer of products that is a part of grouped
    Added digital delivery to Google Checkout xml API (fixed #10306: Virual products may be shipped through Google)

    Updated translation files
  • Loading branch information...
1 parent e2adf82 commit 530f9bd0e6f355d9e2ebc7f42ea9ee80a6164c25 Magento Core Team committed Feb 2, 2009
Showing with 10,501 additions and 7,045 deletions.
  1. +16 −9 app/Mage.php
  2. +28 −9 app/code/core/Mage/Admin/Model/Mysql4/User.php
  3. +2 −2 app/code/core/Mage/Admin/Model/Roles.php
  4. +2 −1 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php
  5. +3 −1 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php
  6. +10 −0 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php
  7. +10 −0 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php
  8. +10 −3 app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php
  9. +18 −4 app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php
  10. +58 −0 app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name/Grouped.php
  11. +4 −2 app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php
  12. +1 −1 app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php
  13. +1 −13 app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php
  14. +8 −8 app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php
  15. +9 −0 app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php
  16. +47 −14 app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php
  17. +354 −352 app/code/core/Mage/Adminhtml/Controller/Action.php
  18. +16 −2 app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php
  19. +57 −0 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Inventory/Managestock.php
  20. +3 −3 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Log/Cron.php
  21. +17 −12 app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php
  22. +5 −0 app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php
  23. +1 −0 app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php
  24. +1 −0 app/code/core/Mage/Adminhtml/controllers/Sales/Order/EditController.php
  25. +13 −0 app/code/core/Mage/Adminhtml/controllers/System/CacheController.php
  26. +16 −16 app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php
  27. +16 −16 app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php
  28. +20 −4 app/code/core/Mage/Api/Model/Mysql4/User.php
  29. +1 −1 app/code/core/Mage/Api/Model/Server/Handler/Abstract.php
  30. +179 −95 app/code/core/Mage/Bundle/Model/Mysql4/Selection.php
  31. +716 −678 app/code/core/Mage/Bundle/Model/Product/Type.php
  32. +0 −1 app/code/core/Mage/Bundle/etc/config.xml
  33. +1 −1 app/code/core/Mage/Catalog/Block/Navigation.php
  34. +17 −2 app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php
  35. +1 −1 app/code/core/Mage/Catalog/Block/Product/View/Attributes.php
  36. +26 −7 app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php
  37. +1 −0 app/code/core/Mage/Catalog/Helper/Data.php
  38. +32 −5 app/code/core/Mage/Catalog/Model/Category.php
  39. +3 −1 app/code/core/Mage/Catalog/Model/Layer/Filter/Category.php
  40. +4 −1 app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php
  41. +1,358 −1,344 app/code/core/Mage/Catalog/Model/Product.php
  42. +135 −117 app/code/core/Mage/Catalog/Model/Product/Status.php
  43. +610 −581 app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php
  44. +564 −527 app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php
  45. +263 −223 app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php
  46. +4 −4 app/code/core/Mage/Catalog/Model/Product/Type/Price.php
  47. +29 −7 app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category.php
  48. +8 −15 app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product.php
  49. +8 −1 app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php
  50. +137 −91 app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Link.php
  51. +214 −159 app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Status.php
  52. +107 −53 app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Type/Configurable.php
  53. +2 −3 app/code/core/Mage/Catalog/Model/Sendfriend.php
  54. +1 −1 app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-install-0.7.0.php
  55. +7 −0 app/code/core/Mage/CatalogIndex/Model/Indexer.php
  56. +138 −118 app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item/Collection.php
  57. +197 −0 app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Status.php
  58. +417 −399 app/code/core/Mage/CatalogInventory/Model/Observer.php
  59. +55 −0 app/code/core/Mage/CatalogInventory/Model/Source/Stock.php
  60. +165 −161 app/code/core/Mage/CatalogInventory/Model/Stock.php
  61. +423 −413 app/code/core/Mage/CatalogInventory/Model/Stock/Item.php
  62. +446 −0 app/code/core/Mage/CatalogInventory/Model/Stock/Status.php
  63. +257 −245 app/code/core/Mage/CatalogInventory/etc/config.xml
  64. +1 −0 app/code/core/Mage/CatalogInventory/etc/system.xml
  65. +46 −0 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-0.7.4-0.7.5.php
  66. +15 −11 app/code/core/Mage/CatalogRule/Model/Mysql4/Rule.php
  67. +0 −9 app/code/core/Mage/CatalogSearch/Block/Result.php
  68. +1 −1 app/code/core/Mage/CatalogSearch/Model/Layer.php
  69. +4 −1 app/code/core/Mage/CatalogSearch/Model/Mysql4/Fulltext.php
  70. +44 −13 app/code/core/Mage/Checkout/Block/Cart/Abstract.php
  71. +20 −0 app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php
  72. +20 −0 app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Grouped.php
  73. +4 −4 app/code/core/Mage/Cms/Controller/Router.php
  74. +0 −6 app/code/core/Mage/Cms/Helper/Page.php
  75. +31 −3 app/code/core/Mage/Cms/Model/Mysql4/Page.php
  76. +12 −0 app/code/core/Mage/Cms/Model/Page.php
  77. +65 −32 app/code/core/Mage/Core/Controller/Varien/Action.php
  78. +12 −29 app/code/core/Mage/Core/Controller/Varien/Front.php
  79. +23 −8 app/code/core/Mage/Core/Model/App.php
  80. +2 −2 app/code/core/Mage/Core/Model/App/Area.php
  81. +3 −4 app/code/core/Mage/Core/Model/Config.php
  82. +192 −50 app/code/core/Mage/Core/Model/Cookie.php
  83. +49 −10 app/code/core/Mage/Core/Model/Mysql4/Abstract.php
  84. +14 −1 app/code/core/Mage/Core/Model/Mysql4/Store.php
  85. +10 −0 app/code/core/Mage/Core/Model/Mysql4/Url/Rewrite.php
  86. +37 −1 app/code/core/Mage/Core/Model/Mysql4/Website.php
  87. +18 −4 app/code/core/Mage/Core/Model/Resource/Setup.php
  88. +18 −4 app/code/core/Mage/Core/Model/Session/Abstract.php
  89. +74 −37 app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
  90. +5 −1 app/code/core/Mage/Core/Model/Store.php
  91. +10 −2 app/code/core/Mage/Core/Model/Translate.php
  92. +512 −489 app/code/core/Mage/Core/Model/Website.php
  93. +1 −0 app/code/core/Mage/Core/etc/config.xml
  94. +12 −3 app/code/core/Mage/Core/etc/system.xml
  95. +34 −8 app/code/core/Mage/Customer/Model/Config/Share.php
  96. +44 −2 app/code/core/Mage/Customer/Model/Entity/Customer.php
  97. +10 −0 app/code/core/Mage/Customer/Model/Entity/Group.php
  98. +16 −1 app/code/core/Mage/Customer/Model/Session.php
  99. +13 −7 app/code/core/Mage/Directory/Model/Mysql4/Country/Format.php
  100. +2 −2 app/code/core/Mage/Directory/Model/Mysql4/Region/Collection.php
  101. +1 −1 app/code/core/Mage/Directory/Model/Region.php
  102. +1 −1 app/code/core/Mage/Directory/etc/config.xml
  103. +39 −0 app/code/core/Mage/Directory/sql/directory_setup/mysql4-upgrade-0.8.3-0.8.4.php
  104. +5 −1 app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php
  105. +3 −1 app/code/core/Mage/Downloadable/Block/Checkout/Success.php
  106. +5 −1 app/code/core/Mage/Downloadable/Block/Customer/Products/List.php
  107. +1 −1 app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php
  108. +1 −1 app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php
  109. +1 −1 app/code/core/Mage/Downloadable/Helper/File.php
  110. +2 −1 app/code/core/Mage/Downloadable/Model/Link/Purchased/Item.php
  111. +36 −12 app/code/core/Mage/Downloadable/Model/Observer.php
  112. +39 −2 app/code/core/Mage/Downloadable/Model/Product/Type.php
  113. +49 −0 app/code/core/Mage/Downloadable/Model/System/Config/Source/Orderitemstatus.php
  114. +3 −0 app/code/core/Mage/Downloadable/controllers/CustomerController.php
  115. +11 −5 app/code/core/Mage/Downloadable/controllers/DownloadController.php
  116. +18 −11 app/code/core/Mage/Downloadable/controllers/FileController.php
  117. +68 −0 app/code/core/Mage/Downloadable/controllers/Product/EditController.php
  118. +19 −3 app/code/core/Mage/Downloadable/etc/config.xml
  119. +4 −4 app/code/core/Mage/Downloadable/etc/system.xml
  120. +53 −0 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.12-0.1.13.php
  121. +55 −0 app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-0.1.13-0.1.14.php
  122. +3 −2 app/code/core/Mage/Eav/Model/Config.php
  123. +1 −0 app/code/core/Mage/Eav/Model/Entity/Setup.php
  124. +388 −378 app/code/core/Mage/Eav/Model/Mysql4/Entity/Attribute.php
  125. +1 −1 app/code/core/Mage/Eav/etc/config.xml
  126. +2 −4 app/code/core/Mage/Eav/sql/eav_setup/mysql4-install-0.7.0.php
  127. +32 −0 app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.11-0.7.12.php
  128. +1 −9 app/code/core/Mage/GoogleBase/Block/Adminhtml/Items.php
  129. +44 −0 app/code/core/Mage/GoogleBase/Block/Adminhtml/Store/Switcher.php
  130. +11 −0 app/code/core/Mage/GoogleBase/Block/Adminhtml/Types.php
  131. +51 −8 app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit.php
  132. +1 −1 app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit/Attributes.php
  133. +74 −24 app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Edit/Form.php
  134. +11 −1 app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Grid.php
  135. +49 −0 app/code/core/Mage/GoogleBase/Block/Adminhtml/Types/Renderer/Country.php
  136. +122 −0 app/code/core/Mage/GoogleBase/Model/Config.php
  137. +12 −2 app/code/core/Mage/GoogleBase/Model/Item.php
  138. +3 −2 app/code/core/Mage/GoogleBase/Model/Mysql4/Attribute/Collection.php
  139. +17 −0 app/code/core/Mage/GoogleBase/Model/Mysql4/Type.php
  140. +12 −0 app/code/core/Mage/GoogleBase/Model/Mysql4/Type/Collection.php
  141. +22 −2 app/code/core/Mage/GoogleBase/Model/Service.php
  142. +10 −9 app/code/core/Mage/GoogleBase/Model/Service/Feed.php
  143. +4 −4 app/code/core/Mage/GoogleBase/Model/Service/Item.php
  144. +6 −5 app/code/core/Mage/GoogleBase/Model/Source/Country.php
  145. +10 −2 app/code/core/Mage/GoogleBase/Model/Type.php
  146. +44 −4 app/code/core/Mage/GoogleBase/controllers/TypesController.php
  147. +21 −1 app/code/core/Mage/GoogleBase/etc/config.xml
  148. +30 −0 app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.0-0.1.1.php
  149. +19 −3 app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Callback.php
  150. +23 −11 app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php
  151. +39 −0 app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php
  152. +38 −0 app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php
  153. +5 −0 app/code/core/Mage/GoogleCheckout/etc/config.xml
  154. +37 −0 app/code/core/Mage/GoogleCheckout/etc/system.xml
  155. +3 −1 app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php
  156. +2 −2 app/code/core/Mage/GoogleOptimizer/Helper/Data.php
  157. +24 −0 app/code/core/Mage/GoogleOptimizer/Model/Code/Category.php
  158. +7 −2 app/code/core/Mage/GoogleOptimizer/Model/Mysql4/Code.php
  159. +6 −6 app/code/core/Mage/GoogleOptimizer/Model/Observer.php
  160. +19 −5 app/code/core/Mage/Install/Model/Installer/Db.php
  161. +27 −10 app/code/core/Mage/Log/Model/Mysql4/Log.php
  162. +1 −1 app/code/core/Mage/Newsletter/Model/Mysql4/Subscriber/Collection.php
  163. +1 −1 app/code/core/Mage/Paygate/Model/Authorizenet.php
  164. +14 −6 app/code/core/Mage/Poll/Model/Mysql4/Poll.php
  165. +15 −4 app/code/core/Mage/Poll/Model/Mysql4/Poll/Answer.php
  166. +47 −12 app/code/core/Mage/Poll/Model/Poll.php
  167. +14 −1 app/code/core/Mage/Rating/Model/Mysql4/Rating.php
  168. +2 −2 app/code/core/Mage/Rss/etc/config.xml
  169. +2 −1 app/code/core/Mage/Sales/Block/Items/Abstract.php
  170. +57 −0 app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Grouped.php
  171. +57 −0 app/code/core/Mage/Sales/Block/Order/Item/Renderer/Grouped.php
Sorry, we could not display the entire diff because too many files (386) changed.
View
25 app/Mage.php
@@ -82,7 +82,7 @@
public static function getVersion()
{
- return '1.2.0.3';
+ return '1.2.1';
}
/**
@@ -416,15 +416,22 @@ public static function throwException($message, $messageStorage=null)
public static function app($code = '', $type = 'store', $options=array())
{
if (null === self::$_app) {
- Varien_Profiler::start('app/init');
-
+ Varien_Profiler::start('mage::app::construct');
self::$_app = new Mage_Core_Model_App();
+ Varien_Profiler::stop('mage::app::construct');
Mage::setRoot();
Mage::register('events', new Varien_Event_Collection());
+
+
+ Varien_Profiler::start('mage::app::register_config');
Mage::register('config', new Mage_Core_Model_Config());
+ Varien_Profiler::stop('mage::app::register_config');
+ Varien_Profiler::start('mage::app::init');
self::$_app->init($code, $type, $options);
+ Varien_Profiler::stop('mage::app::init');
+
self::$_app->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
}
return self::$_app;
@@ -440,17 +447,17 @@ public static function app($code = '', $type = 'store', $options=array())
public static function run($code = '', $type = 'store', $options=array())
{
try {
- Varien_Profiler::start('app');
+ Varien_Profiler::start('mage');
- Varien_Profiler::start('app::init');
+ Varien_Profiler::start('mage::app');
self::app($code, $type, $options);
- Varien_Profiler::stop('app::init');
+ Varien_Profiler::stop('mage::app');
- Varien_Profiler::start('app::dispatch');
+ Varien_Profiler::start('mage::dispatch');
self::app()->getFrontController()->dispatch();
- Varien_Profiler::stop('app::dispatch');
+ Varien_Profiler::stop('mage::dispatch');
- Varien_Profiler::stop('app');
+ Varien_Profiler::stop('mage');
}
catch (Mage_Core_Model_Session_Exception $e) {
header('Location: ' . Mage::getBaseUrl());
View
37 app/code/core/Mage/Admin/Model/Mysql4/User.php
@@ -37,10 +37,26 @@ class Mage_Admin_Model_Mysql4_User extends Mage_Core_Model_Mysql4_Abstract
protected function _construct()
{
$this->_init('admin/user', 'user_id');
- $this->_uniqueFields = array(
- array('field' => 'email', 'title' => Mage::helper('adminhtml')->__('Email')),
- array('field' => 'username', 'title' => Mage::helper('adminhtml')->__('User Name')),
- );
+ }
+
+ /**
+ * Initialize unique fields
+ *
+ * @return Mage_Core_Model_Mysql4_Abstract
+ */
+ protected function _initUniqueFields()
+ {
+ $this->_uniqueFields = array(
+ array(
+ 'field' => 'email',
+ 'title' => Mage::helper('adminhtml')->__('Email')
+ ),
+ array(
+ 'field' => 'username',
+ 'title' => Mage::helper('adminhtml')->__('User Name')
+ ),
+ );
+ return $this;
}
/**
@@ -144,6 +160,9 @@ public function delete(Mage_Core_Model_Abstract $user)
return true;
}
+ /**
+ * TODO: unify _saveRelations() and add() methods, they make same things
+ */
public function _saveRelations(Mage_Core_Model_Abstract $user)
{
$rolesIds = $user->getRoleIds();
@@ -159,11 +178,10 @@ public function _saveRelations(Mage_Core_Model_Abstract $user)
foreach ($rolesIds as $rid) {
$rid = intval($rid);
if ($rid > 0) {
- //$row = $this->load($user, $rid);
+ $row = Mage::getModel('admin/role')->load($rid)->getData();
} else {
$row = array('tree_level' => 0);
}
- $row = array('tree_level' => 0);
$data = array(
'parent_id' => $rid,
@@ -197,8 +215,8 @@ public function _getRoles(Mage_Core_Model_Abstract $user)
return (($roles = $read->fetchCol($select)) ? $roles : array());
}
- public function add(Mage_Core_Model_Abstract $user) {
-
+ public function add(Mage_Core_Model_Abstract $user)
+ {
$dbh = $this->_getWriteAdapter();
$aRoles = $this->hasAssigned2Role($user);
@@ -226,7 +244,8 @@ public function add(Mage_Core_Model_Abstract $user) {
return $this;
}
- public function deleteFromRole(Mage_Core_Model_Abstract $user) {
+ public function deleteFromRole(Mage_Core_Model_Abstract $user)
+ {
if ( $user->getUserId() <= 0 ) {
return $this;
}
View
4 app/code/core/Mage/Admin/Model/Roles.php
@@ -88,10 +88,10 @@ protected function _buildResourcesArray(Varien_Simplexml_Element $resource=null,
// return array();
//}
- $resource->title = Mage::helper($module)->__((string)$resource->title);
+ //$resource->title = Mage::helper($module)->__((string)$resource->title);
if ( is_null($represent2Darray) ) {
- $result[$resourceName]['name'] = (string)$resource->title;
+ $result[$resourceName]['name'] = Mage::helper($module)->__((string)$resource->title);
$result[$resourceName]['level'] = $level;
} else {
$result[] = $resourceName;
View
3 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php
@@ -45,8 +45,9 @@ public function __construct()
protected function _prepareLayout()
{
+ $category = Mage::registry('current_category');
if (Mage::app()->getConfig()->getModuleConfig('Mage_GoogleOptimizer')->is('active', true)
- && Mage::helper('googleoptimizer')->isOptimizerActive()) {
+ && Mage::helper('googleoptimizer')->isOptimizerActive($category->getStoreId())) {
$this->setChild('googleoptimizer_js',
$this->getLayout()->createBlock('googleoptimizer/js')->setTemplate('googleoptimizer/js.phtml')
);
View
4 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php
@@ -61,8 +61,10 @@ protected function _prepareLayout()
'label' => Mage::helper('catalog')->__('Custom Design'),
'content' => $this->getLayout()->createBlock('adminhtml/catalog_category_tab_design')->toHtml(),
));
+
+ $category = Mage::registry('current_category');
if (Mage::app()->getConfig()->getModuleConfig('Mage_GoogleOptimizer')->is('active', true)
- && Mage::helper('googleoptimizer')->isOptimizerActive()) {
+ && Mage::helper('googleoptimizer')->isOptimizerActive($category->getStoreId())) {
$this->addTab('googleoptimizer', array(
'label' => Mage::helper('googleoptimizer')->__('Category View Optimization'),
'content' => $this->getLayout()->createBlock('googleoptimizer/adminhtml_catalog_category_edit_tab_googleoptimizer')->toHtml(),
View
10 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php
@@ -339,6 +339,16 @@ protected function _prepareForm()
));
// }
+ $htmlAllowed = $fieldset->addField('is_html_allowed_on_front', 'select', array(
+ 'name' => 'is_html_allowed_on_front',
+ 'label' => Mage::helper('catalog')->__('Allow HTML-tags on Front-end'),
+ 'title' => Mage::helper('catalog')->__('Allow HTML-tags on Front-end'),
+ 'values' => $yesno,
+ ));
+ if (!$model->getId()) {
+ $htmlAllowed->setValue(1);
+ }
+
if ($model->getId()) {
$form->getElement('attribute_code')->setDisabled(1);
View
10 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php
@@ -42,6 +42,16 @@ public function getBackordersOption()
return Mage::getSingleton('cataloginventory/source_backorders')->toOptionArray();
}
+ /**
+ * Retrieve stock option array
+ *
+ * @return array
+ */
+ public function getStockOption()
+ {
+ return Mage::getSingleton('cataloginventory/source_stock')->toOptionArray();
+ }
+
public function getProduct()
{
return Mage::registry('product');
View
13 app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php
@@ -37,7 +37,13 @@ class Mage_Adminhtml_Block_Promo_Widget_Chooser_Sku extends Mage_Adminhtml_Block
public function __construct($arguments=array())
{
parent::__construct($arguments);
- $this->setId('skuChooserGrid_'.$this->getId());
+
+ if ($this->getRequest()->getParam('current_grid_id')) {
+ $this->setId($this->getRequest()->getParam('current_grid_id'));
+ } else {
+ $this->setId('skuChooserGrid_'.$this->getId());
+ }
+
$form = $this->getJsFormObject();
$this->setRowClickCallback("$form.chooserGridRowClick.bind($form)");
$this->setCheckboxCheckCallback("$form.chooserGridCheckboxCheck.bind($form)");
@@ -129,8 +135,9 @@ protected function _prepareColumns()
public function getGridUrl()
{
return $this->getUrl('*/*/chooser', array(
- '_current' => true,
- 'collapse' => null
+ '_current' => true,
+ 'current_grid_id' => $this->getId(),
+ 'collapse' => null
));
}
View
22 app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php
@@ -91,8 +91,11 @@ public function addItemRender($type, $block, $template)
* @param string $template
* @return Mage_Adminhtml_Block_Sales_Items_Abstract
*/
- public function addColumnRender($column, $block, $template)
+ public function addColumnRender($column, $block, $template, $type=null)
{
+ if (!is_null($type)) {
+ $column .= '_' . $type;
+ }
$this->_columnRenders[$column] = array(
'block' => $block,
'template' => $template,
@@ -127,17 +130,22 @@ public function getItemRenderer($type)
* Retrieve column renderer block
*
* @param string $column
+ * @param string $compositePart
* @return Mage_Core_Block_Abstract
*/
- public function getColumnRenderer($column)
+ public function getColumnRenderer($column, $compositePart='')
{
+ if (isset($this->_columnRenders[$column . '_' . $compositePart])) {
+ $column .= '_' . $compositePart;
+ }
if (!isset($this->_columnRenders[$column])) {
return false;
}
if (is_null($this->_columnRenders[$column]['renderer'])) {
$this->_columnRenders[$column]['renderer'] = $this->getLayout()
->createBlock($this->_columnRenders[$column]['block'])
- ->setTemplate($this->_columnRenders[$column]['template']);
+ ->setTemplate($this->_columnRenders[$column]['template'])
+ ->setRenderedBlock($this);
}
return $this->_columnRenders[$column]['renderer'];
}
@@ -171,7 +179,13 @@ public function getItemHtml(Varien_Object $item)
*/
public function getColumnHtml(Varien_Object $item, $column, $field = null)
{
- if ($block = $this->getColumnRenderer($column)) {
+ if ($item->getOrderItem()) {
+ $block = $this->getColumnRenderer($column, $item->getOrderItem()->getProductType());
+ } else {
+ $block = $this->getColumnRenderer($column, $item->getProductType());
+ }
+
+ if ($block) {
$block->setItem($item);
if (!is_null($field)) {
$block->setField($field);
View
58 app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name/Grouped.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+
+/**
+ * Sales Order items name column renderer
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Sales_Items_Column_Name_Grouped extends Mage_Adminhtml_Block_Sales_Items_Column_Name
+{
+ /**
+ * Prepare item html
+ *
+ * This method uses renderer for real product type
+ *
+ * @return string
+ */
+ protected function _toHtml()
+ {
+ if ($this->getItem()->getOrderItem()) {
+ $item = $this->getItem()->getOrderItem();
+ } else {
+ $item = $this->getItem();
+ }
+ if ($productType = $item->getRealProductType()) {
+ $renderer = $this->getRenderedBlock()->getColumnHtml($this->getItem(), $productType);
+ return $renderer;
+ }
+ return parent::_toHtml();
+ }
+}
+?>
View
6 app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php
@@ -89,8 +89,10 @@ protected function _prepareForm()
if ($inputType = $attribute->getFrontend()->getInputType()) {
$element = $fieldset->addField($attribute->getAttributeCode(), $inputType,
array(
- 'name' => $attribute->getAttributeCode(),
- 'label' => $attribute->getFrontend()->getLabel(),
+ 'name' => $attribute->getAttributeCode(),
+ 'label' => $attribute->getFrontend()->getLabel(),
+ 'class' => $attribute->getFrontend()->getClass(),
+ 'required' => $attribute->getIsRequired(),
)
)
->setEntityAttribute($attribute)
View
2 app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php
@@ -104,7 +104,7 @@ public function getHeaderText()
$header = Mage::helper('sales')->__('Credit Memo #%s | Date %s | Status %s (%s)',
$this->getCreditmemo()->getIncrementId(),
- $this->formatDate($this->getCreditmemo()->getCreatedAt(), 'medium', true),
+ $this->formatDate($this->getCreditmemo()->getCreatedAtDate(), 'medium', true),
$this->getCreditmemo()->getStateName(),
$emailSent
);
View
14 app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php
@@ -144,20 +144,8 @@ public function getHeaderText()
{
$text = Mage::helper('sales')->__('Order # %s | Order Date %s',
$this->getOrder()->getRealOrderId(),
- $this->formatDate($this->getOrder()->getCreatedAt(), 'medium', true)
+ $this->formatDate($this->getOrder()->getCreatedAtDate(), 'medium', true)
);
- /*if ($this->getOrder()->getRelationParentRealId()) {
- $text = Mage::helper('sales')->__('Order # %s | Order Date %s',
- $this->getOrder()->getRealOrderId(),
- $this->formatDate($this->getOrder()->getCreatedAt(), 'medium', true)
- );
- }
- else {
- $text = Mage::helper('sales')->__('Order # %s | Order Date %s',
- $this->getOrder()->getRealOrderId(),
- $this->formatDate($this->getOrder()->getCreatedAt(), 'medium', true)
- );
- }*/
return $text;
}
View
16 app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php
@@ -64,49 +64,49 @@ public function getFullHistory(){
$this->_prepareHistoryItem(
$_history->getStatusLabel(),
$_history->getIsCustomerNotified(),
- $_history->getCreatedAt());
+ $_history->getCreatedAtDate());
}
foreach ($order->getCreditmemosCollection() as $_memo){
$_fullHistory[$_memo->getEntityId()] =
$this->_prepareHistoryItem($this->__('Credit Memo #%s created', $_memo->getIncrementId()),
- $_memo->getEmailSent(), $_memo->getCreatedAt());
+ $_memo->getEmailSent(), $_memo->getCreatedAtDate());
foreach ($_memo->getCommentsCollection() as $_comment){
$_fullHistory[$_comment->getEntityId()] =
$this->_prepareHistoryItem($this->__('Credit Memo #%s comment added', $_memo->getIncrementId()),
- $_comment->getIsCustomerNotified(), $_comment->getCreatedAt(), $_comment->getComment());
+ $_comment->getIsCustomerNotified(), $_comment->getCreatedAtDate(), $_comment->getComment());
}
}
foreach ($order->getShipmentsCollection() as $_shipment){
$_fullHistory[$_shipment->getEntityId()] =
$this->_prepareHistoryItem($this->__('Shipment #%s created', $_shipment->getIncrementId()),
- $_shipment->getEmailSent(), $_shipment->getCreatedAt());
+ $_shipment->getEmailSent(), $_shipment->getCreatedAtDate());
foreach ($_shipment->getCommentsCollection() as $_comment){
$_fullHistory[$_comment->getEntityId()] =
$this->_prepareHistoryItem($this->__('Shipment #%s comment added', $_shipment->getIncrementId()),
- $_comment->getIsCustomerNotified(), $_comment->getCreatedAt(), $_comment->getComment());
+ $_comment->getIsCustomerNotified(), $_comment->getCreatedAtDate(), $_comment->getComment());
}
}
foreach ($order->getInvoiceCollection() as $_invoice){
$_fullHistory[$_invoice->getEntityId()] =
$this->_prepareHistoryItem($this->__('Invoice #%s created', $_invoice->getIncrementId()),
- $_invoice->getEmailSent(), $_invoice->getCreatedAt());
+ $_invoice->getEmailSent(), $_invoice->getCreatedAtDate());
foreach ($_invoice->getCommentsCollection() as $_comment){
$_fullHistory[$_comment->getEntityId()] =
$this->_prepareHistoryItem($this->__('Invoice #%s comment added', $_invoice->getIncrementId()),
- $_comment->getIsCustomerNotified(), $_comment->getCreatedAt(), $_comment->getComment());
+ $_comment->getIsCustomerNotified(), $_comment->getCreatedAtDate(), $_comment->getComment());
}
}
foreach ($order->getTracksCollection() as $_track){
$_fullHistory[$_track->getEntityId()] =
$this->_prepareHistoryItem($this->__('Tracking number %s for %s assigned', $_track->getNumber(), $_track->getTitle()),
- false, $_track->getCreatedAt());
+ false, $_track->getCreatedAtDate());
}
krsort($_fullHistory);
View
9 app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php
@@ -144,6 +144,15 @@ public function getCatalogData()
)
),
),
+ 'rebuild_inventory_stock_status' => array(
+ 'label' => Mage::helper('adminhtml')->__('Inventory Stock Status'),
+ 'buttons' => array(
+ array(
+ 'name' => 'rebuild_inventory_stock_status',
+ 'action' => Mage::helper('adminhtml')->__('Refresh'),
+ )
+ ),
+ ),
);
}
}
View
61 app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php
@@ -18,14 +18,25 @@
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
- * @category Mage
- * @package Mage_Adminhtml
- * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * Design changes grid
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Adminhtml_Block_System_Design_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
+ /**
+ * Class constructor
+ */
public function __construct()
{
parent::__construct();
@@ -34,6 +45,11 @@ public function __construct()
$this->setUseAjax(true);
}
+ /**
+ * Prepare grid data collection
+ *
+ * @return Mage_Adminhtml_Block_System_Design_Grid
+ */
protected function _prepareCollection()
{
$storeId = (int) $this->getRequest()->getParam('store', 0);
@@ -45,21 +61,27 @@ protected function _prepareCollection()
return $this;
}
+ /**
+ * Define grid columns
+ *
+ * @return Mage_Adminhtml_Block_System_Design_Grid
+ */
protected function _prepareColumns()
{
if (!Mage::app()->isSingleStoreMode()) {
$this->addColumn('store_id', array(
- 'header' => Mage::helper('catalog')->__('Store'),
- 'width' => '100px',
- 'type' => 'store',
- 'index' => 'store_id',
+ 'header' => Mage::helper('catalog')->__('Store'),
+ 'width' => '100px',
+ 'type' => 'store',
+ 'store_view' => true,
+ 'sortable' => false,
+ 'index' => 'store_id',
));
}
- $this->addColumn('package',
- array(
- 'header'=> Mage::helper('catalog')->__('Design'),
- 'width' => '150px',
+ $this->addColumn('package', array(
+ 'header' => Mage::helper('catalog')->__('Design'),
+ 'width' => '150px',
'index' => 'design',
));
$this->addColumn('date_from', array(
@@ -81,14 +103,25 @@ protected function _prepareColumns()
return parent::_prepareColumns();
}
+ /**
+ * Prepare row click url
+ *
+ * @param Varien_Object $row
+ * @return string
+ */
public function getRowUrl($row)
{
- return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
}
+ /**
+ * Prepare grid url
+ *
+ * @return string
+ */
public function getGridUrl()
{
- return $this->getUrl('*/*/grid', array('_current'=>true));
+ return $this->getUrl('*/*/grid', array('_current' => true));
}
}
View
706 app/code/core/Mage/Adminhtml/Controller/Action.php
@@ -1,352 +1,354 @@
-<?php
-/**
- * Magento
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Open Software License (OSL 3.0)
- * that is bundled with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://opensource.org/licenses/osl-3.0.php
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@magentocommerce.com so we can send you a copy immediately.
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade Magento to newer
- * versions in the future. If you wish to customize Magento for your
- * needs please refer to http://www.magentocommerce.com for more information.
- *
- * @category Mage
- * @package Mage_Adminhtml
- * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
- */
-
-/**
- * Base adminhtml controller
- *
- * @category Mage
- * @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
- */
-class Mage_Adminhtml_Controller_Action extends Mage_Core_Controller_Varien_Action
-{
-
- const FLAG_IS_URLS_CHECKED = 'check_url_settings';
-
- /**
- * Used module name in current adminhtml controller
- */
- protected $_usedModuleName = 'adminhtml';
-
- protected function _isAllowed()
- {
- return true;
- }
-
- /**
- * Retrieve adminhtml session model object
- *
- * @return Mage_Adminhtml_Model_Session
- */
- protected function _getSession()
- {
- return Mage::getSingleton('adminhtml/session');
- }
-
- /**
- * Retrieve base admihtml helper
- *
- * @return Mage_Adminhtml_Helper_Data
- */
- protected function _getHelper()
- {
- return Mage::helper('adminhtml');
- }
-
- /**
- * Define active menu item in menu block
- *
- * @return Mage_Adminhtml_Controller_Action
- */
- protected function _setActiveMenu($menuPath)
- {
- $this->getLayout()->getBlock('menu')->setActive($menuPath);
- return $this;
- }
-
- /**
- * @return Mage_Adminhtml_Controller_Action
- */
- protected function _addBreadcrumb($label, $title, $link=null)
- {
- $this->getLayout()->getBlock('breadcrumbs')->addLink($label, $title, $link);
- return $this;
- }
-
- /**
- * @return Mage_Adminhtml_Controller_Action
- */
- protected function _addContent(Mage_Core_Block_Abstract $block)
- {
- $this->getLayout()->getBlock('content')->append($block);
- return $this;
- }
-
- protected function _addLeft(Mage_Core_Block_Abstract $block)
- {
- $this->getLayout()->getBlock('left')->append($block);
- return $this;
- }
-
- protected function _addJs(Mage_Core_Block_Abstract $block)
- {
- $this->getLayout()->getBlock('js')->append($block);
- return $this;
- }
-
- public function hasAction($action)
- {
- return true;
- }
-
- /**
- * Controller predispatch method
- *
- * @return Mage_Adminhtml_Controller_Action
- */
- public function preDispatch()
- {
- Mage::getDesign()->setArea('adminhtml')
- // [bug] this value will be overriden by defaults, how can it be set in adminhtml/etc/config.xml?
- ->setPackageName((string)Mage::getConfig()->getNode('stores/admin/design/package/name'))
- ->setTheme((string)Mage::getConfig()->getNode('stores/admin/design/theme/default'));
-
- $this->getLayout()->setArea('adminhtml');
-
- Mage::dispatchEvent('adminhtml_controller_action_predispatch_start', array());
-
- parent::preDispatch();
-
- if ($this->getRequest()->isPost() && !$this->_validateFormKey()) {
- $this->setFlag('', self::FLAG_NO_DISPATCH, true);
- $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true);
- if ($this->getRequest()->getQuery('isAjax', false) || $this->getRequest()->getQuery('ajax', false)) {
- $this->getResponse()->setBody(Zend_Json::encode(array(
- 'error' => true,
- 'error_msg' => Mage::helper('adminhtml')->__('Invalid Form Key')
- )));
- } else {
- $this->_redirectReferer();
- }
- return $this;
- }
-
- if ($this->getRequest()->isDispatched()
- && $this->getRequest()->getActionName() !== 'denied'
- && !$this->_isAllowed()) {
- $this->_forward('denied');
- $this->setFlag('', self::FLAG_NO_DISPATCH, true);
- return $this;
- }
-
- if (!$this->getFlag('', self::FLAG_IS_URLS_CHECKED)
- && !$this->getRequest()->getParam('forwarded')
- && !$this->_getSession()->getIsUrlNotice(true)
- && !Mage::getConfig()->getNode('global/can_use_base_url')) {
- $this->_checkUrlSettings();
- $this->setFlag('', self::FLAG_IS_URLS_CHECKED, true);
- }
- if (is_null(Mage::getSingleton('adminhtml/session')->getLocale())) {
- Mage::getSingleton('adminhtml/session')->setLocale(Mage::app()->getLocale()->getLocaleCode());
- }
-
- return $this;
- }
-
- protected function _checkUrlSettings()
- {
- /**
- * Don't check for data saving actions
- */
- if ($this->getRequest()->getPost() || $this->getRequest()->getQuery('isAjax')) {
- return $this;
- }
-
- $configData = Mage::getModel('core/config_data');
-
- $defaultUnsecure= (string) Mage::getConfig()->getNode('default/'.Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL);
- $defaultSecure = (string) Mage::getConfig()->getNode('default/'.Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL);
-
- if ($defaultSecure == '{{base_url}}' || $defaultUnsecure == '{{base_url}}') {
- $this->_getSession()->addNotice(
- $this->__('{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure Url / Base Secure Url. It is highly recommended to change this value in your Magento <a href="%s">configuration</a>.', $this->getUrl('adminhtml/system_config/edit', array('section'=>'web')))
- );
- return $this;
- }
-
- $dataCollection = $configData->getCollection()
- ->addValueFilter('{{base_url}}');
-
- $url = false;
- foreach ($dataCollection as $data) {
- if ($data->getScope() == 'stores') {
- $code = Mage::app()->getStore($data->getScopeId())->getCode();
- $url = $this->getUrl('adminhtml/system_config/edit', array('section'=>'web', 'store'=>$code));
- }
- if ($data->getScope() == 'websites') {
- $code = Mage::app()->getWebsite($data->getScopeId())->getCode();
- $url = $this->getUrl('adminhtml/system_config/edit', array('section'=>'web', 'website'=>$code));
- }
-
- if ($url) {
- $this->_getSession()->addNotice(
- $this->__('{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure Url / Base Secure Url. It is highly recommended to change this value in your Magento <a href="%s">configuration</a>.', $url)
- );
- return $this;
- }
- }
- return $this;
- }
-
- public function deniedAction()
- {
- $this->getResponse()->setHeader('HTTP/1.1','403 Forbidden');
- if (!Mage::getSingleton('admin/session')->isLoggedIn()) {
- $this->_redirect('*/index/login');
- return;
- }
- $this->loadLayout(array('default', 'adminhtml_denied'));
- $this->renderLayout();
- }
-
- public function loadLayout($ids=null, $generateBlocks=true, $generateXml=true)
- {
- parent::loadLayout($ids, $generateBlocks, $generateXml);
- $this->_initLayoutMessages('adminhtml/session');
- return $this;
- }
-
- public function norouteAction($coreRoute = null)
- {
- $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
- $this->getResponse()->setHeader('Status','404 File not found');
- $this->loadLayout(array('default', 'adminhtml_noroute'));
- $this->renderLayout();
- }
-
-
- /**
- * Retrieve currently used module name
- *
- * @return string
- */
- public function getUsedModuleName()
- {
- return $this->_usedModuleName;
- }
-
- /**
- * Set currently used module name
- *
- * @param string $moduleName
- * @return Mage_Adminhtml_Controller_Action
- */
- public function setUsedModuleName($moduleName)
- {
- $this->_usedModuleName = $moduleName;
- return $this;
- }
-
- /**
- * Translate a phrase
- *
- * @return string
- */
- public function __()
- {
- $args = func_get_args();
- $expr = new Mage_Core_Model_Translate_Expr(array_shift($args), $this->getUsedModuleName());
- array_unshift($args, $expr);
- return Mage::app()->getTranslator()->translate($args);
- }
-
- /**
- * Set referer url for redirect in responce
- *
- * Is overriden here to set defaultUrl to admin url
- *
- * @param string $defaultUrl
- * @return Mage_Adminhtml_Controller_Action
- */
- protected function _redirectReferer($defaultUrl=null)
- {
- $defaultUrl = empty($defaultUrl) ? $this->getUrl('*') : $defaultUrl;
- parent::_redirectReferer($defaultUrl);
- return $this;
- }
-
- /**
- * Declare headers and content file in responce for file download
- *
- * @param string $fileName
- * @param string $content set to null to avoid starting output, $contentLength should be set explicitly in that case
- * @param string $contentType
- * @param int $contentLength explicit content length, if strlen($content) isn't applicable
- * @return Mage_Adminhtml_Controller_Action
- */
- protected function _prepareDownloadResponse($fileName, $content, $contentType = 'application/octet-stream', $contentLength = null)
- {
- $session = Mage::getSingleton('admin/session');
- if ($session->isFirstPageAfterLogin()) {
- $this->_redirect($session->getUser()->getStartupPageUrl());
- return $this;
- }
- $this->getResponse()
- ->setHttpResponseCode(200)
- ->setHeader('Pragma', 'public', true)
- ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true)
- ->setHeader('Content-type', $contentType, true)
- ->setHeader('Content-Length', is_null($contentLength) ? strlen($content) : $contentLength)
- ->setHeader('Content-Disposition', 'attachment; filename=' . $fileName)
- ->setHeader('Last-Modified', date('r'));
- if (!is_null($content)) {
- $this->getResponse()->setBody($content);
- }
- return $this;
- }
-
- /**
- * Set redirect into responce
- *
- * @param string $path
- * @param array $arguments
- */
- protected function _redirect($path, $arguments=array())
- {
- $this->_getSession()->setIsUrlNotice($this->getFlag('', self::FLAG_IS_URLS_CHECKED));
- $this->getResponse()->setRedirect($this->getUrl($path, $arguments));
- return $this;
- }
-
- protected function _forward($action, $controller = null, $module = null, array $params = null)
- {
- $this->_getSession()->setIsUrlNotice($this->getFlag('', self::FLAG_IS_URLS_CHECKED));
- return parent::_forward($action, $controller, $module, $params);
- }
-
- /**
- * Generate url by route and parameters
- *
- * @param string $route
- * @param array $params
- * @return string
- */
- public function getUrl($route='', $params=array())
- {
- return Mage::helper('adminhtml')->getUrl($route, $params);
- }
-
-}
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * Base adminhtml controller
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Controller_Action extends Mage_Core_Controller_Varien_Action
+{
+
+ const FLAG_IS_URLS_CHECKED = 'check_url_settings';
+
+ /**
+ * Used module name in current adminhtml controller
+ */
+ protected $_usedModuleName = 'adminhtml';
+
+ protected function _isAllowed()
+ {
+ return true;
+ }
+
+ /**
+ * Retrieve adminhtml session model object
+ *
+ * @return Mage_Adminhtml_Model_Session
+ */
+ protected function _getSession()
+ {
+ return Mage::getSingleton('adminhtml/session');
+ }
+
+ /**
+ * Retrieve base admihtml helper
+ *
+ * @return Mage_Adminhtml_Helper_Data
+ */
+ protected function _getHelper()
+ {
+ return Mage::helper('adminhtml');
+ }
+
+ /**
+ * Define active menu item in menu block
+ *
+ * @return Mage_Adminhtml_Controller_Action
+ */
+ protected function _setActiveMenu($menuPath)
+ {
+ $this->getLayout()->getBlock('menu')->setActive($menuPath);
+ return $this;
+ }
+
+ /**
+ * @return Mage_Adminhtml_Controller_Action
+ */
+ protected function _addBreadcrumb($label, $title, $link=null)
+ {
+ $this->getLayout()->getBlock('breadcrumbs')->addLink($label, $title, $link);
+ return $this;
+ }
+
+ /**
+ * @return Mage_Adminhtml_Controller_Action
+ */
+ protected function _addContent(Mage_Core_Block_Abstract $block)
+ {
+ $this->getLayout()->getBlock('content')->append($block);
+ return $this;
+ }
+
+ protected function _addLeft(Mage_Core_Block_Abstract $block)
+ {
+ $this->getLayout()->getBlock('left')->append($block);
+ return $this;
+ }
+
+ protected function _addJs(Mage_Core_Block_Abstract $block)
+ {
+ $this->getLayout()->getBlock('js')->append($block);
+ return $this;
+ }
+
+ public function hasAction($action)
+ {
+ return true;
+ }
+
+ /**
+ * Controller predispatch method
+ *
+ * @return Mage_Adminhtml_Controller_Action
+ */
+ public function preDispatch()
+ {
+ Mage::getDesign()->setArea('adminhtml')
+ // [bug] this value will be overriden by defaults, how can it be set in adminhtml/etc/config.xml?
+ ->setPackageName((string)Mage::getConfig()->getNode('stores/admin/design/package/name'))
+ ->setTheme((string)Mage::getConfig()->getNode('stores/admin/design/theme/default'));
+
+ $this->getLayout()->setArea('adminhtml');
+
+ Mage::dispatchEvent('adminhtml_controller_action_predispatch_start', array());
+
+ parent::preDispatch();
+
+ if ($this->getRequest()->isPost()
+ && !$this->_validateFormKey()
+ && Mage::getSingleton('admin/session')->isLoggedIn()) {
+
+ $this->setFlag('', self::FLAG_NO_DISPATCH, true);
+ $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true);
+ if ($this->getRequest()->getQuery('isAjax', false) || $this->getRequest()->getQuery('ajax', false)) {
+ $this->getResponse()->setBody(Zend_Json::encode(array(
+ 'error' => true,
+ 'error_msg' => Mage::helper('adminhtml')->__('Invalid Form Key')
+ )));
+ } else {
+ $this->_redirectReferer();
+ }
+ return $this;
+ }
+
+ if ($this->getRequest()->isDispatched()
+ && $this->getRequest()->getActionName() !== 'denied'
+ && !$this->_isAllowed()) {
+ $this->_forward('denied');
+ $this->setFlag('', self::FLAG_NO_DISPATCH, true);
+ return $this;
+ }
+
+ if (!$this->getFlag('', self::FLAG_IS_URLS_CHECKED)
+ && !$this->getRequest()->getParam('forwarded')
+ && !$this->_getSession()->getIsUrlNotice(true)
+ && !Mage::getConfig()->getNode('global/can_use_base_url')) {
+ $this->_checkUrlSettings();
+ $this->setFlag('', self::FLAG_IS_URLS_CHECKED, true);
+ }
+ if (is_null(Mage::getSingleton('adminhtml/session')->getLocale())) {
+ Mage::getSingleton('adminhtml/session')->setLocale(Mage::app()->getLocale()->getLocaleCode());
+ }
+
+ return $this;
+ }
+
+ protected function _checkUrlSettings()
+ {
+ /**
+ * Don't check for data saving actions
+ */
+ if ($this->getRequest()->getPost() || $this->getRequest()->getQuery('isAjax')) {
+ return $this;
+ }
+
+ $configData = Mage::getModel('core/config_data');
+
+ $defaultUnsecure= (string) Mage::getConfig()->getNode('default/'.Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL);
+ $defaultSecure = (string) Mage::getConfig()->getNode('default/'.Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL);
+
+ if ($defaultSecure == '{{base_url}}' || $defaultUnsecure == '{{base_url}}') {
+ $this->_getSession()->addNotice(
+ $this->__('{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure Url / Base Secure Url. It is highly recommended to change this value in your Magento <a href="%s">configuration</a>.', $this->getUrl('adminhtml/system_config/edit', array('section'=>'web')))
+ );
+ return $this;
+ }
+
+ $dataCollection = $configData->getCollection()
+ ->addValueFilter('{{base_url}}');
+
+ $url = false;
+ foreach ($dataCollection as $data) {
+ if ($data->getScope() == 'stores') {
+ $code = Mage::app()->getStore($data->getScopeId())->getCode();
+ $url = $this->getUrl('adminhtml/system_config/edit', array('section'=>'web', 'store'=>$code));
+ }
+ if ($data->getScope() == 'websites') {
+ $code = Mage::app()->getWebsite($data->getScopeId())->getCode();
+ $url = $this->getUrl('adminhtml/system_config/edit', array('section'=>'web', 'website'=>$code));
+ }
+
+ if ($url) {
+ $this->_getSession()->addNotice(
+ $this->__('{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure Url / Base Secure Url. It is highly recommended to change this value in your Magento <a href="%s">configuration</a>.', $url)
+ );
+ return $this;
+ }
+ }
+ return $this;
+ }
+
+ public function deniedAction()
+ {
+ $this->getResponse()->setHeader('HTTP/1.1','403 Forbidden');
+ if (!Mage::getSingleton('admin/session')->isLoggedIn()) {
+ $this->_redirect('*/index/login');
+ return;
+ }
+ $this->loadLayout(array('default', 'adminhtml_denied'));
+ $this->renderLayout();
+ }
+
+ public function loadLayout($ids=null, $generateBlocks=true, $generateXml=true)
+ {
+ parent::loadLayout($ids, $generateBlocks, $generateXml);
+ $this->_initLayoutMessages('adminhtml/session');
+ return $this;
+ }
+
+ public function norouteAction($coreRoute = null)
+ {
+ $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
+ $this->getResponse()->setHeader('Status','404 File not found');
+ $this->loadLayout(array('default', 'adminhtml_noroute'));
+ $this->renderLayout();
+ }
+
+
+ /**
+ * Retrieve currently used module name
+ *
+ * @return string
+ */
+ public function getUsedModuleName()
+ {
+ return $this->_usedModuleName;
+ }
+
+ /**
+ * Set currently used module name
+ *
+ * @param string $moduleName
+ * @return Mage_Adminhtml_Controller_Action
+ */
+ public function setUsedModuleName($moduleName)
+ {
+ $this->_usedModuleName = $moduleName;
+ return $this;
+ }
+
+ /**
+ * Translate a phrase
+ *
+ * @return string
+ */
+ public function __()
+ {
+ $args = func_get_args();
+ $expr = new Mage_Core_Model_Translate_Expr(array_shift($args), $this->getUsedModuleName());
+ array_unshift($args, $expr);
+ return Mage::app()->getTranslator()->translate($args);
+ }
+
+ /**
+ * Set referer url for redirect in responce
+ *
+ * Is overriden here to set defaultUrl to admin url
+ *
+ * @param string $defaultUrl
+ * @return Mage_Adminhtml_Controller_Action
+ */
+ protected function _redirectReferer($defaultUrl=null)
+ {
+ $defaultUrl = empty($defaultUrl) ? $this->getUrl('*') : $defaultUrl;
+ parent::_redirectReferer($defaultUrl);
+ return $this;
+ }
+
+ /**
+ * Declare headers and content file in responce for file download
+ *
+ * @param string $fileName
+ * @param string $content set to null to avoid starting output, $contentLength should be set explicitly in that case
+ * @param string $contentType
+ * @param int $contentLength explicit content length, if strlen($content) isn't applicable
+ * @return Mage_Adminhtml_Controller_Action
+ */
+ protected function _prepareDownloadResponse($fileName, $content, $contentType = 'application/octet-stream', $contentLength = null)
+ {
+ $session = Mage::getSingleton('admin/session');
+ if ($session->isFirstPageAfterLogin()) {
+ $this->_redirect($session->getUser()->getStartupPageUrl());
+ return $this;
+ }
+ $this->getResponse()
+ ->setHttpResponseCode(200)
+ ->setHeader('Pragma', 'public', true)
+ ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true)
+ ->setHeader('Content-type', $contentType, true)
+ ->setHeader('Content-Length', is_null($contentLength) ? strlen($content) : $contentLength)
+ ->setHeader('Content-Disposition', 'attachment; filename=' . $fileName)
+ ->setHeader('Last-Modified', date('r'));
+ if (!is_null($content)) {
+ $this->getResponse()->setBody($content);
+ }
+ return $this;
+ }
+
+ /**
+ * Set redirect into responce
+ *
+ * @param string $path
+ * @param array $arguments
+ */
+ protected function _redirect($path, $arguments=array())
+ {
+ $this->_getSession()->setIsUrlNotice($this->getFlag('', self::FLAG_IS_URLS_CHECKED));
+ $this->getResponse()->setRedirect($this->getUrl($path, $arguments));
+ return $this;
+ }
+
+ protected function _forward($action, $controller = null, $module = null, array $params = null)
+ {
+ $this->_getSession()->setIsUrlNotice($this->getFlag('', self::FLAG_IS_URLS_CHECKED));
+ return parent::_forward($action, $controller, $module, $params);
+ }
+
+ /**
+ * Generate url by route and parameters
+ *
+ * @param string $route
+ * @param array $params
+ * @return string
+ */
+ public function getUrl($route='', $params=array())
+ {
+ return Mage::helper('adminhtml')->getUrl($route, $params);
+ }
+}
View
18 app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php
@@ -211,12 +211,26 @@ public function initFromOrder(Mage_Sales_Model_Order $order)
$this->getQuote()->setCustomerIsGuest(true);
}
+ if ($this->getSession()->getUseOldShippingMethod(true)) {
+ /*
+ * if we are making reorder or editing old order
+ * we need to show old shipping as preselected
+ * so for this we need to collect shipping rates
+ */
+ $this->collectShippingRates();
+ } else {
+ /*
+ * if we are creating new order then we don't need to collect
+ * shipping rates before customer hit appropriate button
+ */
+ $this->collectRates();
+ }
+
// Make collect rates when user click "Get shipping methods and rates" in order creating
// $this->getQuote()->getShippingAddress()->setCollectShippingRates(true);
// $this->getQuote()->getShippingAddress()->collectShippingRates();
- $this->getQuote()->collectTotals()
- ->save();
+ $this->getQuote()->save();
return $this;
}
View
57 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Inventory/Managestock.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+
+/**
+ * Adminhtml Catalog Inventory Manage Stock Config Backend Model
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Model_System_Config_Backend_Catalog_Inventory_Managestock
+ extends Mage_Core_Model_Config_Data
+{
+/**
+ * After change Catalog Inventory Manage value process
+ *
+ * @return Mage_Adminhtml_Model_System_Config_Backend_Catalog_Inventory_Managestock
+ */
+ protected function _afterSave()
+ {
+ $newValue = $this->getValue();
+ $oldValue = Mage::getConfig()->getNode(
+ Mage_CatalogSearch_Model_Fulltext::XML_PATH_CATALOG_SEARCH_TYPE,
+ $this->getScope(),
+ $this->getScopeId()
+ );
+ if ($newValue != $oldValue) {
+ Mage::getSingleton('cataloginventory/stock_status')->rebuild();
+ }
+
+ return $this;
+ }
+}
View
6 app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Log/Cron.php
@@ -44,10 +44,10 @@ class Mage_Adminhtml_Model_System_Config_Backend_Log_Cron extends Mage_Core_Mode
*/
protected function _afterSave()
{
- $enabled = $this->getData('groups/log/enabled/value');
+ $enabled = $this->getData('groups/log/fields/enabled/value');
$time = $this->getData('groups/log/fields/time/value');
- $frequncy = $this->getData('groups/log/frequency/value');
- $errorEmail = $this->getData('groups/log/error_email/value');
+ $frequncy = $this->getData('groups/log/fields/frequency/value');
+ $errorEmail = $this->getData('groups/log/fields/error_email/value');
$frequencyDaily = Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency::CRON_DAILY;
$frequencyWeekly = Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency::CRON_WEEKLY;
View
29 app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php
@@ -128,10 +128,21 @@ public function editAction()
$this->getRequest()->setParam('id', $_prevCategoryId);
}
- if (!$category = $this->_initCategory(true)) {
+ if (!($category = $this->_initCategory(true))) {
return;
}
+ /**
+ * Check if we have data in session (if duering category save was exceprion)
+ */
+ $data = Mage::getSingleton('adminhtml/session')->getCategoryData(true);
+ if (isset($data['general'])) {
+ $category->addData($data['general']);
+ }
+
+ /**
+ * Build response for ajax request
+ */
if ($this->getRequest()->getQuery('isAjax')) {
// prepare breadcrumbs of selected category, if any
$breadcrumbsPath = $category->getPath();
@@ -170,11 +181,6 @@ public function editAction()
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true)
->setContainerCssClass('catalog-categories');
- $data = Mage::getSingleton('adminhtml/session')->getCategoryData(true);
- if (isset($data['general'])) {
- $category->addData($data['general']);
- }
-
$this->_addBreadcrumb(Mage::helper('catalog')->__('Manage Catalog Categories'),
Mage::helper('catalog')->__('Manage Categories')
);
@@ -260,21 +266,20 @@ public function saveAction()
));
try {
- // if( $this->getRequest()->getParam('image') )
-
$category->save();
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('catalog')->__('Category saved'));
+ $refreshTree = 'true';
}
catch (Exception $e){
$this->_getSession()->addError($e->getMessage())
->setCategoryData($data);
- $this->getResponse()->setRedirect($this->getUrl('*/*/edit', array('_current'=> true, 'id'=>$category->getId())));
- return;
+ $refreshTree = 'false';
}
}
$url = $this->getUrl('*/*/edit', array('_current' => true, 'id' => $category->getId()));
- $this->getResponse()->setBody('<script type="text/javascript">parent.updateContent("' . $url . '", {}, true);</script>');
+ $this->getResponse()->setBody(
+ '<script type="text/javascript">parent.updateContent("' . $url . '", {}, '.$refreshTree.');</script>'
+ );
}
/**
View
5 app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php
@@ -193,6 +193,11 @@ public function saveAction()
try {
$model->save();
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('catalog')->__('Product attribute was successfully saved'));
+
+ /**
+ * Clear translation cache because attribute labels are stored in translation
+ */
+ Mage::app()->cleanCache(array(Mage_Core_Model_Translate::CACHE_TAG));
Mage::getSingleton('adminhtml/session')->setAttributeData(false);
if ($this->getRequest()->getParam('popup')) {
$this->_redirect('adminhtml/catalog_product/addAttribute', array(
View
1 app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php
@@ -279,6 +279,7 @@ public function reorderAction()
if ($order->getId()) {
$order->setReordered(true);
+ $this->_getSession()->setUseOldShippingMethod(true);
$this->_getOrderCreateModel()->initFromOrder($order);
$this->_redirect('*/*');
View
1 app/code/core/Mage/Adminhtml/controllers/Sales/Order/EditController.php
@@ -53,6 +53,7 @@ public function startAction()
$order = Mage::getModel('sales/order')->load($orderId);
if ($order->getId()) {
+ $this->_getSession()->setUseOldShippingMethod(true);
$this->_getOrderCreateModel()->initFromOrder($order);
$this->_redirect('*/*');
}
View
13 app/code/core/Mage/Adminhtml/controllers/System/CacheController.php
@@ -205,6 +205,19 @@ public function saveAction()
}
break;
+ case 'rebuild_inventory_stock_status':
+ try {
+ Mage::getSingleton('cataloginventory/stock_status')->rebuild();
+ $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('CatalogInventory Stock Status was rebuilded successfully'));
+ }
+ catch (Mage_Core_Exception $e) {
+ $this->_getSession()->addError($e->getMessage());
+ }
+ catch (Exception $e) {
+ $this->_getSession()->addException($e, Mage::helper('adminhtml')->__('Error while rebuilded CatalogInventory Stock Status. Please try again later'));
+ }
+ break;
+
default:
break;
}
View
32 app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php
@@ -129,21 +129,21 @@ public function downloadAction()
protected function _isAllowed()
{
- switch ($this->getRequest()->getActionName()) {
- case 'index':
- $aclResource = 'admin/system/convert/gui';
- break;
- case 'grid':
- $aclResource = 'admin/system/convert/gui';
- break;
- case 'run':
- $aclResource = 'admin/system/convert/gui/run';
- break;
- default:
- $aclResource = 'admin/system/convert/gui/edit';
- break;
- }
-
- return Mage::getSingleton('admin/session')->isAllowed($aclResource);
+// switch ($this->getRequest()->getActionName()) {
+// case 'index':
+// $aclResource = 'admin/system/convert/gui';
+// break;
+// case 'grid':
+// $aclResource = 'admin/system/convert/gui';
+// break;
+// case 'run':
+// $aclResource = 'admin/system/convert/gui/run';
+// break;
+// default:
+// $aclResource = 'admin/system/convert/gui/edit';
+// break;
+// }
+
+ return Mage::getSingleton('admin/session')->isAllowed('admin/system/convert/gui');
}
}
View
32 app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php
@@ -293,21 +293,21 @@ public function historyAction() {
protected function _isAllowed()
{
- switch ($this->getRequest()->getActionName()) {
- case 'index':
- $aclResource = 'admin/system/convert/profiles';
- break;
- case 'grid