Permalink
Browse files

2.0.0.0-dev43

* Implemented functional limitation that restricts max number of catalog products in the system
* Implemented cache backend library model for MongoDB
* Converted some more grids in backend from PHP implementation to declarations in layout
* Removed `app/etc/local.xml.additional` sample file, moved detailed description of possible configuration options to documentation
* Refactored `Mage_Core_Model_EntryPointAbstract` to emphasize method `processRequest()` as abstract
* Moved declaration of functional limitations to the nodes `limitations/store` and `limitations/admin_account`
* Bug fixes:
  * Fixed JavaScript and markup issues on product editing page in backend that caused erroneous sending of AJAX-queries and not rendering validation messages
  * Fixed issues of application initialization in cases when `var` directory doesn't have writable permissions. Writable directories are validated at an early stage of initialization
  * Fixed array sorting issues in test `Magento_Filesystem_Adapter_LocalTest::testGetNestedKeys()` that caused occasional failures
  • Loading branch information...
1 parent b9005af commit 5b266f6edc41802deae87bf7c504034e9788ba95 @magento-team magento-team committed Feb 21, 2013
Showing with 2,513 additions and 647 deletions.
  1. +13 −0 CHANGELOG.markdown
  2. +1 −51 app/Mage.php
  3. +11 −7 app/code/core/Mage/Adminhtml/Block/Catalog/Product.php
  4. +35 −15 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php
  5. +0 −13 app/code/core/Mage/Adminhtml/Block/System/Cache/Form.php
  6. +11 −1 app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php
  7. +2 −15 app/code/core/Mage/Adminhtml/view/adminhtml/admin/page.phtml
  8. +128 −17 app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Price.php
  9. +116 −0 app/code/core/Mage/Backend/Block/Widget/Grid/Massaction/Additional.php
  10. +19 −3 app/code/core/Mage/Catalog/Model/Product.php
  11. +93 −0 app/code/core/Mage/Catalog/Model/Product/Limitation.php
  12. +14 −0 app/code/core/Mage/Catalog/Model/Resource/Product.php
  13. +1 −1 app/code/core/Mage/Core/Controller/Varien/Front.php
  14. +0 −18 app/code/core/Mage/Core/Helper/Data.php
  15. +2 −2 app/code/core/Mage/Core/Model/Abstract.php
  16. +5 −0 app/code/core/Mage/Core/Model/App.php
  17. +1 −17 app/code/core/Mage/Core/Model/Cache.php
  18. +51 −0 app/code/core/Mage/Core/Model/Config.php
  19. +14 −6 app/code/core/Mage/Core/Model/Design.php
  20. +0 −225 app/code/core/Mage/Core/Model/Design/Package/Proxy.php
  21. +60 −18 app/code/core/Mage/Core/Model/Dir.php
  22. +1 −1 app/code/core/Mage/Core/Model/EntryPoint/Cron.php
  23. +8 −1 app/code/core/Mage/Core/Model/EntryPoint/Http.php
  24. +1 −1 app/code/core/Mage/Core/Model/EntryPoint/Media.php
  25. +1 −11 app/code/core/Mage/Core/Model/EntryPointAbstract.php
  26. +1 −1 app/code/core/Mage/Core/Model/Store/Limitation.php
  27. +1 −1 app/code/core/Mage/Core/Model/Store/Storage/Db.php
  28. +1 −1 app/code/core/Mage/Index/Model/EntryPoint/Indexer.php
  29. +1 −1 app/code/core/Mage/Index/Model/EntryPoint/Shell.php
  30. +1 −1 app/code/core/Mage/Install/Model/EntryPoint/Console.php
  31. +1 −1 app/code/core/Mage/Log/Model/EntryPoint/Shell.php
  32. +1 −1 app/code/core/Mage/User/Model/Resource/User.php
  33. +5 −0 app/etc/config.xml
  34. +0 −80 app/etc/local.xml.additional
  35. +1 −1 app/etc/local.xml.template
  36. +34 −4 dev/tests/integration/framework/Magento/Test/Cookie.php
  37. +1 −1 dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/CookieTest.php
  38. +1 −1 dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php
  39. +3 −0 dev/tests/integration/phpunit.xml.dist
  40. +105 −0 dev/tests/integration/testsuite/Mage/Adminhtml/controllers/Catalog/ProductControllerTest.php
  41. +1 −1 dev/tests/integration/testsuite/Mage/Adminhtml/controllers/System/StoreControllerTest.php
  42. +3 −2 dev/tests/integration/testsuite/Mage/Backend/Block/Widget/GridTest.php
  43. +33 −13 dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Api/SimpleTest.php
  44. +23 −0 dev/tests/integration/testsuite/Mage/Catalog/Model/ProductTest.php
  45. +0 −1 dev/tests/integration/testsuite/Mage/Core/Helper/DataTest.php
  46. +34 −36 dev/tests/integration/testsuite/Mage/Core/Model/AppTest.php
  47. +6 −3 dev/tests/integration/testsuite/Mage/Core/Model/Design/FallbackTest.php
  48. +170 −0 dev/tests/integration/testsuite/Mage/Core/Model/DirFilesystemTest.php
  49. +1 −1 dev/tests/integration/testsuite/Mage/Core/Model/StoreTest.php
  50. +41 −0 dev/tests/integration/testsuite/Mage/Core/Model/_files/App/custom_cache_local.xml
  51. +43 −0 dev/tests/integration/testsuite/Mage/Core/Model/_files/Config/custom_cache_local.xml
  52. +4 −1 dev/tests/integration/testsuite/Mage/Install/Model/Installer/ConfigTest.php
  53. +3 −2 dev/tests/integration/testsuite/Mage/Install/Model/InstallerTest.php
  54. +0 −5 dev/tests/integration/testsuite/Mage/Install/controllers/WizardControllerTest.php
  55. +2 −2 dev/tests/integration/testsuite/Mage/User/Model/Resource/UserTest.php
  56. +2 −2 dev/tests/integration/testsuite/Mage/User/controllers/Adminhtml/UserControllerTest.php
  57. +290 −0 dev/tests/integration/testsuite/Magento/Cache/Backend/MongoDbTest.php
  58. +4 −3 dev/tests/integration/testsuite/Magento/Filesystem/Adapter/LocalTest.php
  59. +1 −0 dev/tests/static/testsuite/Legacy/ConfigTest.php
  60. +1 −0 dev/tests/static/testsuite/Legacy/_files/obsolete_constants.php
  61. +1 −0 dev/tests/static/testsuite/Legacy/_files/obsolete_methods.php
  62. +1 −0 dev/tests/static/testsuite/Php/_files/whitelist/common.txt
  63. +71 −0 dev/tests/unit/framework/Magento/Test/Helper/FileSystem.php
  64. +40 −0 dev/tests/unit/framework/tests/unit/testsuite/Magento/Test/Helper/FileSystemTest.php
  65. +63 −0 dev/tests/unit/testsuite/Mage/Catalog/Model/Product/LimitationTest.php
  66. +40 −39 dev/tests/unit/testsuite/Mage/Core/Model/DirTest.php
  67. +2 −6 dev/tests/unit/testsuite/Mage/Core/Model/LoggerTest.php
  68. +5 −5 dev/tests/unit/testsuite/Mage/Core/Model/Store/LimitationTest.php
  69. +3 −2 dev/tests/unit/testsuite/Mage/Install/Model/Installer/ConfigTest.php
  70. +2 −3 dev/tests/unit/testsuite/Mage/Theme/Block/Adminhtml/System/Design/Theme/Tab/CssTest.php
  71. +424 −0 dev/tests/unit/testsuite/Magento/Cache/Backend/MongoDbTest.php
  72. +3 −0 index.php
  73. +34 −0 lib/Magento/BootstrapException.php
  74. +410 −0 lib/Magento/Cache/Backend/MongoDb.php
  75. +2 −1 pub/cron.php
  76. +2 −0 pub/index.php
  77. +1 −1 pub/lib/mage/backend/bootstrap.js
  78. +1 −0 pub/lib/mage/backend/floating-header.js
  79. +1 −1 pub/lib/mage/backend/validation.js
View
@@ -1,3 +1,16 @@
+2.0.0.0-dev43
+=============
+* Implemented functional limitation that restricts max number of catalog products in the system
+* Implemented cache backend library model for MongoDB
+* Converted some more grids in backend from PHP implementation to declarations in layout
+* Removed `app/etc/local.xml.additional` sample file, moved detailed description of possible configuration options to documentation
+* Refactored `Mage_Core_Model_EntryPointAbstract` to emphasize method `processRequest()` as abstract
+* Moved declaration of functional limitations to the nodes `limitations/store` and `limitations/admin_account`
+* Bug fixes:
+ * Fixed JavaScript and markup issues on product editing page in backend that caused erroneous sending of AJAX-queries and not rendering validation messages
+ * Fixed issues of application initialization in cases when `var` directory doesn't have writable permissions. Writable directories are validated at an early stage of initialization
+ * Fixed array sorting issues in test `Magento_Filesystem_Adapter_LocalTest::testGetNestedKeys()` that caused occasional failures
+
2.0.0.0-dev42
=============
* Application initialization improvements:
View
@@ -220,7 +220,7 @@ public static function getVersionInfo()
'revision' => '0',
'patch' => '0',
'stability' => 'dev',
- 'number' => '42',
+ 'number' => '43',
);
}
@@ -797,56 +797,6 @@ public static function printException(Exception $e, $extra = '')
}
/**
- * Define system folder directory url by virtue of running script directory name
- * Try to find requested folder by shifting to domain root directory
- *
- * @param string $folder
- * @param boolean $exitIfNot
- * @return string
- */
- public static function getScriptSystemUrl($folder, $exitIfNot = false)
- {
- $runDirUrl = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/');
- $runDir = rtrim(dirname($_SERVER['SCRIPT_FILENAME']), DS);
-
- $baseUrl = null;
- if (is_dir($runDir.'/'.$folder)) {
- $baseUrl = str_replace(DS, '/', $runDirUrl);
- } else {
- $runDirUrlArray = explode('/', $runDirUrl);
- $runDirArray = explode('/', $runDir);
- $count = count($runDirArray);
-
- for ($i=0; $i < $count; $i++) {
- array_pop($runDirUrlArray);
- array_pop($runDirArray);
- $_runDir = implode('/', $runDirArray);
- if (!empty($_runDir)) {
- $_runDir .= '/';
- }
-
- if (is_dir($_runDir.$folder)) {
- $_runDirUrl = implode('/', $runDirUrlArray);
- $baseUrl = str_replace(DS, '/', $_runDirUrl);
- break;
- }
- }
- }
-
- if (is_null($baseUrl)) {
- $errorMessage = "Unable detect system directory: $folder";
- if ($exitIfNot) {
- // exit because of infinity loop
- exit($errorMessage);
- } else {
- self::printException(new Exception(), $errorMessage);
- }
- }
-
- return $baseUrl;
- }
-
- /**
* Set is downloader flag
*
* @param bool $flag
@@ -42,13 +42,17 @@ class Mage_Adminhtml_Block_Catalog_Product extends Mage_Adminhtml_Block_Widget_C
*/
protected function _prepareLayout()
{
- $this->_addButton('add_new', array(
- 'id' => 'add_new_product',
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Product'),
- 'class' => 'btn-add',
- 'class_name' => 'Mage_Backend_Block_Widget_Button_Split',
- 'options' => $this->_getAddProductButtonOptions()
- ));
+ /** @var $limitation Mage_Catalog_Model_Product_Limitation */
+ $limitation = Mage::getObjectManager()->get('Mage_Catalog_Model_Product_Limitation');
+ if (!$limitation->isCreateRestricted()) {
+ $this->_addButton('add_new', array(
+ 'id' => 'add_new_product',
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Product'),
+ 'class' => 'btn-add',
+ 'class_name' => 'Mage_Backend_Block_Widget_Button_Split',
+ 'options' => $this->_getAddProductButtonOptions()
+ ));
+ }
$this->setChild(
'grid',
@@ -304,27 +304,36 @@ protected function _getSaveSplitButtonOptions()
'default' => true,
);
}
- $options[] = array(
- 'id' => 'new-button',
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save & New'),
- 'data_attribute' => array(
- 'mage-init' => array(
- 'button' => array('event' => 'saveAndNew', 'target' => '#product-edit-form'),
- ),
- ),
- );
- if (!$this->getRequest()->getParam('popup') && $this->getProduct()->isDuplicable()) {
+
+ /** @var $limitation Mage_Catalog_Model_Product_Limitation */
+ $limitation = Mage::getObjectManager()->get('Mage_Catalog_Model_Product_Limitation');
+ if ($this->_isProductNew()) {
+ $showAddNewButtons = !$limitation->isCreateRestricted(2);
+ } else {
+ $showAddNewButtons = !$limitation->isCreateRestricted();
+ }
+ if ($showAddNewButtons) {
$options[] = array(
- 'id' => 'duplicate-button',
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save & Duplicate'),
+ 'id' => 'new-button',
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save & New'),
'data_attribute' => array(
'mage-init' => array(
- 'button' => array('event' => '', 'target' => '#product-edit-form'),
+ 'button' => array('event' => 'saveAndNew', 'target' => '#product-edit-form'),
),
),
- 'onclick' => $this->getRequest()->getActionName() == 'new' ? ''
- : 'setLocation(\'' . $this->getDuplicateUrl() . '\')',
);
+ if (!$this->getRequest()->getParam('popup') && $this->getProduct()->isDuplicable()) {
+ $options[] = array(
+ 'id' => 'duplicate-button',
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save & Duplicate'),
+ 'data_attribute' => array(
+ 'mage-init' => array(
+ 'button' => array('event' => '', 'target' => '#product-edit-form'),
+ ),
+ ),
+ 'onclick' => $this->_isProductNew() ? '' : 'setLocation(\'' . $this->getDuplicateUrl() . '\')',
+ );
+ }
}
$options[] = array(
'id' => 'close-button',
@@ -337,4 +346,15 @@ protected function _getSaveSplitButtonOptions()
);
return $options;
}
+
+ /**
+ * Check whether new product is being created
+ *
+ * @return bool
+ */
+ protected function _isProductNew()
+ {
+ $product = $this->getProduct();
+ return !$product || !$product->getId();
+ }
}
@@ -69,19 +69,6 @@ public function initForm()
));
}
- $fieldset = $form->addFieldset('beta_cache_enable', array(
- 'legend' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Cache Control (beta)')
- ));
-
- foreach (Mage::helper('Mage_Core_Helper_Data')->getCacheBetaTypes() as $type=>$label) {
- $fieldset->addField('beta_enable_'.$type, 'checkbox', array(
- 'name'=>'beta['.$type.']',
- 'label'=>Mage::helper('Mage_Adminhtml_Helper_Data')->__($label),
- 'value'=>1,
- 'checked'=>(int)Mage::app()->useCache($type),
- ));
- }
-
$this->setForm($form);
return $this;
@@ -185,7 +185,11 @@ public function indexAction()
{
$this->_title($this->__('Catalog'))
->_title($this->__('Manage Products'));
-
+ /** @var $limitation Mage_Catalog_Model_Product_Limitation */
+ $limitation = Mage::getObjectManager()->get('Mage_Catalog_Model_Product_Limitation');
+ if ($limitation->isCreateRestricted()) {
+ $this->_getSession()->addNotice($limitation->getCreateRestrictedMessage());
+ }
$this->loadLayout();
$this->renderLayout();
}
@@ -243,6 +247,12 @@ public function newAction()
*/
public function editAction()
{
+ /** @var $limitation Mage_Catalog_Model_Product_Limitation */
+ $limitation = Mage::getObjectManager()->get('Mage_Catalog_Model_Product_Limitation');
+ if ($limitation->isCreateRestricted()) {
+ $this->_getSession()->addNotice($limitation->getCreateRestrictedMessage());
+ }
+
$productId = (int) $this->getRequest()->getParam('id');
$product = $this->_initProduct();
@@ -24,20 +24,7 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
-<?php /*{
- "label":"Root page layout",
- "type":"Mage_Core_Block_Template",
- "children":{
- "header":{ "label":"Header", "type":"Mage_Adminhtml_Block_Page_Header" },
- "menu":{ "label":"Top navigation", "type":"Mage_Backend_Block_Menu" },
- "breadcrumbs":{ "label":"Breadcrumbs", "type":"Mage_Adminhtml_Block_Widget_Breadcrumbs" },
- "content":{ "label":"Content block", "type":"Mage_Core_Block_Template" },
- "left":{ "label":"Left navigation", "type":"Mage_Core_Block_Template" },
- "footer":{ "label":"Footer", "type":"Mage_Adminhtml_Block_Page_Footer" }
- },
- "vars":{}
-}*/ ?>
-
+<?php /** @var $this Mage_Adminhtml_Block_Page */ ?>
<!doctype html>
<html lang="<?php echo $this->getLang() ?>" class="no-js">
@@ -55,7 +42,7 @@
<section class="page-content" id="anchor-content">
<?php echo $this->getChildHtml('main-top'); ?>
- <div class="messages">
+ <div id="messages" class="messages">
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
</div>
Oops, something went wrong.

0 comments on commit 5b266f6

Please sign in to comment.