Mage_Adminhtml_Block_Sales_Order_View_Tab_History Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Order_View_Tab_History:

Mage_Adminhtml_Block_Template Mage_Adminhtml_Block_Widget_Tab_Interface Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getOrder ()
 getFullHistory ()
 getTabLabel ()
 getTabTitle ()
 getTabClass ()
 getClass ()
 getTabUrl ()
 canShowTab ()
 isHidden ()

Protected Member Functions

 _construct ()
 _prepareHistoryItem ($label, $notified, $created, $comment= '')


Detailed Description

Definition at line 34 of file History.php.


Member Function Documentation

_construct (  )  [protected]

Internal constructor, that is called from real constructor

Please override this one instead of overriding real __construct constructor

Please override this one instead of overriding real __construct constructor

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 38 of file History.php.

00039     {
00040         parent::_construct();
00041         $this->setTemplate('sales/order/view/tab/history.phtml');
00042     }

_prepareHistoryItem ( label,
notified,
created,
comment = '' 
) [protected]

Definition at line 116 of file History.php.

00117     {
00118         return array(
00119                 'title' => $label,
00120                 'notified' => $notified,
00121                 'comment' => $comment,
00122                 'created_at' => $created
00123             );
00124     }

canShowTab (  ) 

Implements Mage_Adminhtml_Block_Widget_Tab_Interface.

Definition at line 154 of file History.php.

00155     {
00156         return true;
00157     }

getClass (  ) 

Definition at line 144 of file History.php.

00145     {
00146         return $this->getTabClass();
00147     }

getFullHistory (  ) 

Retrive full order history

Definition at line 58 of file History.php.

00058                                     {
00059         $order = $this->getOrder();
00060 
00061         $_fullHistory = array();
00062         foreach ($order->getAllStatusHistory() as $_history){
00063             $_fullHistory[$_history->getEntityId()] =
00064                 $this->_prepareHistoryItem(
00065                     $_history->getStatusLabel(),
00066                     $_history->getIsCustomerNotified(),
00067                     $_history->getCreatedAtDate());
00068         }
00069 
00070         foreach ($order->getCreditmemosCollection() as $_memo){
00071             $_fullHistory[$_memo->getEntityId()] =
00072                 $this->_prepareHistoryItem($this->__('Credit Memo #%s created', $_memo->getIncrementId()),
00073                     $_memo->getEmailSent(), $_memo->getCreatedAtDate());
00074 
00075             foreach ($_memo->getCommentsCollection() as $_comment){
00076                 $_fullHistory[$_comment->getEntityId()] =
00077                     $this->_prepareHistoryItem($this->__('Credit Memo #%s comment added', $_memo->getIncrementId()),
00078                         $_comment->getIsCustomerNotified(), $_comment->getCreatedAtDate(), $_comment->getComment());
00079             }
00080         }
00081 
00082         foreach ($order->getShipmentsCollection() as $_shipment){
00083             $_fullHistory[$_shipment->getEntityId()] =
00084                 $this->_prepareHistoryItem($this->__('Shipment #%s created', $_shipment->getIncrementId()),
00085                     $_shipment->getEmailSent(), $_shipment->getCreatedAtDate());
00086 
00087             foreach ($_shipment->getCommentsCollection() as $_comment){
00088                 $_fullHistory[$_comment->getEntityId()] =
00089                     $this->_prepareHistoryItem($this->__('Shipment #%s comment added', $_shipment->getIncrementId()),
00090                         $_comment->getIsCustomerNotified(), $_comment->getCreatedAtDate(), $_comment->getComment());
00091             }
00092         }
00093 
00094         foreach ($order->getInvoiceCollection() as $_invoice){
00095             $_fullHistory[$_invoice->getEntityId()] =
00096                 $this->_prepareHistoryItem($this->__('Invoice #%s created', $_invoice->getIncrementId()),
00097                     $_invoice->getEmailSent(), $_invoice->getCreatedAtDate());
00098 
00099             foreach ($_invoice->getCommentsCollection() as $_comment){
00100                 $_fullHistory[$_comment->getEntityId()] =
00101                     $this->_prepareHistoryItem($this->__('Invoice #%s comment added', $_invoice->getIncrementId()),
00102                         $_comment->getIsCustomerNotified(), $_comment->getCreatedAtDate(), $_comment->getComment());
00103             }
00104         }
00105 
00106         foreach ($order->getTracksCollection() as $_track){
00107             $_fullHistory[$_track->getEntityId()] =
00108                 $this->_prepareHistoryItem($this->__('Tracking number %s for %s assigned', $_track->getNumber(), $_track->getTitle()),
00109                     false, $_track->getCreatedAtDate());
00110         }
00111 
00112         krsort($_fullHistory);
00113         return $_fullHistory;
00114     }

getOrder (  ) 

Retrieve order model instance

Returns:
Mage_Sales_Model_Order

Definition at line 49 of file History.php.

00050     {
00051         return Mage::registry('current_order');
00052     }

getTabClass (  ) 

Definition at line 139 of file History.php.

00140     {
00141         return 'ajax only';
00142     }

getTabLabel (  ) 

######################## TAB settings #################################

Implements Mage_Adminhtml_Block_Widget_Tab_Interface.

Definition at line 129 of file History.php.

00130     {
00131         return Mage::helper('sales')->__('Comments History');
00132     }

getTabTitle (  ) 

Implements Mage_Adminhtml_Block_Widget_Tab_Interface.

Definition at line 134 of file History.php.

00135     {
00136         return Mage::helper('sales')->__('Order History');
00137     }

getTabUrl (  ) 

Definition at line 149 of file History.php.

00150     {
00151         return $this->getUrl('*/*/commentsHistory', array('_current' => true));
00152     }

isHidden (  ) 

Implements Mage_Adminhtml_Block_Widget_Tab_Interface.

Definition at line 159 of file History.php.

00160     {
00161         return false;
00162     }


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