Skip to content

Commit a15ecb3

Browse files
committed
2.0.0.0-dev45
* Product management improvements: * Added ability to create variation on the Product creation page * Added ability to add attributes on the Product creation page. Attribute values also can be added directly from the Product creation page * Removed "Delete" button from the Product Edit page. Products can be deleted from Products Grid only * Enhanced Product Edit page * Improved visual styles and business logic for new category creation from product creation page * Updated button names for Grouped and Bundle products, added an ability to translate them * Changed design of all popup windows on product creation page * Simplified UI to add an attribute: made less fields there by default, restructured element positions, hidden rarely-used controls * Created a popup to select image for product variations * JavaScript improvements: * Eliminated `json2.js` library since JSON parsing is bundled in all supported browsers * `Ajax.Autocompleter` is replaced with jQuery suggest widget for search in backend * `jsTree` jQuery plugin is utilized for User Roles, Api Roles, CMS Pages and URL Rewrites management pages in backend * Improved jQuery validation for credit cards * Added support of `$.mage.component` in some frontend themes * Further refactoring of JavaScript to use JQuery library: * Scripts are converted in the following modules and components: Centinel, Authorize.net, Payflow Link, Payflow Pro, Paygate, Paypal Express, Checkout, Captcha * Refactored Prototype-based implementation of validation in "New Category" dialog to use jQuery * Removing Prototype inclusion in several places * Enhanced menu behavior in backend * VDE improvements: * Implemented inline translate tool for VDE * Added new dedicated button "T" in interface * 3 different modes: Page Text, Variable Text (for script texts), Alternative Text (for attributes) * Independent enabling of inline translation on frontend and in VDE * Modified some text messages in VDE and in themes management * Added ability to upload, browse and delete images and fonts that can be used in custom CSS * Added ability to duplicate a theme * Added ability to revert theme modifications to a last saved checkpoint * Improved theme's background image handling * Added alert, when deleting a block * Removed drag-n-drop feature * Refined and streamlined interface * HTML improvements: * Enhanced accessibility in admin by labeling form fields * Payment improvements: * Incorporated changes to the PayPal UI configuration from CE 1.7.0.1 * Moved PayPal configuration to the Payment Methods menu section * Set the default value of the cUrl `VERIFYPEER` option to `true` for PayPal and added the ability to change this value * Changed the design and position of the configuration field tooltips * Removed support of Moneybookers payment method and underlying module in favor of 3rd party extensions * Implemented support of PayPal IPN protocol HTTP 1.1 * Implemented a single place to configure credentials for Payflow Link and Express Checkout * System Configuration improvements: * Added the functionality for creating nested field sets * Implemented the support for the extended and shared configuration fields * Added the ability to define dependencies between fields from different field sets * `Varien_Image` library refactored: * Created adapters factory instead of class `Varien_Image_Adapter` * Refactored ImageMagick and GD adapters to make them testable * Added feature of generating image from text * Support of Google services: * Changed module `Mage_GoogleOptimizer` to support Google Content Experiment instead of Google Optimizer * Implemented support of Google AdWords on the checkout success page * DI improvements: * Added ability to configure DI for individual class instances * Added ability to pass differently configured instances to different parts of the system * Refactored proxy and factory generation mechanism * Layout improvements: * Implemented all-new mechanism of layout merging and customization: * Convention over configuration approach is used, i.e. there is no need to declare layout files in module configs anymore * Added support for merged modular layout files in a theme instead of single `local.xml` theme file * All theme `local.xml` files are broken down and moved to theme modular layout files * All the layout files are broken into smaller ones - one layout handle per one file, so that code duplication cane reduced, when overriding layout files in themes * Covered new layout customization mechanism with integrity tests * Relocated several files, declared in layouts * Streamlined several design customizations * Various improvements: * Refactored fallback paths to prevent searching of modular view files in non-module context, covered application with appropriate integrity test * Added configuration for limits on sending wishlist emails * Refactored default theme fixture in integration tests in order to divide it into smaller and easier to understand fixtures * Moved Currency Symbol module files from Adminhtml module to the module itself * "Contact Us" page is available through HTTPS only * Language selector for backend interface removed from footer. Language can be chosen on My Account page or on backend user edit page * Updated page titles in backend * Improved mechanism of notification and system messages in backend. All related blocks and controllers are moved to AdminNotification module. Enhanced visual representations of notifications: bubble for unread messages, popup for notifications and their descriptions * Updated text of some system messages, backend interface messages, backend menu items * Several classes are refactored to use Event Manager instead of `Mage::dispatchEvent()` * Improved test coverage of entry point classes * Improved authorization logic to be reusable with minimal configuration changes * Introduced App Area in Integration Testing Framework * Improved media entry point * Added plugins/interceptors support for easier extensibility of Magento functionality * Added `application_process_reinit_config` event, so that it is possible to react, when Magento config gets reinitialized * Added "less" to a list of files that are not published to the public directory during deployment process * Eliminated requirement of write access to `pub/static` directory in "production" mode. "Developer" and "default" modes still require write access to this directory * Improved test coverage of recently introduced `Mage_Core_Model_Config_` classes * Added proper description to the error message, shown when uploading too big file with a content to import * Refactored `Mage_Core_Model_Design_Package` - broken it down into several smaller classes according to the sets of responsibilities * Refactored Theme and Theme Service models to follow best practices of OOP design * Removed legacy API tests * Improved transparency of cache control by tag scope in the framework * Improved verification process for the application directories write-access by moving it to the top-level of framework initialization * Introduced separate configurable application directory to be used for merged Javascript files * Implemented support for minification of Javascript files; JSMin library adapter is created * Implemented explicit usage of cache type in collections; engaged it for website, store and store view collections; added tests for a number of collections * Implemented explicit usage of cache types in translations * Implemented explicit usage of cache types in layouts * Removed ability to set limits on maximal amount of categories, products, websites, stores, store views and admin users as an unusable feature * Improved and simplified path normalization methods in `Magento_Filesystem` component * Implemented proper exceptions instead of PHP warnings in `Magento_Filesystem` component * Introduced `Mage_Core_Model_ModuleManager` to provide "enabled" information about modules * Enabled following cache types in integration tests to improve performance: configuration, layouts, translations, EAV * Improved and refreshed design for backend * Removed "demo_blue", "iphone" and "modern" themes * Converted more backend grids from PHP implementation to layout declarations * Refactored experimental implementation of Service Calls Framework * All code from to `lib/Magento/Datasource` and `app/code/Mage/Core/Datasource` moved to `app/code/Mage/Core/DataService` * Added service calls support in Layout model * Fixed bugs and architectural flaws * Changed service calls declaration * Improved test coverage * Introduced mechanism to retrieve values from nested arrays by path * Added Invoker class to invoke service calls by given name * Added ability to define system configuration options via service calls. Refactored implementation for select field in XML * Refactored support of Twig templates * Removed experimental implementation of product view page with Twig templates * Template abstraction moved to separate module `Mage_Core_Model_TemplateEngine` * Modified various blocks and templates due to inability to call protected methods from templates * Improved test coverage * Refactored support for webhooks * Code that provides communication with outbound endpoint moved to library `Magento_Outbound` * Code that provides implementation of publish-subscribe mechanism and instruments moved to library `Magento_PubSub` * Removed experimental webhook implementation in client code * Used WebApi mechanism to provide authorization * Improved UI for working with webhooks in Magento backend * Improved test coverage * Removed support of callbacks from the framework * GitHub requests: * [#71](#71) -- Add event prefix for Cms blocks * [#108](#108) -- Fix issue with `PHP_VERSION` on Ubuntu servers * [#110](#110) -- Fixes `Varien_Io_Sftp::write`, `Varien_Db_Adapter_Pdo_Mysql::insertOnDuplicate` * [#123](#123) -- Performance problem & memory leak in `Mage_Index_Model_Process` * [#125](#125) -- Ability to disable triggering controller action * [#148](#148) -- Fixed readability * [#156](#156) -- Event `adminhtml_cms_page_edit_tab_content_prepare_form` and `$form->setValues($model->getData());` in wrong order * [#161](#161) -- FIXED `http://www.magentocommerce.com/bug-tracking/issue/?issue=7419` * [#176](#176) -- Add print/log query flags to collection * [#202](#202) -- Installer fails to detect `InnoDB` on `MySQL 5.6+` * [#215](#215) -- There is no sort-order "best value" * [#217](#217) -- Update `app/code/core/Mage/Adminhtml/locale/de_DE/Mage_Adminhtml.csv` * [#243](#243) -- Fix helper for determining system memory usage on Windows (pull request for issue #237) * [#267](#267) -- Issue with camel case in cusutom defined source models * Bug fixes: * Fixed absence of a product for store view created after the product * Fixed incorrectly displayed or absent product image on configurable product pages * Fixed incorrectly displayed Tier Price message for Bundle product in backend * Fixed absence of configured options, when composite product is edited from wishlist * Fixed inability to set product rating from backend * Fixed bug with adding product with decimal quantity * Fixed bug with incorrect theme saving when wrong preview file is uploaded * Fixed incorrectly displayed error message when unsupported JavaScript file is uploaded while editing a theme * Fixed bug with incorrect price and stock availability information * Fixed absence of "Delete" button on Widget Instance and Edit Custom Variable pages * Fixed inability to change PayPal configuration * Fixed inventory return after cancelling order, paid with PayPal Website Payment Standard method * Fixed removal of all the items from shopping cart, when cancelling payment by PayPal Website Payment Standard method * Fixed issue with customer address saved in `sales_flat_quote_address` table as `null` or as default address instead of new one during checkout * Fixed hard dependency on GD extension during installation. Now the application can be installed if any of GD or ImageMagick extension is enabled * Fixed handling of creation a customer with already existing e-mail in backend * Fixed exception on customer edit page, when profiler is enabled * Fixed removal of "NOT LOGGED IN" customer group, when attempting to delete nonexistent group * Fixed absence of a welcome email for a new customer that is created in backend * Added validation of customer DOB * Fixed bugs related to "Add Store Code to Urls" configuration setting: the setting applied to backend and produced exceptions on frontend * Fixed inability to edit Newsletter Template * Fixed inability to preview Newsletter Template while creating it * Fixed inability to save Configuration from "Web" tab * Fixed incorrect roles assignment for backend users * Fixed incorrect message during checkout via Authorize.Net * Fixed inability to create order in backend with Authorize.Net as payment method * Fixed unexpected alert during one-page checkout * Fixed bug with broken RSS link on some pages * Fixed inability to delete non-empty customer groups * Fixed bug with absent tracking number in notification email * Fixed JS bug in bundle products * Fixed bug with missing product configuration in bundle products * Fixed absence of a summary for a configured bundle product on Product View page * Fixed bug with missing wishlist grid on customer configuration page * Added validation for the "Weight" field in Product Create/Modify admin form * Fixed infinite loop in reports, when one of the GET-parameters was not submitted * Fixed integration test that failed at the midnight * Fixed image placeholder, being displayed instead of Base image, in Product View page * Fixed multiple bugs in IE 8 and 9 * Restored export for table rates * Fixed weight calculation for DHL * Fixed anchor categories, which didn't show products from child categories * Fixed exception, when applying catalog price rules * Disabled "State" dropdown for Tax Rates in countries, where there are no states * Fixed inability to save a CMS page * Fixed Javascript calendar in backend Customer grid * Fixed issues with fields validation on order management page * Fixed taxes on Bundle product page * Fixed "Rating isn't available" message on Edit Review page * Fixed lack of data in New Order emails, when order is composed at backend * Fixed exception message, when importing wrong tax rates file * Fixed editable multiselect control - new value was not shown there, when added * Fixed exception, when saving a configurable product without associated products * Fixed inability to properly save system configuration, when submitting files there * Fixed performance issue with excessive generation of category menu on "Add to Cart" page * Fixed amounts, being shown in a wrong currency, when viewing created order * Fixed calculation for amount of items, remaining in an order, after shipping and invoicing * Fixed wrong price, calculated, when ordering multiple bundle products in backend * Fixed issues with changing order statuses in backend * Tested backend design, fixed the discovered issues - general and browser-related bugs * Fixed order items, that have been shipped with Free Shipping method, to have "free shipping" status * Fixed issue with a State field being required in countries, where it is not mandatory * Fixed inability to upload a file via File custom option, when ordering a product at frontend * Fixed incorrect cron timezone settings * Fixed performance issues with product saving in case of concurrent search requests * Fixed bug in migration script * Fixed incorrect email when "Send auto-generated password" was hit * Fixed bug with missing category image * Fixed incorrect handling of `GET` parameter `isAjax` after session expiration * Fixed incorrect translation of "month" field for customer's birthday * Fixed Google Analytics script inclusion * Fixed bug with excessive custom rewrites after reindex * Fixed performance tests failure on login page * Fixed incorrect value for average rating on Edit Review page * Fixed bug with incorrect module configuration overriding * Fixed exception in Nominal Tax model * Fixed bug in sitemap URL used in `robots.txt` * Fixed bug with incorrect `custom_design` field value during export * Fixed bug with incorrect RSS title * Fixed CSS style for validation message in CMS widgets * Fixed bugs in `Mage_Tag` module on product creation page * Fixed incorrect Products In Cart report * Fixed incorrect price for bundles with default quantity more than 1 * Fixed displaying of "Import Behavior" section in the `System -> Import` page * Fixed exception, when importing a CSV file with Byte Order Mark * Removed remains of code pools in JavaScript tests * Fixed bugs in shipping label creation * Fixed inability to save some sections of configuration * Fixed bug with empty "New Shipment" e-mail * Fixed inability to save Attribute Set in IE8 * Fixed wrong tax summary for partial invoices and credit memos * Fixed bug with categories custom design, where the chosen theme was not applied * Fixed empty list of themes in CMS pages and Frontend Apps backend sections * Fixed fatal error, when trying to access a customer account in a non-installed Magento * Fixed Javascript error, when accessing system Design configuration in Chrome * Fixed wrong representation of a widget on frontend, after hiding and showing WYSIWYG editor during CMS page modification * Fixed exception, when using 2-level cache backend * Fixed random test failures in `Mage_CatalogSearch_Block_Advanced_ResultTest` * Fixed duplication of a view file signature, e.g. "file.ext?mtime?mtime" * Prevented tracking of merged Javascript files metadata (and re-merging them) in production mode * Fixed incorrect memory usage calculation in Integration tests * Fixed issues in performance test scenarios * Fixed inability to delete customer's address on frontend * Fixed incorrect "No file chosen" message, shown after a successful upload of product image placeholder in Chrome * Made "Print Order" page to display theme-customized logo instead of a default one * Fixed other bugs in management of categories, products, product attributes, product templates (attribute sets), customers, taxes and tax rules * Product creation fixes: * Fixed inability to search and select category in IE8, including via mouse * Fixed usability of category search tree field to not hang after entering each symbol * Fixed inability to select/change attribute for product variations (configurable product) in IE8 * Fixed field highlighting and error placement after validation on "Create Category" dialog * Fixed validation of parent category to be a require field * Fixed bug with displaying special price for a product on frontend after the product template is switched to one without special price * Fixed incorrectly displayed regular price for products with catalog price rule applied * Fixed inability to upload an image in the WYSIWYG editor * Fixed Javascript error, when replacing variation image in IE * Fixed Javascript errors in production mode * Unified look of all the popups * Removed "Add Attribute" link, when Product Details section is collapsed * Fixed issue with product template selector menu, which was not shown * Shopping Cart Price Rule fixes: * Fixed inability to save Shopping Cart Price Rule with Coupon = "No Coupon" * Fixed saving of Shopping Cart Price Rule having specific coupon * Fixed absence of fields on rule information tab * Payment fixes: * Fixed PayPal Pro (formerly Website Payment Pro) to pass shipping address in request to PayPal service * Fixed triggering of a credit memo creation when Charge Back notification comes from PayPal * Fixed emptying shopping cart after canceling on PayPal page * Fixed error "10431-Item amount is invalid." when a Shopping Cart Price Rule is applied in Express Checkout Payflow Edition * Fixed PayPal Payments Pro Hosted Solution to send "City" in place of the "State" parameter for UK and CA, if Region/State is disabled in the configuration * Fixed ability to invoice order without providing payment using Google Checkout API * Fixed validation of a Discover card number * Fixed issues in configuration for payment methods: absence of "Sort Order" field, excessive fields with class name as a value, issues with form elements and groups * Fixed exception, when using 2-level cache backend * Fixed inability to place order with PayPal Payments Advanced and Payflow Link payment methods * VDE fixes: * Removed full file path information from the title of an uploaded store logo * Fixed bugs in VDE with color picker, file uploader, themes assigning, Remove and Update buttons for custom CSS * Fixed hint for the Scripts palette in dock * Fixed inability to upload more than one Javascript file * Fixed bug with improper scaling images in UI * Fixed inability to preview and edit a physical theme * Fixed inability to delete a block * Fixed inability to delete a background image * Fixed preview of a virtual theme in production mode * Fixed JavaScript tests * Fixed bugs with inline translation * Added validation to the theme name field * Fixed absence of error message in IE, when uploading unsupported file type in Theme Javascript * Fixed corrupting of a `custom.css` file, when saving Custom CSS text * Fixed wrong design of "Chain" and "Reset to Original" image buttons * Fixed color picker, being cut off by small browser window * Fixed bottom indent in "Quick Styles" panel - it was too big * Fixed corrupted layout of "Image Sizing" tab, when resizing browser window * Fixed "We found no files", being displayed all the time in the form to upload theme Javascript files * API fixes: * Added missing fields to SOAP API * Fixed inability to set default customer address * Fixed error message, when saving a customer with wrong email address * Fixed inability to create partial order shipment * Fixed absence of special price information in return of `productGetSpecialPrice` method * Fixed incorrect content length of server response * Fixed absence of `productAttributeAddOption`, `catalogProductAttributeUpdate`, `catalogProductAttributeTypes`, `catalogProductAttributeRemoveOption` and `catalogProductAttributeInfo` methods with WS-I mode enabled * Fixed absence of `catalogProductDownloadableLinkList` method * Fixed bug with incorrect credit memo creation when order item id is set * Fixed bug with inability to update stock status or price of multiple products in one call * Fixed `shoppingCartOrderWithPaymentRequestParam` method description in WSDL * Fixed inability to add comment to order without changing order status * Fixed incorrect redirect after SOAP POST request * Fixed inability to end session by `endSession` method * Fixed Save button for Web Services User Roles in backend * Fixed memory issue due to incorrect filtering for the single field in `salesOrderList` method * Fixed bug with getting product information by numeric SKU * Fixed inability to add configurable product by `cart_product.add` method * Fixed ACL initialization in WebApi * Fixed bug with the same cache key used for both WS-I and non WS-I WSDL files * Fixed bug with updating shopping cart by `shoppingCartProductUpdate` method * Fixed product id validation in `shoppingCartProductAdd` method * Fixed absence of tracking number in `salesOrderShipmentInfo` method response * Fixed absence of tracking number in shipment transactional email
1 parent 04446b6 commit a15ecb3

File tree

5,804 files changed

+161852
-135584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,804 files changed

+161852
-135584
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ atlassian*
1010
/sitemap
1111
/.htaccess.orig
1212
/.idea
13+
/.gitattributes
1314
/app/config_sandbox
1415
/app/etc/local.xml
1516
/app/etc/local.xml.*
16-
/app/etc/modules/XEnterprise_Edition.xml
17-
/app/etc/modules/XSaas_Edition.xml
17+
/app/etc/modules/*.xml
1818
/downloader/.cache
1919
/downloader/cache.cfg
2020
/downloader/connect.cfg
@@ -26,10 +26,10 @@ atlassian*
2626
/lib/flex/varien/.flexLibProperties
2727
/lib/flex/varien/.project
2828
/lib/flex/varien/.settings
29+
/pub/cache/*
2930
/pub/media/*
3031
/pub/media/customer/*
3132
/pub/media/downloadable/*
3233
/pub/static/*
3334
!/pub/static/.htaccess
3435
/var/*
35-
*swp

CHANGELOG.markdown

Lines changed: 332 additions & 3 deletions
Large diffs are not rendered by default.

app/Mage.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ final class Mage
9999
const EDITION_PROFESSIONAL = 'Professional';
100100
const EDITION_GO = 'Go';
101101

102+
/**
103+
* Default timezone
104+
*/
105+
const DEFAULT_TIMEZONE = 'UTC';
106+
102107
/**
103108
* Registry collection
104109
*
@@ -165,7 +170,7 @@ final class Mage
165170
/**
166171
* Design object
167172
*
168-
* @var Mage_Core_Model_Design_Package
173+
* @var Mage_Core_Model_View_DesignInterface
169174
*/
170175
protected static $_design;
171176

@@ -218,7 +223,7 @@ public static function getVersionInfo()
218223
'revision' => '0',
219224
'patch' => '0',
220225
'stability' => 'dev',
221-
'number' => '44',
226+
'number' => '45',
222227
);
223228
}
224229

@@ -444,12 +449,12 @@ public static function getUrl($route = '', $params = array())
444449
/**
445450
* Get design package singleton
446451
*
447-
* @return Mage_Core_Model_Design_Package
452+
* @return Mage_Core_Model_View_DesignInterface
448453
*/
449454
public static function getDesign()
450455
{
451456
if (!self::$_design) {
452-
self::$_design = self::getObjectManager()->get('Mage_Core_Model_Design_Package');
457+
self::$_design = self::getObjectManager()->get('Mage_Core_Model_View_DesignInterface');
453458
}
454459
return self::$_design;
455460
}

app/bootstrap.php

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* Environment initialization
3535
*/
3636
error_reporting(E_ALL | E_STRICT);
37-
ini_set('display_errors', 1);
37+
#ini_set('display_errors', 1);
3838
umask(0);
3939

4040
/**
@@ -47,7 +47,6 @@
4747
Magento_Autoload_IncludePath::addIncludePath(array(
4848
BP . DS . 'app' . DS . 'code',
4949
BP . DS . 'lib',
50-
BP . DS . 'var' . DS . 'generation',
5150
));
5251
$classMapPath = BP . DS . 'var/classmap.ser';
5352
if (file_exists($classMapPath)) {
@@ -86,21 +85,10 @@
8685
}
8786
exit;
8887
}
89-
if (!empty($_SERVER['MAGE_PROFILER'])) {
90-
$profilerConfigData = $_SERVER['MAGE_PROFILER'];
91-
92-
$profilerConfig = array(
93-
'baseDir' => dirname(__DIR__),
94-
'tagFilters' => array()
95-
);
9688

97-
if (is_scalar($profilerConfigData)) {
98-
$profilerConfig['driver'] = array(
99-
'output' => is_numeric($profilerConfigData) ? 'html' : $profilerConfigData
100-
);
101-
} elseif (is_array($profilerConfigData)) {
102-
$profilerConfig = array_merge($profilerConfig, $profilerConfigData);
103-
}
104-
Magento_Profiler::applyConfig($profilerConfig);
89+
if (!empty($_SERVER['MAGE_PROFILER'])) {
90+
Magento_Profiler::applyConfig($_SERVER['MAGE_PROFILER'], dirname(__DIR__), !empty($_REQUEST['isAjax']));
10591
}
10692
}
93+
set_error_handler(Mage::DEFAULT_ERROR_HANDLER);
94+
date_default_timezone_set(Mage::DEFAULT_TIMEZONE);
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
/**
3+
* Adminhtml AdminNotification Severity Renderer
4+
*
5+
* Magento
6+
*
7+
* NOTICE OF LICENSE
8+
*
9+
* This source file is subject to the Open Software License (OSL 3.0)
10+
* that is bundled with this package in the file LICENSE.txt.
11+
* It is also available through the world-wide-web at this URL:
12+
* http://opensource.org/licenses/osl-3.0.php
13+
* If you did not receive a copy of the license and are unable to
14+
* obtain it through the world-wide-web, please send an email
15+
* to [email protected] so we can send you a copy immediately.
16+
*
17+
* DISCLAIMER
18+
*
19+
* Do not edit or add to this file if you wish to upgrade Magento to newer
20+
* versions in the future. If you wish to customize Magento for your
21+
* needs please refer to http://www.magentocommerce.com for more information.
22+
*
23+
* @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
24+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25+
*/
26+
class Mage_AdminNotification_Block_Grid_Renderer_Actions
27+
extends Mage_Backend_Block_Widget_Grid_Column_Renderer_Abstract
28+
{
29+
/**
30+
* Renders grid column
31+
*
32+
* @param Varien_Object $row
33+
* @return string
34+
*/
35+
public function render(Varien_Object $row)
36+
{
37+
$readDetailsHtml = ($row->getUrl())
38+
? '<a target="_blank" href="'. $row->getUrl() .'">' .
39+
$this->helper('Mage_AdminNotification_Helper_Data')->__('Read Details') .'</a> | '
40+
: '';
41+
42+
$markAsReadHtml = (!$row->getIsRead())
43+
? '<a href="'. $this->getUrl('*/*/markAsRead/', array('_current' => true, 'id' => $row->getId())) .'">' .
44+
$this->helper('Mage_AdminNotification_Helper_Data')->__('Mark as Read') .'</a> | '
45+
: '';
46+
47+
$encodedUrl = $this->helper('Mage_Core_Helper_Url')->getEncodedUrl();
48+
return sprintf('%s%s<a href="%s" onClick="deleteConfirm(\'%s\', this.href); return false;">%s</a>',
49+
$readDetailsHtml,
50+
$markAsReadHtml,
51+
$this->getUrl('*/*/remove/', array(
52+
'_current'=>true,
53+
'id' => $row->getId(),
54+
Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED => $encodedUrl)
55+
),
56+
$this->helper('Mage_AdminNotification_Helper_Data')->__('Are you sure?'),
57+
$this->helper('Mage_AdminNotification_Helper_Data')->__('Remove')
58+
);
59+
}
60+
}

app/code/Mage/Adminhtml/Block/Notification/Grid/Renderer/Notice.php renamed to app/code/Mage/AdminNotification/Block/Grid/Renderer/Notice.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22
/**
3+
* Adminhtml AdminNotification Severity Renderer
4+
*
35
* Magento
46
*
57
* NOTICE OF LICENSE
@@ -19,21 +21,12 @@
1921
* needs please refer to http://www.magentocommerce.com for more information.
2022
*
2123
* @category Mage
22-
* @package Mage_Adminhtml
24+
* @package Mage_AdminNotification
2325
* @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
2426
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
2527
*/
26-
27-
28-
/**
29-
* Adminhtml AdminNotification Severity Renderer
30-
*
31-
* @category Mage
32-
* @package Mage_Adminhtml
33-
* @author Magento Core Team <[email protected]>
34-
*/
35-
class Mage_Adminhtml_Block_Notification_Grid_Renderer_Notice
36-
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
28+
class Mage_AdminNotification_Block_Grid_Renderer_Notice
29+
extends Mage_Backend_Block_Widget_Grid_Column_Renderer_Abstract
3730
{
3831
/**
3932
* Renders grid column
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
/**
3+
* Adminhtml AdminNotification Severity Renderer
4+
*
5+
* Magento
6+
*
7+
* NOTICE OF LICENSE
8+
*
9+
* This source file is subject to the Open Software License (OSL 3.0)
10+
* that is bundled with this package in the file LICENSE.txt.
11+
* It is also available through the world-wide-web at this URL:
12+
* http://opensource.org/licenses/osl-3.0.php
13+
* If you did not receive a copy of the license and are unable to
14+
* obtain it through the world-wide-web, please send an email
15+
* to [email protected] so we can send you a copy immediately.
16+
*
17+
* DISCLAIMER
18+
*
19+
* Do not edit or add to this file if you wish to upgrade Magento to newer
20+
* versions in the future. If you wish to customize Magento for your
21+
* needs please refer to http://www.magentocommerce.com for more information.
22+
*
23+
* @category Mage
24+
* @package Mage_AdminNotification
25+
* @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
26+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
27+
*/
28+
class Mage_AdminNotification_Block_Grid_Renderer_Severity
29+
extends Mage_Backend_Block_Widget_Grid_Column_Renderer_Abstract
30+
{
31+
/**
32+
* @var Mage_AdminNotification_Model_Inbox
33+
*/
34+
protected $_notice;
35+
36+
/**
37+
* @param Mage_Backend_Block_Context $context
38+
* @param Mage_AdminNotification_Model_Inbox $notice
39+
* @param array $data
40+
*/
41+
public function __construct(
42+
Mage_Backend_Block_Context $context,
43+
Mage_AdminNotification_Model_Inbox $notice,
44+
array $data = array()
45+
) {
46+
parent::__construct($context, $data);
47+
$this->_notice = $notice;
48+
}
49+
50+
/**
51+
* Renders grid column
52+
*
53+
* @param Varien_Object $row
54+
* @return string
55+
*/
56+
public function render(Varien_Object $row)
57+
{
58+
$class = '';
59+
$value = '';
60+
61+
switch ($row->getData($this->getColumn()->getIndex())) {
62+
case Mage_AdminNotification_Model_Inbox::SEVERITY_CRITICAL:
63+
$class = 'critical';
64+
$value = $this->_notice->getSeverities(Mage_AdminNotification_Model_Inbox::SEVERITY_CRITICAL);
65+
break;
66+
case Mage_AdminNotification_Model_Inbox::SEVERITY_MAJOR:
67+
$class = 'major';
68+
$value = $this->_notice->getSeverities(Mage_AdminNotification_Model_Inbox::SEVERITY_MAJOR);
69+
break;
70+
case Mage_AdminNotification_Model_Inbox::SEVERITY_MINOR:
71+
$class = 'minor';
72+
$value = $this->_notice->getSeverities(Mage_AdminNotification_Model_Inbox::SEVERITY_MINOR);
73+
break;
74+
case Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE:
75+
$class = 'notice';
76+
$value = $this->_notice->getSeverities(Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE);
77+
break;
78+
}
79+
return '<span class="grid-severity-' . $class . '"><span>' . $value . '</span></span>';
80+
}
81+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Adminhtml AdminNotification inbox grid
4+
*
5+
* Magento
6+
*
7+
* NOTICE OF LICENSE
8+
*
9+
* This source file is subject to the Open Software License (OSL 3.0)
10+
* that is bundled with this package in the file LICENSE.txt.
11+
* It is also available through the world-wide-web at this URL:
12+
* http://opensource.org/licenses/osl-3.0.php
13+
* If you did not receive a copy of the license and are unable to
14+
* obtain it through the world-wide-web, please send an email
15+
* to [email protected] so we can send you a copy immediately.
16+
*
17+
* DISCLAIMER
18+
*
19+
* Do not edit or add to this file if you wish to upgrade Magento to newer
20+
* versions in the future. If you wish to customize Magento for your
21+
* needs please refer to http://www.magentocommerce.com for more information.
22+
*
23+
* @category Mage
24+
* @package Mage_AdminNotification
25+
* @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
26+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
27+
*/
28+
class Mage_AdminNotification_Block_Inbox extends Mage_Backend_Block_Widget_Grid_Container
29+
{
30+
protected function _construct()
31+
{
32+
$this->_controller = 'adminhtml';
33+
$this->_blockGroup = 'Mage_AdminNotification';
34+
$this->_headerText = $this->_helperFactory->get('Mage_AdminNotification_Helper_Data')->__('Messages Inbox');
35+
parent::_construct();
36+
}
37+
38+
protected function _prepareLayout()
39+
{
40+
parent::_prepareLayout();
41+
$this->_removeButton('add');
42+
return $this;
43+
}
44+
}

0 commit comments

Comments
 (0)