00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Mage_Adminhtml_Block_Sales_Order_Invoice_Create_Tracking extends Mage_Adminhtml_Block_Template
00035 {
00036 public function _construct()
00037 {
00038 $this->setTemplate('sales/order/invoice/create/tracking.phtml');
00039 }
00040
00041
00042
00043
00044
00045
00046 protected function _prepareLayout()
00047 {
00048 $this->setChild('add_button',
00049 $this->getLayout()->createBlock('adminhtml/widget_button')
00050 ->setData(array(
00051 'label' => Mage::helper('sales')->__('Add Tracking Number'),
00052 'class' => '',
00053 'onclick' => 'trackingControl.add()'
00054 ))
00055 );
00056 }
00057
00058
00059
00060
00061
00062
00063 public function getShipment()
00064 {
00065 return Mage::registry('current_shipment');
00066 }
00067
00068
00069
00070
00071
00072
00073 public function getInvoice()
00074 {
00075 return Mage::registry('current_invoice');
00076 }
00077
00078
00079
00080
00081
00082
00083 public function getCarriers()
00084 {
00085
00086 $carriers = array();
00087 $carrierInstances = Mage::getSingleton('shipping/config')->getAllCarriers(
00088 $this->getInvoice()->getStoreId()
00089 );
00090 $carriers['custom'] = Mage::helper('sales')->__('Custom Value');
00091 foreach ($carrierInstances as $code => $carrier) {
00092 if ($carrier->isTrackingAvailable()) {
00093 $carriers[$code] = $carrier->getConfigData('title');
00094 }
00095 }
00096 return $carriers;
00097 }
00098 }