Skip to content

Commit

Permalink
Merge branch 'magento-1.6' into magento-1.6-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeSaferite committed Sep 24, 2011
2 parents 6cea604 + d54fe93 commit 197486d
Show file tree
Hide file tree
Showing 231 changed files with 3,397 additions and 1,182 deletions.
469 changes: 469 additions & 0 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 @@ -154,8 +154,8 @@ public static function getVersionInfo()
'minor' => '6',
'revision' => '0',
'patch' => '0',
'stability' => 'rc',
'number' => '2',
'stability' => '',
'number' => '',
);
}

Expand Down
6 changes: 5 additions & 1 deletion app/code/community/Find/Feed/Model/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ protected function _createFile()
$attributesRow = array();
foreach ($attributes as $key => $value) {
if ($this->_checkAttributeSource($product, $value)) {
$attributesRow[$key] = $product->getAttributeText($value);
if (is_array($product->getAttributeText($value))) {
$attributesRow[$key] = implode(', ', $product->getAttributeText($value));
} else {
$attributesRow[$key] = $product->getAttributeText($value);
}
} else {
$attributesRow[$key] = $product->getData($value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
),
'password' => array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 40,
'length' => 100,
'comment' => 'User Password'
),
'created' => array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

class Mage_Adminhtml_Block_Cms_Page_Grid_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
class Mage_Adminhtml_Block_Cms_Page_Grid_Renderer_Action
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
public function render(Varien_Object $row)
{
$urlModel = Mage::getModel('core/url')->setStore($row->getData('_first_store_id'));
$href = $urlModel->getUrl('', array('_current'=>false)) . "{$row->getIdentifier()}?___store={$row->getStoreCode()}";
$href = $urlModel->getUrl(
$row->getIdentifier(), array(
'_current' => false,
'_query' => '___store='.$row->getStoreCode()
)
);
return '<a href="'.$href.'" target="_blank">'.$this->__('Preview').'</a>';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ public function initForm()
->initDefaultValues();

$attributes = $addressForm->getAttributes();
if(isset($attributes['street'])) {
Mage::helper('adminhtml/addresses')
->processStreetAttribute($attributes['street']);
}
foreach ($attributes as $attribute) {
$attribute->unsIsVisible();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ protected function _prepareForm()
$addressForm = $this->_getAddressForm()
->setEntity($addressModel);

$this->_addAttributesToForm($addressForm->getAttributes(), $fieldset);
$attributes = $addressForm->getAttributes();
if(isset($attributes['street'])) {
Mage::helper('adminhtml/addresses')
->processStreetAttribute($attributes['street']);
}
$this->_addAttributesToForm($attributes, $fieldset);

$prefixElement = $this->_form->getElement('prefix');
if ($prefixElement) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,28 @@ public function getQuoteAddress()
}
}

/**
* Define if specified item has already applied custom price
*
* @param Mage_Sales_Model_Quote_Item $item
* @return bool
*/
public function usedCustomPriceForItem($item)
{
return $item->hasCustomPrice();
}

/**
* Define if custom price can be applied for specified item
*
* @param Mage_Sales_Model_Quote_Item $item
* @return bool
*/
public function canApplyCustomPrice($item)
{
return !$item->isChildrenCalculated();
}

public function getQtyTitle($item)
{
$prices = $item->getProduct()->getTierPrice();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
* @package Mage_Adminhtml
* @author Magento Core Team <[email protected]>
*/
class Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Method_Form extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract
class Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Method_Form
extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract
{
protected $_rates;

Expand Down Expand Up @@ -138,6 +139,16 @@ public function getIsRateRequest()

public function getShippingPrice($price, $flag)
{
return $this->getQuote()->getStore()->convertPrice(Mage::helper('tax')->getShippingPrice($price, $flag, $this->getAddress()), true);
return $this->getQuote()->getStore()->convertPrice(
Mage::helper('tax')->getShippingPrice(
$price,
$flag,
$this->getAddress(),
null,
//We should send exact quote store to prevent fetching default config for admin store.
$this->getAddress()->getQuote()->getStore()
),
true
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,37 +66,40 @@ public function getConfigDataJson()
$createLabelUrl = $this->getUrl('*/sales_order_shipment/createLabel', $urlParams);
$itemsGridUrl = $this->getUrl('*/sales_order_shipment/getShippingItemsGrid', $urlParams);
foreach ($this->getShipment()->getAllItems() as $item) {
$itemsQty[$item->getId()] = $item->getQty();
$itemsPrice[$item->getId()] = $item->getPrice();
$itemsName[$item->getId()] = $item->getName();
$itemsWeight[$item->getId()] = $item->getWeight();
$itemsProductId[$item->getId()] = $item->getProductId();
$itemsQty[$item->getId()] = $item->getQty();
$itemsPrice[$item->getId()] = $item->getPrice();
$itemsName[$item->getId()] = $item->getName();
$itemsWeight[$item->getId()] = $item->getWeight();
$itemsProductId[$item->getId()] = $item->getProductId();
$itemsOrderItemId[$item->getId()] = $item->getOrderItemId();
}
} else if ($orderId) {
$urlParams['order_id'] = $orderId;
$createLabelUrl = $this->getUrl('*/sales_order_shipment/save', $urlParams);
$itemsGridUrl = $this->getUrl('*/sales_order_shipment/getShippingItemsGrid', $urlParams);

foreach ($this->getShipment()->getAllItems() as $item) {
$itemsQty[$item->getOrderItemId()] = $item->getQty()*1;
$itemsPrice[$item->getOrderItemId()] = $item->getPrice();
$itemsName[$item->getOrderItemId()] = $item->getName();
$itemsWeight[$item->getOrderItemId()] = $item->getWeight();
$itemsProductId[$item->getOrderItemId()]= $item->getProductId();
$itemsQty[$item->getOrderItemId()] = $item->getQty()*1;
$itemsPrice[$item->getOrderItemId()] = $item->getPrice();
$itemsName[$item->getOrderItemId()] = $item->getName();
$itemsWeight[$item->getOrderItemId()] = $item->getWeight();
$itemsProductId[$item->getOrderItemId()] = $item->getProductId();
$itemsOrderItemId[$item->getOrderItemId()] = $item->getOrderItemId();
}
}
$data = array(
'createLabelUrl' => $createLabelUrl,
'itemsGridUrl' => $itemsGridUrl,
'errorQtyOverLimit' => Mage::helper('sales')->__('The quantity you want to add exceeds the total shipped quantity for'),
'titleDisabledSaveBtn' => Mage::helper('sales')->__('Products should be added to package(s)'),
'validationErrorMsg' => Mage::helper('sales')->__('The value that you entered is not valid. Please use numeric value.'),
'shipmentItemsQty' => $itemsQty,
'shipmentItemsPrice' => $itemsPrice,
'shipmentItemsName' => $itemsName,
'shipmentItemsWeight' => $itemsWeight,
'shipmentItemsProductId' => $itemsProductId,
'customizable' => $this->_getCustomizableContainers(),
'createLabelUrl' => $createLabelUrl,
'itemsGridUrl' => $itemsGridUrl,
'errorQtyOverLimit' => Mage::helper('sales')->__('The quantity you want to add exceeds the total shipped quantity for some of selected Product(s)'),
'titleDisabledSaveBtn' => Mage::helper('sales')->__('Products should be added to package(s)'),
'validationErrorMsg' => Mage::helper('sales')->__('The value that you entered is not valid.'),
'shipmentItemsQty' => $itemsQty,
'shipmentItemsPrice' => $itemsPrice,
'shipmentItemsName' => $itemsName,
'shipmentItemsWeight' => $itemsWeight,
'shipmentItemsProductId' => $itemsProductId,
'shipmentItemsOrderItemId' => $itemsOrderItemId,
'customizable' => $this->_getCustomizableContainers(),
);
return Mage::helper('core')->jsonEncode($data);
}
Expand Down Expand Up @@ -174,6 +177,21 @@ public function getDeliveryConfirmationTypeByCode($code)
return '';
}

/**
* Return name of content type by its code
*
* @param string $code
* @return string
*/
public function getContentTypeByCode($code)
{
$contentTypes = $this->getContentTypes();
if (!empty($contentTypes[$code])) {
return $contentTypes[$code];
}
return '';
}

/**
* Get packed products in packages
*
Expand Down Expand Up @@ -301,4 +319,40 @@ public function getContentTypes()
}
return array();
}

/**
* Get Currency Code for Custom Value
*
* @return string
*/
public function getCustomValueCurrencyCode()
{
return Mage::app()->getStore()->getBaseCurrencyCode();
}

/**
* Display formatted price
*
* @param float $price
* @return string
*/
public function displayPrice($price)
{
return $this->getShipment()->getOrder()->formatPriceTxt($price);
}

/**
* Get ordered qty of item
*
* @param int $itemId
* @return int|null
*/
public function getQtyOrderedItem($itemId)
{
if ($itemId) {
return $this->getShipment()->getOrder()->getItemById($itemId)->getQtyOrdered()*1;
} else {
return;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function getCustomerGroupName()

public function getCustomerViewUrl()
{
if ($this->getOrder()->getCustomerIsGuest()) {
if ($this->getOrder()->getCustomerIsGuest() || !$this->getOrder()->getCustomerId()) {
return false;
}
return $this->getUrl('*/customer/edit', array('id' => $this->getOrder()->getCustomerId()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,33 @@ public function canDisplayGiftmessage()
'order_item', $this->getItem(), $this->getItem()->getOrder()->getStoreId()
);
}

/**
* Display susbtotal price including tax
*
* @param Mage_Sales_Model_Order_Item $item
* @return string
*/
public function displaySubtotalInclTax($item)
{
return $this->displayPrices(
$this->helper('checkout')->getBaseSubtotalInclTax($item),
$this->helper('checkout')->getSubtotalInclTax($item)
);
}

/**
* Display item price including tax
*
* @param Mage_Sales_Model_Order_Item $item
* @return string
*/
public function displayPriceInclTax(Varien_Object $item)
{
return $this->displayPrices(
$this->helper('checkout')->getBasePriceInclTax($item),
$this->helper('checkout')->getPriceInclTax($item)
);
}

}
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Tag/Customer/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected function _prepareColumns()

public function getRowUrl($row)
{
return $this->getUrl('*/customer/edit', array('id' => $row->getCustomerId()));
return $this->getUrl('*/customer/edit', array('id' => $row->getId()));
}

}
4 changes: 3 additions & 1 deletion app/code/core/Mage/Adminhtml/Block/Widget/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ protected function _setFieldset($attributes, $fieldset, $exclude=array())

$element->setAfterElementHtml($this->_getAdditionalElementHtml($element));

if ($inputType == 'select' || $inputType == 'multiselect') {
if ($inputType == 'select') {
$element->setValues($attribute->getSource()->getAllOptions(true, true));
} else if ($inputType == 'multiselect') {
$element->setValues($attribute->getSource()->getAllOptions(false, true));
} else if ($inputType == 'date') {
$element->setImage($this->getSkinUrl('images/grid-cal.gif'));
$element->setFormat(
Expand Down
Loading

0 comments on commit 197486d

Please sign in to comment.