public function render(Varien_Object $row) { //get planning $planning = $row->getPlanning(); //if no planning found, try to load it from order id if ($planning == null) { $orderId = $row->getopp_order_id(); $planning = mage::getModel('Purchase/SalesOrderPlanning')->load($orderId, 'psop_order_id'); } if ($planning) { $html = '<div class="nowrap" style="text-align: left;">'; if ($planning->getFullstockDate() != '') { $html .= mage::helper('purchase')->__('Prepare') . ' : <font color="' . $this->getColorForDate($planning->getFullstockDate()) . '">' . mage::helper('core')->formatDate($planning->getFullstockDate(), 'short') . '</font>'; } if ($planning->getShippingDate() != '') { $html .= '<br>' . mage::helper('purchase')->__('Ship') . ' : <font color="' . $this->getColorForDate($planning->getShippingDate()) . '">' . mage::helper('core')->formatDate($planning->getShippingDate(), 'short') . '</font>'; } if ($planning->getDeliveryDate() != '') { $html .= '<br>' . mage::helper('purchase')->__('Delivery') . ' <font color="' . $this->getColorForDate($planning->getDeliveryDate()) . '">: ' . mage::helper('core')->formatDate($planning->getDeliveryDate(), 'short') . '</font>'; } $html .= '</div>'; } else { $html = $this->__('No planning'); } return $html; }
public function render(Varien_Object $row) { $mode = $this->getColumn()->getmode(); $retour = ''; switch ($mode) { case 'selected': $retour = '<a href="' . $this->getUrl('adminhtml/sales_order/view', array('order_id' => $row->getorder_id())) . '">' . $this->__('View order') . '</a>'; $retour .= '<br><a href="' . $this->getUrl('OrderPreparation/OrderPreparation/RemoveFromSelection', array('order_id' => $row->getorder_id())) . '">' . $this->__('Remove') . '</a>'; break; case 'fullstock': $retour = '<a href="' . $this->getUrl('adminhtml/sales_order/view', array('order_id' => $row->getopp_order_id())) . '">' . $this->__('View order') . '</a>'; $retour .= '<br><a href="' . $this->getUrl('OrderPreparation/OrderPreparation/AddToSelection', array('order_id' => $row->getopp_order_id())) . '">' . $this->__('Select') . '</a>'; break; case 'stockless': $retour = '<a href="' . $this->getUrl('adminhtml/sales_order/view', array('order_id' => $row->getopp_order_id())) . '">' . $this->__('View order') . '</a>'; $retour .= '<br><a href="' . $this->getUrl('OrderPreparation/OrderPreparation/AddToSelection', array('order_id' => $row->getopp_order_id())) . '">' . $this->__('Select') . '</a>'; break; case 'ignored': $retour = '<a href="' . $this->getUrl('adminhtml/sales_order/view', array('order_id' => $row->getopp_order_id())) . '">' . $this->__('View order') . '</a>'; $retour .= '<br><a href="' . $this->getUrl('OrderPreparation/OrderPreparation/AddToSelection', array('order_id' => $row->getopp_order_id())) . '">' . $this->__('Select') . '</a>'; break; } return $retour; }