Public Member Functions | |
__construct () | |
getCreditmemo () | |
getHeaderText () | |
getBackUrl () | |
getCaptureUrl () | |
getVoidUrl () | |
getCancelUrl () | |
getPrintUrl () | |
updateBackButtonUrl ($flag) |
Definition at line 34 of file View.php.
__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 }
getBackUrl | ( | ) |
Get URL for back (reset) button
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 | ( | ) |
getCaptureUrl | ( | ) |
getCreditmemo | ( | ) |
Retrieve creditmemo model instance
Definition at line 91 of file View.php.
00092 { 00093 return Mage::registry('current_creditmemo'); 00094 }
getHeaderText | ( | ) |
Get header text
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 | ( | ) |
getVoidUrl | ( | ) |
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 }