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_Shipment_Create_Tracking extends Mage_Adminhtml_Block_Template
00035 {
00036
00037
00038
00039
00040
00041 protected function _prepareLayout()
00042 {
00043 $this->setChild('add_button',
00044 $this->getLayout()->createBlock('adminhtml/widget_button')
00045 ->setData(array(
00046 'label' => Mage::helper('sales')->__('Add Tracking Number'),
00047 'class' => '',
00048 'onclick' => 'trackingControl.add()'
00049 ))
00050
00051 );
00052
00053 }
00054
00055
00056
00057
00058
00059
00060 public function getShipment()
00061 {
00062 return Mage::registry('current_shipment');
00063 }
00064
00065
00066
00067
00068
00069
00070 public function getCarriers()
00071 {
00072 $carriers = array();
00073 $carrierInstances = Mage::getSingleton('shipping/config')->getAllCarriers(
00074 $this->getShipment()->getStoreId()
00075 );
00076 $carriers['custom'] = Mage::helper('sales')->__('Custom Value');
00077 foreach ($carrierInstances as $code => $carrier) {
00078 if ($carrier->isTrackingAvailable()) {
00079 $carriers[$code] = $carrier->getConfigData('title');
00080 }
00081 }
00082 return $carriers;
00083 }
00084 }