Mage_Rss_Block_Order_Status Class Reference

Inheritance diagram for Mage_Rss_Block_Order_Status:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Protected Member Functions

 _construct ()
 _toHtml ()


Detailed Description

Definition at line 34 of file Status.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 36 of file Status.php.

00037     {
00038         /*
00039         * setting cache to save the rss for 10 minutes
00040         */
00041         $this->setCacheKey('rss_order_status_'.$this->getRequest()->getParam('data'));
00042         $this->setCacheLifetime(600);
00043     }

_toHtml (  )  [protected]

Render block HTML

Returns:
string

Reimplemented from Mage_Core_Block_Template.

Definition at line 45 of file Status.php.

00046     {
00047         $rssObj = Mage::getModel('rss/rss');
00048         $order = Mage::registry('current_order');
00049         $title = Mage::helper('rss')->__('Order # %s Notification(s)',$order->getIncrementId());
00050         $newurl = Mage::getUrl('sales/order/view',array('order_id' => $order->getId()));
00051         $data = array('title' => $title,
00052                 'description' => $title,
00053                 'link'        => $newurl,
00054                 'charset'     => 'UTF-8',
00055                 );
00056         $rssObj->_addHeader($data);
00057         $resourceModel = Mage::getResourceModel('rss/order');
00058         $results = $resourceModel->getAllCommentCollection($order->getId());
00059         $entityTypes = $resourceModel->getEntityTypeIdsToTypes();
00060         $incrementIds = $resourceModel->getEntityIdsToIncrementIds();
00061         if($results){
00062             foreach($results as $result){
00063                 $urlAppend = 'view';
00064                 $type = $entityTypes[$result['entity_type_id']];
00065                 if($type && $type!='order'){
00066                    $urlAppend = $type;
00067                 }
00068                 $title = Mage::helper('rss')->__('Details for %s #%s', ucwords($type), $incrementIds[$result['parent_id']]);
00069 
00070                 $description = '<p>'.
00071                 Mage::helper('rss')->__('Notified Date: %s<br/>',$this->formatDate($result['created_at'])).
00072                 Mage::helper('rss')->__('Comment: %s<br/>',$result['comment']).
00073                 '</p>'
00074                 ;
00075                 $url = Mage::getUrl('sales/order/'.$urlAppend,array('order_id' => $order->getId()));
00076                 $data = array(
00077                     'title'         => $title,
00078                     'link'          => $url,
00079                     'description'   => $description,
00080                 );
00081                 $rssObj->_addEntry($data);
00082             }
00083         }
00084         $title = Mage::helper('rss')->__('Order #%s created at %s', $order->getIncrementId(), $this->formatDate($order->getCreatedAt()));
00085         $url = Mage::getUrl('sales/order/view',array('order_id' => $order->getId()));
00086         $description = '<p>'.
00087             Mage::helper('rss')->__('Current Status: %s<br/>',$order->getStatusLabel()).
00088             Mage::helper('rss')->__('Total: %s<br/>',$order->formatPrice($order->getGrandTotal())).
00089             '</p>'
00090         ;
00091         $data = array(
00092                     'title'         => $title,
00093                     'link'          => $url,
00094                     'description'   => $description,
00095         );
00096         $rssObj->_addEntry($data);
00097         return $rssObj->createRssXml();
00098     }


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

Generated on Sat Jul 4 17:24:39 2009 for Magento by  doxygen 1.5.8