public function render(Varien_Object $row) { $html = parent::render($row); $hlp = Mage::helper('udropship'); $calGridUrl = Mage::getDesign()->getSkinUrl('images/grid-cal.gif'); $fromDate = $row->getData('special_from_date'); $toDate = $row->getData('special_to_date'); if ($fromDate) { $fromDate = $hlp->dateInternalToLocale($fromDate); } if ($toDate) { $toDate = $hlp->dateInternalToLocale($toDate); } $spLabel = $hlp->__('Special Price'); $sfdLabel = $hlp->__('From Date'); $stdLabel = $hlp->__('To Date'); $_dateFormat = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); $_calDateFormat = Varien_Date::convertZendToStrFtime($_dateFormat, true, false); if ($this->getColumn()->getEditable()) { $htmlId = '_' . md5(uniqid(microtime(), true)); $html .= <<<EOT <nobr><br /> {$sfdLabel} <input id="{$htmlId}_sfd" type="text" class="input-text" name="_special_from_date" value="{$fromDate}" style="width:110px !important;" /> <!--img src="{$calGridUrl}" alt="" class="v-middle"title="" style="" /--> </nobr> <script type="text/javascript"> //<![CDATA[ Calendar.setup({ inputField: "{$htmlId}_sfd", ifFormat: "{$_calDateFormat}", showsTime: false, button: "{$htmlId}__sfd_trig", align: "Bl", singleClick : true }); //]]> </script> </nobr> <nobr><br /> {$stdLabel} <input id="{$htmlId}_std" type="text" class="input-text" name="_special_to_date" value="{$toDate}" style="width:110px !important;" /> <!--img src="{$calGridUrl}" alt="" class="v-middle"title="" style="" /--> </nobr> <script type="text/javascript"> //<![CDATA[ Calendar.setup({ inputField: "{$htmlId}_std", ifFormat: "{$_calDateFormat}", showsTime: false, button: "{$htmlId}__std_trig", align: "Bl", singleClick : true }); //]]> </script> </nobr> EOT; } return $html; }
/** * Renders grid column * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { if ($this->getColumn()->getEditable()) { return parent::render($row); } $value = $this->_getValue($row); $value = round($value, 2); return $value . ' %'; }
protected function _getValue(Varien_Object $row) { $data = parent::_getValue($row); if (!is_null($data)) { $value = $data * 1; return $value ? $value : ''; // fixed for showing blank cell in grid /** * @todo may be bug in i.e. needs to be fixed */ } return $this->getColumn()->getDefault(); }
public function render(Varien_Object $row) { $html = parent::render($row); $hlp = Mage::helper('udropship'); $vId = $this->getColumn()->getVendorId() ? $this->getColumn()->getVendorId() : $row->getVendorId(); if ($this->getColumn()->getEditable() && Mage::helper('udropship')->isUdmultiAvailable() && ($urq = Mage::getSingleton('udropship/source')->getVendorsColumn('use_reserved_qty')) && !empty($urq[$vId]) && $this->getColumn()->getUrqId()) { $rQty = $row->getReservedQty() * 1; $htmlId = '_' . md5(uniqid(microtime(), true)); $lbl = $hlp->__('Includes Reserved Qty') . " ({$rQty})"; $html .= <<<EOT <nobr><br /> <input id="{$htmlId}" type="checkbox" name="{$this->getColumn()->getUrqId()}" value="1" /> {$lbl} </nobr> EOT; } return $html; }
public function setColumn($column) { $column->setEditable(true); return parent::setColumn($column); }