Mage_Adminhtml_Block_Sales_Order_Creditmemo_View Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Order_Creditmemo_View:

Mage_Adminhtml_Block_Widget_Form_Container Mage_Adminhtml_Block_Widget_Container Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getCreditmemo ()
 getHeaderText ()
 getBackUrl ()
 getCaptureUrl ()
 getVoidUrl ()
 getCancelUrl ()
 getPrintUrl ()
 updateBackButtonUrl ($flag)


Detailed Description

Definition at line 34 of file View.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Mage_Adminhtml_Block_Widget_Form_Container.

Definition at line 37 of file View.php.

00038     {
00039         $this->_objectId    = 'creditmemo_id';
00040         $this->_controller  = 'sales_order_creditmemo';
00041         $this->_mode        = 'view';
00042 
00043         parent::__construct();
00044 
00045         $this->_removeButton('save');
00046         $this->_removeButton('reset');
00047         $this->_removeButton('delete');
00048 
00049         if ($this->getCreditmemo()->canCancel()) {
00050             $this->_addButton('cancel', array(
00051                 'label'     => Mage::helper('sales')->__('Cancel'),
00052                 'class'     => 'delete',
00053                 'onclick'   => 'setLocation(\''.$this->getCancelUrl().'\')'
00054                 )
00055             );
00056         }
00057 
00058         if ($this->getCreditmemo()->canRefund()) {
00059             $this->_addButton('refund', array(
00060                 'label'     => Mage::helper('sales')->__('Refund'),
00061                 'class'     => 'save',
00062                 'onclick'   => 'setLocation(\''.$this->getRefundUrl().'\')'
00063                 )
00064             );
00065         }
00066 
00067         if ($this->getCreditmemo()->canVoid()) {
00068             $this->_addButton('void', array(
00069                 'label'     => Mage::helper('sales')->__('Void'),
00070                 'class'     => 'save',
00071                 'onclick'   => 'setLocation(\''.$this->getVoidUrl().'\')'
00072                 )
00073             );
00074         }
00075         
00076         if ($this->getCreditmemo()->getId()) {
00077             $this->_addButton('print', array(
00078                 'label'     => Mage::helper('sales')->__('Print'),
00079                 'class'     => 'save',
00080                 'onclick'   => 'setLocation(\''.$this->getPrintUrl().'\')'
00081                 )
00082             );
00083         }
00084     }


Member Function Documentation

getBackUrl (  ) 

Get URL for back (reset) button

Returns:
string

Reimplemented from Mage_Adminhtml_Block_Widget_Form_Container.

Definition at line 114 of file View.php.

00115     {
00116         return $this->getUrl(
00117             '*/sales_order/view',
00118             array(
00119                 'order_id'  => $this->getCreditmemo()->getOrderId(),
00120                 'active_tab'=> 'order_creditmemos'
00121             ));
00122     }

getCancelUrl (  ) 

Definition at line 134 of file View.php.

00135     {
00136         return $this->getUrl('*/*/cancel', array('creditmemo_id'=>$this->getCreditmemo()->getId()));
00137     }

getCaptureUrl (  ) 

Definition at line 124 of file View.php.

00125     {
00126         return $this->getUrl('*/*/capture', array('creditmemo_id'=>$this->getCreditmemo()->getId()));
00127     }

getCreditmemo (  ) 

Retrieve creditmemo model instance

Returns:
Mage_Sales_Model_Order_Creditmemo

Definition at line 91 of file View.php.

00092     {
00093         return Mage::registry('current_creditmemo');
00094     }

getHeaderText (  ) 

Get header text

Returns:
string

Reimplemented from Mage_Adminhtml_Block_Widget_Container.

Definition at line 96 of file View.php.

00097     {
00098         if ($this->getCreditmemo()->getEmailSent()) {
00099             $emailSent = Mage::helper('sales')->__('Credit Memo email sent');
00100         }
00101         else {
00102             $emailSent = Mage::helper('sales')->__('Credit Memo email not sent');
00103         }
00104 
00105         $header = Mage::helper('sales')->__('Credit Memo #%s | Date %s | Status %s (%s)',
00106             $this->getCreditmemo()->getIncrementId(),
00107             $this->formatDate($this->getCreditmemo()->getCreatedAtDate(), 'medium', true),
00108             $this->getCreditmemo()->getStateName(),
00109             $emailSent
00110         );
00111         return $header;
00112     }

getPrintUrl (  ) 

Definition at line 139 of file View.php.

00140     {
00141         return $this->getUrl('*/*/print', array(
00142             'invoice_id' => $this->getCreditmemo()->getId()
00143         ));
00144     }

getVoidUrl (  ) 

Definition at line 129 of file View.php.

00130     {
00131         return $this->getUrl('*/*/void', array('creditmemo_id'=>$this->getCreditmemo()->getId()));
00132     }

updateBackButtonUrl ( flag  ) 

Definition at line 146 of file View.php.

00147     {
00148         if ($flag) {
00149             return $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/sales_creditmemo/') . '\')');
00150         }
00151         return $this;
00152     }


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

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