Mage_Adminhtml_Block_Sales_Order_View_Items_Renderer_Default Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Order_View_Items_Renderer_Default:

Mage_Adminhtml_Block_Sales_Items_Abstract Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object Mage_Bundle_Block_Adminhtml_Sales_Order_View_Items_Renderer

List of all members.

Public Member Functions

 getItem ()
 getDefaultSender ()
 getDefaultRecipient ()
 getFieldName ($name)
 getFieldId ($id)
 getFieldIdPrefix ()
 getMessage ()
 getSaveUrl ()
 getHtmlId ()
 canDisplayContainer ()
 canDisplayGiftmessage ()

Protected Member Functions

 _initMessage ()

Protected Attributes

 $_giftMessage = array()


Detailed Description

Definition at line 34 of file Default.php.


Member Function Documentation

_initMessage (  )  [protected]

Initialize gift message for entity

Returns:
Mage_Adminhtml_Block_Sales_Order_Edit_Items_Grid_Renderer_Name_Giftmessage

Definition at line 131 of file Default.php.

00132     {
00133         $this->_giftMessage[$this->getItem()->getGiftMessageId()] =
00134             $this->helper('giftmessage/message')->getGiftMessage($this->getItem()->getGiftMessageId());
00135 
00136         // init default values for giftmessage form
00137         if(!$this->getMessage()->getSender()) {
00138             $this->getMessage()->setSender($this->getDefaultSender());
00139         }
00140         if(!$this->getMessage()->getRecipient()) {
00141             $this->getMessage()->setRecipient($this->getDefaultRecipient());
00142         }
00143 
00144         return $this;
00145     }

canDisplayContainer (  ) 

Indicate that block can display container

Returns:
boolean

Definition at line 190 of file Default.php.

00191     {
00192         return $this->getRequest()->getParam('reload')!=1;
00193     }

canDisplayGiftmessage (  ) 

Indicates that block can display giftmessages form

Returns:
boolean

Definition at line 200 of file Default.php.

00201     {
00202         return $this->helper('giftmessage/message')->getIsMessagesAvailable(
00203             'order_item', $this->getItem(), $this->getItem()->getOrder()->getStoreId()
00204         );
00205     }

getDefaultRecipient (  ) 

Retrive default value for giftmessage recipient

Returns:
string

Definition at line 71 of file Default.php.

00072     {
00073         if(!$this->getItem()) {
00074             return '';
00075         }
00076 
00077         if($this->getItem()->getOrder()) {
00078             if ($this->getItem()->getOrder()->getShippingAddress()) {
00079                 return $this->getItem()->getOrder()->getShippingAddress()->getName();
00080             } else if ($this->getItem()->getOrder()->getBillingAddress()) {
00081                 return $this->getItem()->getOrder()->getBillingAddress()->getName();
00082             }
00083         }
00084 
00085         if ($this->getItem()->getShippingAddress()) {
00086             return $this->getItem()->getShippingAddress()->getName();
00087         } else if ($this->getItem()->getBillingAddress()) {
00088             return $this->getItem()->getBillingAddress()->getName();
00089         }
00090 
00091         return '';
00092     }

getDefaultSender (  ) 

Retrive default value for giftmessage sender

Returns:
string

Definition at line 53 of file Default.php.

00054     {
00055         if(!$this->getItem()) {
00056             return '';
00057         }
00058 
00059         if($this->getItem()->getOrder()) {
00060             return $this->getItem()->getOrder()->getBillingAddress()->getName();
00061         }
00062 
00063         return $this->getItem()->getBillingAddress()->getName();
00064     }

getFieldId ( id  ) 

Retrive real html id for field

Parameters:
string $name
Returns:
string

Definition at line 111 of file Default.php.

00112     {
00113         return $this->getFieldIdPrefix() . $id;
00114     }

getFieldIdPrefix (  ) 

Retrive field html id prefix

Returns:
string

Definition at line 121 of file Default.php.

00122     {
00123         return 'giftmessage_item_' . $this->getItem()->getId() . '_';
00124     }

getFieldName ( name  ) 

Retrive real name for field

Parameters:
string $name
Returns:
string

Definition at line 100 of file Default.php.

00101     {
00102         return 'giftmessage[' . $this->getItem()->getId() . '][' . $name . ']';
00103     }

getHtmlId (  ) 

Retrive block html id

Returns:
string

Definition at line 180 of file Default.php.

00181     {
00182         return substr($this->getFieldIdPrefix(), 0, -1);
00183     }

getItem (  ) 

Definition at line 36 of file Default.php.

00037     {
00038         return $this->_getData('item');
00039     }

getMessage (  ) 

Retrive gift message for entity

Returns:
Mage_GiftMessage_Model_Message

Definition at line 152 of file Default.php.

00153     {
00154         if(!isset($this->_giftMessage[$this->getItem()->getGiftMessageId()])) {
00155             $this->_initMessage();
00156         }
00157 
00158         return $this->_giftMessage[$this->getItem()->getGiftMessageId()];
00159     }

getSaveUrl (  ) 

Retrieve save url

Returns:
array

Definition at line 166 of file Default.php.

00167     {
00168         return $this->getUrl('*/sales_order_view_giftmessage/save', array(
00169             'entity'    => $this->getItem()->getId(),
00170             'type'      => 'order_item',
00171             'reload'    => true
00172         ));
00173     }


Member Data Documentation

$_giftMessage = array() [protected]

Definition at line 46 of file Default.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:02 2009 for Magento by  doxygen 1.5.8