public function render(Varien_Object $row) { $actions = array(); if ($row->getQueueStatus() == Mage_Newsletter_Model_Queue::STATUS_NEVER) { if (!$row->getQueueStartAt() && $row->getSubscribersTotal()) { $actions[] = array('url' => $this->getUrl('*/*/start', array('id' => $row->getId())), 'caption' => Mage::helper('newsletter')->__('Start')); } } else { if ($row->getQueueStatus() == Mage_Newsletter_Model_Queue::STATUS_SENDING) { $actions[] = array('url' => $this->getUrl('*/*/pause', array('id' => $row->getId())), 'caption' => Mage::helper('newsletter')->__('Pause')); $actions[] = array('url' => $this->getUrl('*/*/cancel', array('id' => $row->getId())), 'confirm' => Mage::helper('newsletter')->__('Do you really want to cancel the queue?'), 'caption' => Mage::helper('newsletter')->__('Cancel')); } else { if ($row->getQueueStatus() == Mage_Newsletter_Model_Queue::STATUS_PAUSE) { $actions[] = array('url' => $this->getUrl('*/*/resume', array('id' => $row->getId())), 'caption' => Mage::helper('newsletter')->__('Resume')); } } } $actions[] = array('url' => $this->getUrl('*/newsletter_queue/preview', array('id' => $row->getId())), 'caption' => Mage::helper('newsletter')->__('Preview'), 'popup' => true); $this->getColumn()->setActions($actions); return parent::render($row); }
public function render(Varien_Object $row) { $actions = array(); $helper = Mage::helper('newsletter'); $rowId = $row->getId(); /* * * const STATUS_NEVER = 0; * const STATUS_SENDING = 1; * const STATUS_CANCEL = 2; * const STATUS_SENT = 3; * const STATUS_PAUSE = 4; * */ switch ($row->getQueueStatus()) { case Mage_Newsletter_Model_Queue::STATUS_NEVER: /* start now */ if ($row->getSubscribersTotal()) { $actions[] = array('url' => $this->getUrl('*/*/start', array('id' => $rowId)), 'confirm' => $helper->__('Do you really want to start the queue now?'), 'caption' => $helper->__('Start now')); } /* cancel */ $actions[] = array('url' => $this->getUrl('*/*/cancel', array('id' => $rowId)), 'confirm' => $helper->__('Do you really want to cancel the queue?'), 'caption' => $helper->__('Cancel')); break; case Mage_Newsletter_Model_Queue::STATUS_SENT: /* delete */ $actions[] = array('url' => $this->getUrl('*/*/delete', array('id' => $rowId)), 'confirm' => $helper->__('Do you really want to delete the queue?'), 'caption' => $helper->__('Delete')); break; case Mage_Newsletter_Model_Queue::STATUS_SENDING: /* pause */ $actions[] = array('url' => $this->getUrl('*/*/pause', array('id' => $rowId)), 'caption' => $helper->__('Pause')); /* cancel */ $actions[] = array('url' => $this->getUrl('*/*/cancel', array('id' => $rowId)), 'confirm' => $helper->__('Do you really want to cancel the queue?'), 'caption' => $helper->__('Cancel')); break; case Mage_Newsletter_Model_Queue::STATUS_CANCEL: /* delete */ $actions[] = array('url' => $this->getUrl('*/*/delete', array('id' => $rowId)), 'confirm' => $helper->__('Do you really want to delete the queue?'), 'caption' => $helper->__('Delete')); break; case Mage_Newsletter_Model_Queue::STATUS_PAUSE: /* resume */ $actions[] = array('url' => $this->getUrl('*/*/resume', array('id' => $rowId)), 'caption' => $helper->__('Resume')); /* cancel */ $actions[] = array('url' => $this->getUrl('*/*/cancel', array('id' => $rowId)), 'confirm' => $helper->__('Do you really want to cancel the queue?'), 'caption' => $helper->__('Cancel')); break; default: break; } /* preview */ $actions[] = array('url' => $this->getUrl('*/adminhtml_template/preview', array('id' => $row->getTemplateId())), 'caption' => $helper->__('Preview'), 'popup' => true); $this->getColumn()->setActions($actions); return parent::render($row); }
public function render(Varien_Object $row) { return Mage::helper('customer')->__($this->getStatus($row->getQueueStatus())); }