Skip to content

Commit

Permalink
Import Magento Release 1.7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeSaferite committed Apr 24, 2012
1 parent 1ea33f8 commit 3254aef
Show file tree
Hide file tree
Showing 412 changed files with 11,036 additions and 8,707 deletions.
7 changes: 7 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@
RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]

############################################
## redirect for mobile user agents

#RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
#RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
#RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]

############################################
## always send 404 on missing files in these folders

Expand Down
588 changes: 586 additions & 2 deletions RELEASE_NOTES.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public static function getVersionInfo()
'minor' => '7',
'revision' => '0',
'patch' => '0',
'stability' => 'rc',
'number' => '1',
'stability' => '',
'number' => '',
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ public function parse(Mage_AdminNotification_Model_Inbox $object, array $data)
foreach ($data as $item) {
$select = $adapter->select()
->from($this->getMainTable())
->where('url=?', $item['url']);
->where('title = ?', $item['title']);

if (empty($item['url'])) {
$select->where('url IS NULL');
} else {
$select->where('url = ?', $item['url']);
}

if (isset($item['internal'])) {
$row = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function getElementLabelHtml()
{
$element = $this->getElement();
$label = $element->getLabel();
if (empty($label)) {
if (!empty($label)) {
$element->setLabel($this->__($label));
}
return $element->getLabelHtml();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
* @author Magento Core Team <[email protected]>
*/

class Mage_Adminhtml_Block_Sales_Order_Create_Totals_Shipping extends Mage_Adminhtml_Block_Sales_Order_Create_Totals_Default
class Mage_Adminhtml_Block_Sales_Order_Create_Totals_Shipping
extends Mage_Adminhtml_Block_Sales_Order_Create_Totals_Default
{
protected $_template = 'sales/order/create/totals/shipping.phtml';

/**
* Check if we need display shipping include and exlude tax
* Check if we need display shipping include and exclude tax
*
* @return bool
*/
Expand Down Expand Up @@ -82,7 +83,7 @@ public function getShippingExcludeTax()
*/
public function getIncludeTaxLabel()
{
return $this->helper('tax')->__('Shipping Incl. Tax (%s)', $this->getTotal()->getAddress()->getShippingDescription());
return $this->helper('tax')->__('Shipping Incl. Tax (%s)', $this->escapeHtml($this->getTotal()->getAddress()->getShippingDescription()));
}

/**
Expand All @@ -92,6 +93,6 @@ public function getIncludeTaxLabel()
*/
public function getExcludeTaxLabel()
{
return $this->helper('tax')->__('Shipping Excl. Tax (%s)', $this->getTotal()->getAddress()->getShippingDescription());
return $this->helper('tax')->__('Shipping Excl. Tax (%s)', $this->escapeHtml($this->getTotal()->getAddress()->getShippingDescription()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,20 @@ public function saveAction()
$customerGroup = Mage::getModel('customer/group');
$id = $this->getRequest()->getParam('id');
if (!is_null($id)) {
$customerGroup->load($id);
$customerGroup->load((int)$id);
}

if ($taxClass = $this->getRequest()->getParam('tax_class')) {
$taxClass = (int)$this->getRequest()->getParam('tax_class');

if ($taxClass) {
try {
$customerGroup->setCode($this->getRequest()->getParam('code'))
->setTaxClassId($taxClass)
->save();
$customerGroupCode = (string)$this->getRequest()->getParam('code');

if (!empty($customerGroupCode)) {
$customerGroup->setCode($customerGroupCode);
}

$customerGroup->setTaxClassId($taxClass)->save();
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('customer')->__('The customer group has been saved.'));
$this->getResponse()->setRedirect($this->getUrl('*/customer_group'));
return;
Expand All @@ -122,7 +128,6 @@ public function saveAction()
} else {
$this->_forward('new');
}

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,11 @@ public function editAction()
$breadcrumb = $this->__('New User');
}
$this->_initAction()
->_addBreadcrumb($breadcrumb, $breadcrumb)
->_addContent(
$this->getLayout()
->createBlock('adminhtml/permissions_user_edit')
->setData('action', $this->getUrl('*/permissions_user/save'))
)
->_addLeft($this->getLayout()->createBlock('adminhtml/permissions_user_edit_tabs'));

$this->_addJs(
$this->getLayout()
->createBlock('adminhtml/template')
->setTemplate('permissions/user_roles_grid_js.phtml')
);
->_addBreadcrumb($breadcrumb, $breadcrumb);

$this->getLayout()->getBlock('adminhtml.permissions.user.edit')
->setData('action', $this->getUrl('*/permissions_user/save'));

$this->renderLayout();
}

Expand Down
45 changes: 24 additions & 21 deletions app/code/core/Mage/Api/Model/Server/Adapter/Soap.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getHandler()
return $this->getData('handler');
}

/**
/**
* Set webservice api controller
*
* @param Mage_Api_Controller_Action $controller
Expand Down Expand Up @@ -103,12 +103,11 @@ public function getController()
*/
public function run()
{

$apiConfigCharset = Mage::getStoreConfig("api/config/charset");

if ($this->getController()->getRequest()->getParam('wsdl') !== null) {
// Generating wsdl content from template
$io = new Varien_Io_File();
$io = new Varien_Io_File();
$io->open(array('path'=>Mage::getModuleDir('etc', 'Mage_Api')));

$wsdlContent = $io->read('wsdl.xml');
Expand All @@ -121,14 +120,11 @@ public function run()
unset($queryParams['wsdl']);
}

$wsdlConfig->setUrl(
htmlspecialchars(Mage::getUrl('*/*/*', array('_query'=>$queryParams) ))
);
$wsdlConfig->setUrl(htmlspecialchars(Mage::getUrl('*/*/*', array('_query'=>$queryParams))));
$wsdlConfig->setName('Magento');
$wsdlConfig->setHandler($this->getHandler());

$template->setVariables(array('wsdl'=>$wsdlConfig));

$template->setVariables(array('wsdl' => $wsdlConfig));

$this->getController()->getResponse()
->clearHeaders()
Expand Down Expand Up @@ -188,9 +184,9 @@ public function fault($code, $message)
}

/**
* Check whether Soap extension is loaded
* Check whether Soap extension is loaded
*
* @return boolean
* @return boolean
*/
protected function _extensionLoaded()
{
Expand All @@ -206,18 +202,18 @@ protected function _extensionLoaded()
protected function getWsdlUrl($params = null, $withAuth = true)
{
$urlModel = Mage::getModel('core/url')
->setUseSession(false);
->setUseSession(false);

$wsdlUrl = $params !== null
? $urlModel->getUrl('*/*/*', array('_current' => true, '_query' => $params))
: $urlModel->getUrl('*/*/*');
? $urlModel->getUrl('*/*/*', array('_current' => true, '_query' => $params))
: $urlModel->getUrl('*/*/*');

if( $withAuth ) {
$phpAuthUser = $this->getController()->getRequest()->getServer('PHP_AUTH_USER', false);
$phpAuthPw = $this->getController()->getRequest()->getServer('PHP_AUTH_PW', false);

if ($phpAuthUser && $phpAuthPw) {
$wsdlUrl = sprintf("http://%s:%s@%s", $phpAuthUser, $phpAuthPw, str_replace('http://', '', $wsdlUrl ) );
$wsdlUrl = sprintf("http://%s:%s@%s", $phpAuthUser, $phpAuthPw, str_replace('http://', '', $wsdlUrl ));
}
}

Expand All @@ -233,24 +229,31 @@ protected function getWsdlUrl($params = null, $withAuth = true)
protected function _instantiateServer()
{
$apiConfigCharset = Mage::getStoreConfig('api/config/charset');
ini_set('soap.wsdl_cache_enabled', '0');
$wsdlCacheEnabled = (bool) Mage::getStoreConfig('api/config/wsdl_cache_enabled');

if ($wsdlCacheEnabled) {
ini_set('soap.wsdl_cache_enabled', '1');
} else {
ini_set('soap.wsdl_cache_enabled', '0');
}

$tries = 0;
do {
$retry = false;
try {
$this->_soap = new Zend_Soap_Server(
$this->getWsdlUrl(array("wsdl" => 1)), array('encoding' => $apiConfigCharset)
);
$this->_soap = new Zend_Soap_Server($this->getWsdlUrl(array("wsdl" => 1)),
array('encoding' => $apiConfigCharset));
} catch (SoapFault $e) {
$importMessage = "can't import schema from 'http://schemas.xmlsoap.org/soap/encoding/'";
if (false !== strpos($e->getMessage(), $importMessage)) {
if (false !== strpos($e->getMessage(),
"can't import schema from 'http://schemas.xmlsoap.org/soap/encoding/'")
) {
$retry = true;
sleep(1);
} else {
throw $e;
}
$tries++;
}
}
} while ($retry && $tries < 5);
use_soap_error_handler(false);
$this->_soap
Expand Down
1 change: 1 addition & 0 deletions app/code/core/Mage/Api/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
<charset>UTF-8</charset>
<session_timeout>3600</session_timeout>
<compliance_wsi>0</compliance_wsi>
<wsdl_cache_enabled>0</wsdl_cache_enabled>
</config>
</api>
</default>
Expand Down
10 changes: 10 additions & 0 deletions app/code/core/Mage/Api/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</compliance_wsi>
<wsdl_cache_enabled translate="label">
<label>Enable WSDL Cache</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<backend_model>adminhtml/system_config_backend_store</backend_model>
<sort_order>40</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</wsdl_cache_enabled>
</fields>
</config>
</groups>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@


/**
* OAuth consumer edit form block
* Attribute edit form block
*
* @category Mage
* @package Mage_OAuth
* @package Mage_Api2
* @author Magento Core Team <[email protected]>
*/
class Mage_Api2_Block_Adminhtml_Attribute_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Api2/Block/Adminhtml/Roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
*/

/**
* OAuth consumers grid container block
* Roles grid container block
*
* @category Mage
* @package Mage_OAuth
* @package Mage_Api2
* @author Magento Core Team <[email protected]>
*/
class Mage_Api2_Block_Adminhtml_Roles extends Mage_Adminhtml_Block_Widget_Grid_Container
Expand Down
6 changes: 3 additions & 3 deletions app/code/core/Mage/Api2/Block/Adminhtml/Roles/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
*/

/**
* OAuth Consumer grid block
* Roles grid block
*
* @category Mage
* @package Mage_OAuth
* @package Mage_Api2
* @author Magento Core Team <[email protected]>
*/
class Mage_Api2_Block_Adminhtml_Roles_Grid extends Mage_Adminhtml_Block_Widget_Grid
Expand Down Expand Up @@ -126,7 +126,7 @@ public function getRowUrl($row)
* Decorate 'User Type' column
*
* @param string $renderedValue Rendered value
* @param Mage_OAuth_Model_Token $row
* @param Mage_Api2_Model_Acl_Global_Role $row
* @param Mage_Adminhtml_Block_Widget_Grid_Column $column
* @param bool $isExport
* @return string
Expand Down
6 changes: 3 additions & 3 deletions app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ class Mage_Api2_Model_Auth_Adapter_Oauth extends Mage_Api2_Model_Auth_Adapter_Ab
*/
public function getUserParams(Mage_Api2_Model_Request $request)
{
/** @var $oauthServer Mage_OAuth_Model_Server */
$oauthServer = Mage::getModel('oAuth/server', $request);
/** @var $oauthServer Mage_Oauth_Model_Server */
$oauthServer = Mage::getModel('oauth/server', $request);
$userParamsObj = (object) array('type' => null, 'id' => null);

try {
$token = $oauthServer->checkAccessRequest();
$userType = $token->getUserType();

if (Mage_OAuth_Model_Token::USER_TYPE_ADMIN == $userType) {
if (Mage_Oauth_Model_Token::USER_TYPE_ADMIN == $userType) {
$userParamsObj->id = $token->getAdminId();
} else {
$userParamsObj->id = $token->getCustomerId();
Expand Down
8 changes: 4 additions & 4 deletions app/code/core/Mage/Api2/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public function getResource($node)
public function getResourceAttributes($node)
{
$attributes = $this->getNode('resources/' . $node . '/attributes');
return $attributes ? (array) $attributes : array();
return $attributes ? $attributes->asCanonicalArray() : array();
}

/**
Expand Down Expand Up @@ -385,7 +385,7 @@ public function getResourceModel($node)
public function getResourceUserPrivileges($resource, $userType)
{
$attributes = $this->getNode('resources/' . $resource . '/privileges/' . $userType);
return $attributes ? (array)$attributes : array();
return $attributes ? $attributes->asCanonicalArray() : array();
}

/**
Expand All @@ -397,7 +397,7 @@ public function getResourceUserPrivileges($resource, $userType)
public function getResourceSubresources($node)
{
$subresources = $this->getNode('resources/' . $node . '/subresources');
return $subresources ? (array)$subresources : array();
return $subresources ? $subresources->asCanonicalArray() : array();
}

/**
Expand All @@ -410,7 +410,7 @@ public function getResourceSubresources($node)
public function getValidationConfig($resourceType, $validatorType)
{
$config = $this->getNode('resources/' . $resourceType . '/validators/' . $validatorType);
return $config ? $config->asArray() : array();
return $config ? $config->asCanonicalArray() : array();
}

/**
Expand Down
Loading

0 comments on commit 3254aef

Please sign in to comment.