Mage_Adminhtml_Controller_Sales_Shipment Class Reference

Inheritance diagram for Mage_Adminhtml_Controller_Sales_Shipment:

Mage_Adminhtml_Controller_Action Mage_Core_Controller_Varien_Action Mage_Adminhtml_Sales_Order_ShipmentController Mage_Adminhtml_Sales_ShipmentController

List of all members.

Public Member Functions

 indexAction ()
 viewAction ()
 pdfshipmentsAction ()
 printAction ()

Protected Member Functions

 _construct ()
 _initAction ()
 _isAllowed ()


Detailed Description

Adminhtml sales orders controller

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 of file Shipment.php.


Member Function Documentation

_construct (  )  [protected]

Additional initialization

Reimplemented from Mage_Core_Controller_Varien_Action.

Definition at line 38 of file Shipment.php.

00039     {
00040         $this->setUsedModuleName('Mage_Sales');
00041     }

_initAction (  )  [protected]

Init layout, menu and breadcrumb

Returns:
Mage_Adminhtml_Sales_ShipmentController

Definition at line 48 of file Shipment.php.

00049     {
00050         $this->loadLayout()
00051             ->_setActiveMenu('sales/order')
00052             ->_addBreadcrumb($this->__('Sales'), $this->__('Sales'))
00053             ->_addBreadcrumb($this->__('Shipments'),$this->__('Shipments'));
00054         return $this;
00055     }

_isAllowed (  )  [protected]

Reimplemented from Mage_Adminhtml_Controller_Action.

Definition at line 116 of file Shipment.php.

00117     {
00118         return Mage::getSingleton('admin/session')->isAllowed('sales/shipment');
00119     }

indexAction (  ) 

Shipments grid

Definition at line 60 of file Shipment.php.

00061     {
00062         $this->_initAction()
00063             ->_addContent($this->getLayout()->createBlock('adminhtml/sales_shipment'))
00064             ->renderLayout();
00065     }

pdfshipmentsAction (  ) 

Definition at line 79 of file Shipment.php.

00079                                         {
00080         $shipmentIds = $this->getRequest()->getPost('shipment_ids');
00081         if (!empty($shipmentIds)) {
00082             $shipments = Mage::getResourceModel('sales/order_shipment_collection')
00083                 ->addAttributeToSelect('*')
00084                 ->addAttributeToFilter('entity_id', array('in' => $shipmentIds))
00085                 ->load();
00086             if (!isset($pdf)){
00087                 $pdf = Mage::getModel('sales/order_pdf_shipment')->getPdf($shipments);
00088             } else {
00089                 $pages = Mage::getModel('sales/order_pdf_shipment')->getPdf($shipments);
00090                 $pdf->pages = array_merge ($pdf->pages, $pages->pages);
00091             }
00092 
00093             return $this->_prepareDownloadResponse('packingslip'.Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').'.pdf', $pdf->render(), 'application/pdf');
00094         }
00095         $this->_redirect('*/*/');
00096     }

printAction (  ) 

See also:
Mage_Adminhtml_Sales_Order_InvoiceController

Definition at line 99 of file Shipment.php.

00100     {
00101         /** @see Mage_Adminhtml_Sales_Order_InvoiceController */
00102         if ($shipmentId = $this->getRequest()->getParam('invoice_id')) { // invoice_id o_0
00103             if ($shipment = Mage::getModel('sales/order_shipment')->load($shipmentId)) {
00104                 if ($shipment->getStoreId()) {
00105                     Mage::app()->setCurrentStore($shipment->getStoreId());
00106                 }
00107                 $pdf = Mage::getModel('sales/order_pdf_shipment')->getPdf(array($shipment));
00108                 $this->_prepareDownloadResponse('packingslip'.Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').'.pdf', $pdf->render(), 'application/pdf');
00109             }
00110         }
00111         else {
00112             $this->_forward('noRoute');
00113         }
00114     }

viewAction (  ) 

Shipment information page

Reimplemented in Mage_Adminhtml_Sales_Order_ShipmentController.

Definition at line 70 of file Shipment.php.

00071     {
00072         if ($shipmentId = $this->getRequest()->getParam('shipment_id')) {
00073             $this->_forward('view', 'sales_order_shipment', null, array('come_from'=>'shipment'));
00074         } else {
00075             $this->_forward('noRoute');
00076         }
00077     }


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

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