Skip to content

Commit

Permalink
Import Magento Release 1.3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeSaferite committed May 22, 2009
1 parent 58cb158 commit d583154
Show file tree
Hide file tree
Showing 16 changed files with 658 additions and 83 deletions.
2 changes: 1 addition & 1 deletion app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ final class Mage {

public static function getVersion()
{
return '1.3.1';
return '1.3.1.1';
}

/**
Expand Down
133 changes: 71 additions & 62 deletions app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
*/
class Mage_Adminhtml_Block_Customer_Online_Grid extends Mage_Adminhtml_Block_Widget_Grid
{

/**
* Initialize Grid block
*
*/
public function __construct()
{
parent::__construct();
Expand All @@ -50,18 +53,15 @@ public function __construct()
*/
protected function _prepareCollection()
{
$collection = Mage::getResourceSingleton('log/visitor_collection')
->useOnlineFilter();
$collection = Mage::getModel('log/visitor_online')
->prepare()
->getCollection();
/* @var $collection Mage_Log_Model_Mysql4_Visitor_Online_Collection */
$collection->addCustomerData();

$this->setCollection($collection);

parent::_prepareCollection();

foreach ($this->getCollection()->getItems() as $item) {
$item->addIpData($item)
//->addCustomerData($item)
->addQuoteData($item);
}
return $this;
}

Expand All @@ -73,84 +73,93 @@ protected function _prepareCollection()
protected function _prepareColumns()
{
$this->addColumn('customer_id', array(
'header'=>Mage::helper('customer')->__('ID'),
'width'=>'40px',
'align'=>'right',
'type' => 'number',
'default' => Mage::helper('customer')->__('n/a'),
'index'=>'customer_id')
);
'header' => Mage::helper('customer')->__('ID'),
'width' => '40px',
'align' => 'right',
'type' => 'number',
'default' => Mage::helper('customer')->__('n/a'),
'index' => 'customer_id'
));

$this->addColumn('firstname', array(
'header'=> Mage::helper('customer')->__('First Name'),
'default' => Mage::helper('customer')->__('Guest'),
'index'=>'customer_firstname')
);
'header' => Mage::helper('customer')->__('First Name'),
'default' => Mage::helper('customer')->__('Guest'),
'index' => 'customer_firstname'
));

$this->addColumn('lastname', array(
'header'=> Mage::helper('customer')->__('Last Name'),
'default' => Mage::helper('customer')->__('n/a'),
'index'=>'customer_lastname')
);
'header' => Mage::helper('customer')->__('Last Name'),
'default' => Mage::helper('customer')->__('n/a'),
'index' => 'customer_lastname'
));

$this->addColumn('email', array(
'header'=> Mage::helper('customer')->__('Email'),
'default' => Mage::helper('customer')->__('n/a'),
'index'=>'customer_email')
);
'header' => Mage::helper('customer')->__('Email'),
'default' => Mage::helper('customer')->__('n/a'),
'index' => 'customer_email'
));

$this->addColumn('ip_address', array(
'header'=> Mage::helper('customer')->__('IP Address'),
'index'=>'remote_addr',
'default' => Mage::helper('customer')->__('n/a'),
'renderer'=>'adminhtml/customer_online_grid_renderer_ip',
'filter' => false,
'sort' => false
'header' => Mage::helper('customer')->__('IP Address'),
'default' => Mage::helper('customer')->__('n/a'),
'index' => 'remote_addr',
'renderer' => 'adminhtml/customer_online_grid_renderer_ip',
'filter' => false,
'sort' => false
));

$this->addColumn('session_start_time', array(
'header'=> Mage::helper('customer')->__('Session Start Time'),
'align'=>'left',
'type' => 'datetime',
'default' => Mage::helper('customer')->__('n/a'),
'width' => '200px',
'index'=>'first_visit_at')
);
'header' => Mage::helper('customer')->__('Session Start Time'),
'align' => 'left',
'width' => '200px',
'type' => 'datetime',
'default' => Mage::helper('customer')->__('n/a'),
'index' =>'first_visit_at'
));

$this->addColumn('last_activity', array(
'header'=> Mage::helper('customer')->__('Last Activity'),
'align'=>'left',
'type' => 'datetime',
'default' => Mage::helper('customer')->__('n/a'),
'width' => '200px',
'index'=>'last_visit_at')
'header' => Mage::helper('customer')->__('Last Activity'),
'align' => 'left',
'width' => '200px',
'type' => 'datetime',
'default' => Mage::helper('customer')->__('n/a'),
'index' => 'last_visit_at'
));

$typeOptions = array(
Mage_Log_Model_Visitor::VISITOR_TYPE_CUSTOMER => Mage::helper('customer')->__('Customer'),
Mage_Log_Model_Visitor::VISITOR_TYPE_VISITOR => Mage::helper('customer')->__('Visitor'),
);

$this->addColumn('type', array(
'header'=> Mage::helper('customer')->__('Type'),
'index'=>'type',
'type' => 'options',
'options' => array(
Mage_Log_Model_Visitor::VISITOR_TYPE_CUSTOMER => Mage::helper('customer')->__('Customer'),
Mage_Log_Model_Visitor::VISITOR_TYPE_VISITOR => Mage::helper('customer')->__('Visitor'),
),
'renderer'=>'adminhtml/customer_online_grid_renderer_type',
'header' => Mage::helper('customer')->__('Type'),
'index' => 'type',
'type' => 'options',
'options' => $typeOptions,
// 'renderer' => 'adminhtml/customer_online_grid_renderer_type',
'index' => 'visitor_type'
));

$this->addColumn('last_url', array(
'header'=> Mage::helper('customer')->__('Last Url'),
'type' => 'wrapline',
'header' => Mage::helper('customer')->__('Last Url'),
'type' => 'wrapline',
'lineLength' => '60',
'default' => Mage::helper('customer')->__('n/a'),
'renderer'=>'adminhtml/customer_online_grid_renderer_url',
'index'=>'url')
);
'default' => Mage::helper('customer')->__('n/a'),
'renderer' => 'adminhtml/customer_online_grid_renderer_url',
'index' => 'last_url'
));

return parent::_prepareColumns();
}

/**
* Retrieve Row URL
*
* @param Mage_Core_Model_Abstract
* @return string
*/
public function getRowUrl($row)
{
return ( intval($row->getCustomerId()) > 0 ) ? $this->getUrl('*/customer/edit', array('id' => $row->getCustomerId())) : '';
return $row->getCustomerId() ? $this->getUrl('*/customer/edit', array('id' => $row->getCustomerId())) : '';
}
}
12 changes: 8 additions & 4 deletions app/code/core/Mage/AmazonPayments/Model/Payment/Asp.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,18 @@ public function getPayRedirectParams()
$orderId = $this->getOrder()->getRealOrderId();
$amount = Mage::app()->getStore()->roundPrice($this->getOrder()->getBaseGrandTotal());
$currencyCode = $this->getOrder()->getBaseCurrency();

$urlModel = Mage::getModel('core/url')
->setUseSession(false);

return $this->getApi()->getPayParams(
$orderId,
$amount,
$currencyCode,
Mage::getUrl('amazonpayments/asp/returnCancel'),
Mage::getUrl('amazonpayments/asp/returnSuccess'),
Mage::getUrl('amazonpayments/asp/notification')
);
$urlModel->getUrl('amazonpayments/asp/returnCancel'),
$urlModel->getUrl('amazonpayments/asp/returnSuccess'),
$urlModel->getUrl('amazonpayments/asp/notification')
);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/AmazonPayments/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<sort_order>601</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<show_in_store>1</show_in_store>
<fields>
<title translate="label">
<label>Title</label>
Expand Down Expand Up @@ -237,7 +237,7 @@
<sort_order>601</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<show_in_store>1</show_in_store>
<fields>
<title translate="label">
<label>Title</label>
Expand Down
16 changes: 11 additions & 5 deletions app/code/core/Mage/Catalog/Model/Product/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@ protected function _validImage($image)
* @param bool $useSid
* @return string
*/
public function getProductUrl($product, $useSid = true)
public function getProductUrl($product, $useSid = null)
{
$cacheUrlKey = 'url_'
. ($product->getCategoryId() && !$product->getDoNotUseCategoryId() ? $product->getCategoryId() : 'NONE')
. '_' . intval($useSid);
if ($useSid === null) {
$useSid = Mage::app()->getUseSessionInUrl();
}

$categoryId = $product->getCategoryId() && !$product->getDoNotUseCategoryId() ? $product->getCategoryId() : 0;

$cacheUrlKey = sprintf('url_%d_%d', $categoryId, $useSid);
$url = $product->getData($cacheUrlKey);

if (is_null($url)) {
Expand All @@ -93,7 +97,9 @@ public function getProductUrl($product, $useSid = true)

// auto add SID to URL
$originalSid = $this->getUrlInstance()->getUseSession();
$this->getUrlInstance()->setUseSession($useSid);
if ($originalSid != $useSid) {
$this->getUrlInstance()->setUseSession($useSid);
}

if ($product->hasData('request_path') && $product->getRequestPath() != '') {
$this->setData($cacheUrlKey, $this->getUrlInstance()->getDirectUrl($product->getRequestPath()));
Expand Down
30 changes: 30 additions & 0 deletions app/code/core/Mage/Core/Model/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ class Mage_Core_Model_App
*/
protected $_updateMode = false;

/**
* Use session in URL flag
*
* @see Mage_Core_Model_Url
* @var bool
*/
protected $_useSessionInUrl = true;

/**
* Use session var instead of SID for session in URL
*
Expand Down Expand Up @@ -1216,4 +1224,26 @@ public function getUseSessionVar()
{
return $this->_useSessionVar;
}

/**
* Set Use session in URL flag
*
* @param bool $flag
* @return Mage_Core_Model_App
*/
public function setUseSessionInUrl($flag = true)
{
$this->_useSessionInUrl = (bool)$flag;
return $this;
}

/**
* Retrieve use session in URL flag
*
* @return bool
*/
public function getUseSessionInUrl()
{
return $this->_useSessionInUrl;
}
}
1 change: 1 addition & 0 deletions app/code/core/Mage/Core/Model/Email/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ public function save()
public function getProcessedTemplate(array $variables = array())
{
$processor = $this->getTemplateFilter();
$processor->setUseSessionInUrl(false);

if(!$this->_preprocessFlag) {
$variables['this'] = $this;
Expand Down
Loading

0 comments on commit d583154

Please sign in to comment.