/** * Renders action link only if shipment has the valid status * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { $actions = $this->getColumn()->getActions(); if ($row->getStatus() == Dhl_Intraship_Model_Shipment::STATUS_PROCESSED || $row->getStatus() == Dhl_Intraship_Model_Shipment::STATUS_CLOSED) { return parent::render($row); } }
public function render(Varien_Object $row) { if ($row->getStatus() == 'certain') { $value = '<a href="' . $this->getUrl('*/*/change/status/unbound/url/index/id/' . $row->getId()) . '">' . Mage::helper('bankintegration')->__('Decouple') . '</a>'; } elseif ($row->getStatus() == 'guess') { $value = '<a href="' . $this->getUrl('*/*/change/status/certain/url/index/id/' . $row->getId()) . '">' . Mage::helper('bankintegration')->__('Confirm') . '</a><br>' . Mage::helper('bankintegration')->__('or') . '<br><a href="' . $this->getUrl('*/*/change/status/unbound/url/index/id/' . $row->getId()) . '">' . Mage::helper('bankintegration')->__('Decouple') . '</a>'; } else { $value = '<a href="' . $this->getUrl('*/*/change/status/neglected/url/index/id/' . $row->getId()) . '">' . Mage::helper('bankintegration')->__('Ignore') . '</a>'; } return $value; }
public function render(Varien_Object $row) { $value = ''; // Add additional information regarding the state of the payment if ($row->getStatus() == 'certain') { // Get the orderdata $orderdata = Mage::getResourceModel('sales/order_collection'); $orders = $orderdata->addFieldToFilter('increment_id', $row->getBindorder())->getItems(); $order = reset($orders); // Compute the total payment so far $totalamount = 0; $sameorderpayments = Mage::getModel('bankintegration/bankintegration')->getCollection()->addFieldToFilter('bindorder', $order->getIncrementId())->getItems(); foreach ($sameorderpayments as $bankpayment) { $totalamount = $totalamount + $bankpayment->getAmount(); } // Compute the paid fraction $percentage = sprintf('%.0f', 100 * $totalamount / ($order->getGrandTotal() * 1.0)); if ($percentage < 100) { $color = 'red'; } elseif ($percentage == 100) { $color = 'green'; } else { $color = 'orange'; } $value .= '<p style="color:' . $color . '">' . $percentage . '%</color>'; } return $value; }
public function render(Varien_Object $row) { $statuses = Mage::helper('magenotification')->getFeedbackStatusList(); switch ((int) $row->getStatus()) { case 1: $prefix = 'notice'; break; case 2: $prefix = 'critical'; break; case 3: default: $prefix = 'major'; } return '<span class="grid-severity-' . $prefix . '"><span>' . $statuses[(int) $row->getStatus()] . '</span></span>'; }
public function render(Varien_Object $row) { $url = $this->getUrl('*/*/verified', array('id' => $row->getId())); $url1 = $this->getUrl('*/*/invalid', array('id' => $row->getId())); if ($row->getStatus() == 0) { $html = '<select id="' . $row->getId() . '" style="display:none;" onchange="varienGridAction.execute(this);" class="action-select"><option value=""></option><option value="{"class":"verified","title":"Unverified","href":"' . $url . '"}">Verified</option><option value="{"class":"invalid","title":"Invalid","href":"' . $url1 . '"}">Invalid</option></select><a class="verified" onclick="$("' . $row->getId() . '").show();$(this).hide();" title="Unverified">Verified</a>'; return $html; } elseif ($row->getStatus() == 1) { $this->getColumn()->setActions(array(array('url' => $this->getUrl("*/*/unverified", array("id" => $row->getId())), 'caption' => Mage::helper('docupload')->__('Unverified'), 'class' => 'unverified', 'title' => 'Verified'))); } elseif ($row->getStatus() == 3) { $this->getColumn()->setActions(array(array('caption' => Mage::helper('docupload')->__('Invalid Doc'), 'class' => 'invalid', 'title' => 'Invalid Doc'))); } else { $this->getColumn()->setActions(array(array('caption' => Mage::helper('docupload')->__('Not Applicable'), 'class' => 'not_applicable', 'title' => 'Not Applicable'))); } return parent::render($row); }
public function render(Varien_Object $row) { $places = Mage::getModel('pointofsale/pointofsale')->getPlaces(); $inventory = Mage::helper('advancedinventory')->__('Not Assigned'); $options[] = "<option value='0'>" . $inventory . "</option>"; foreach ($places as $p) { $inventoryName = $p->getName() . ' (' . $p->getStoreCode() . ')'; if ($row->getAssignation() == $p->getPlaceId()) { $inventory = $inventoryName; $selected = 'selected'; } else { $selected = null; } $options[] = "<option " . $selected . " value='" . $p->getPlaceId() . "'>" . $inventoryName . "</option>"; } if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/change_assignation') && !in_array($row->getStatus(), array('canceled', 'closed', 'complete', 'fraud', 'holded'))) { $html = "<select onchange='InventoryManager.changeAssignation(" . $row->getId() . ",this.value,\"" . $this->getUrl('advancedinventory/adminhtml_stocks/reassign') . "\")'>\n <optgroup label='" . Mage::helper('advancedinventory')->__('Change to ...') . "'>"; foreach ($options as $option) { $html .= $option; } $html .= "</optgroup>\n </select>"; } else { return $inventory; } return $html; }
/** * Renders column * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { if ($row->getStatus() != OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_FAILED) { return ''; } return parent::render($row); }
public function render(Varien_Object $row) { if (in_array($row->getStatus(), array('0', '3'))) { return sprintf('<a href="#" onclick="am_feed_object.request(%d);">%s</a>', $row->getFeedId(), Mage::helper('amfeed')->__('Generate')); } else { return ''; } }
protected function _getValue(Varien_Object $row) { $str = '<a href="' . $this->getUrl('*/*/disapprove', array('id' => $row->getEntityId())) . '">Disapprove</a>'; if ($row->getStatus() == 2 && $row->getVisibility() == 1) { $str = '<a href="' . $this->getUrl('*/*/approve', array('id' => $row->getEntityId())) . '">Approve</a>'; } return $str; }
/** * Renders column * * Shows link in one row instead of select element in parent class * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { $actions = $this->getColumn()->getActions(); if (empty($actions) || !is_array($actions)) { return ' '; } $out = '<input type="hidden" id="h' . $row->getId() . '" name="h' . $row->getId() . '" value="' . $row->getId() . '" class="rowId" />'; $out .= '<input type="hidden" name="items[' . $row->getId() . '][order_item_id]" value="' . $row->getOrderItemId() . '" />'; $separator = ''; foreach ($actions as $action) { if (!(isset($action['status_depended']) && ($row->getStatus() === Enterprise_Rma_Model_Rma_Source_Status::STATE_APPROVED || $row->getStatus() === Enterprise_Rma_Model_Rma_Source_Status::STATE_DENIED || $row->getStatus() === Enterprise_Rma_Model_Rma_Source_Status::STATE_REJECTED))) { $out .= $separator . $this->_toLinkHtml($action, $row); $separator = '<span class="separator">|</span>'; } } return $out; }
public function render(Varien_Object $row) { if ($row->getStatus() == 'unbound') { $form = '<form action="' . $this->getUrl('*/*/manualBindCheck/id/' . $row->getId() . '') . '" method="post"><input type="text" name="bind" size="16"><input name="form_key" type="hidden" value="' . Mage::getSingleton('core/session')->getFormKey() . '"/></input><input type="submit" value="OK"></form>'; } else { $form = ''; } return $form; }
public function render(Varien_Object $row) { if ($row->getStatus() == 'unbound') { $form = '<form action="' . $this->getUrl('*/*/manualBind/id/' . $row->getId() . '') . '" method="post"><select name="bind" onchange="javascript:this.form.submit()">' . $this->getOptions() . '</select><input name="form_key" type="hidden" value="' . Mage::getSingleton('core/session')->getFormKey() . '"/></input></form>'; } else { $form = $row->getBindname(); } return $form; }
/** * Column renderer method * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { /** @var Mage_Index_Model_Process $row */ if ($row->getStatus() === Mage_Index_Model_Process::STATUS_RUNNING) { return $this->_renderProgress($row); } else { return $this->_renderAvgRuntime($row); } }
/** * Render approval link in each vendor row * @param Varien_Object $row * @return String */ public function render(Varien_Object $row) { $html = ''; if ($row->getEntityId() != '' && $row->getStatus() != Ced_CsMarketplace_Model_Vendor::VENDOR_APPROVED_STATUS) { $order = Mage::getModel('sales/order')->loadByIncrementId($row->getOrderId()); $url = $this->getUrl('*/*/massStatus', array('vendor_id' => $row->getEntityId(), 'status' => Ced_CsMarketplace_Model_Vendor::VENDOR_APPROVED_STATUS, 'inline' => 1)); $html .= '<a href="javascript:void(0);" onclick="deleteConfirm(\'' . $this->__('Are you sure you want to Approve?') . '\', \'' . $url . '\');" >' . Mage::helper('csmarketplace')->__('Approve') . '</a>'; } if ($row->getEntityId() != '' && $row->getStatus() != Ced_CsMarketplace_Model_Vendor::VENDOR_DISAPPROVED_STATUS) { if (strlen($html) > 0) { $html .= ' | '; } $order = Mage::getModel('sales/order')->loadByIncrementId($row->getOrderId()); $url = $this->getUrl('*/*/massStatus', array('vendor_id' => $row->getEntityId(), 'status' => Ced_CsMarketplace_Model_Vendor::VENDOR_DISAPPROVED_STATUS, 'inline' => 1)); $html .= '<a href="javascript:void(0);" onclick="deleteConfirm(\'' . $this->__('Are you sure you want to Disapprove?') . '\', \'' . $url . '\');" >' . Mage::helper('csmarketplace')->__('Disapprove') . "</a>"; } return $html; }
public function checkDealStatus(Varien_Object $_deal, $_productStatus, $_inStock, $_productTypeId) { $origDealStatus = $_deal->getStatus(); // get store datetime $helper = Mage::helper('multipledeals'); $currentDateTime = $helper->getCurrentDateTime(0); $dealStatus = self::STATUS_ENDED; //check if disabled if ($_productStatus != 2 && $_inStock && $_deal->getStatus() != self::STATUS_DISABLED) { //check if running && if deal is still in stock if ($currentDateTime >= $_deal->getDatetimeFrom() && $currentDateTime <= $_deal->getDatetimeTo()) { $dealQtyValidationTypes = array('simple', 'virtual', 'downloadable'); if (in_array($_productTypeId, $dealQtyValidationTypes) && $_deal->getDealQty() > 0) { $dealStatus = self::STATUS_RUNNING; } else { if (!in_array($_productTypeId, $dealQtyValidationTypes)) { $dealStatus = self::STATUS_RUNNING; } else { $dealStatus = self::STATUS_ENDED; } } //check if queued } elseif ($currentDateTime <= $_deal->getDatetimeFrom()) { $dealStatus = self::STATUS_QUEUED; //check if ended } elseif ($currentDateTime >= $_deal->getDatetimeTo()) { $dealStatus = self::STATUS_ENDED; } } else { $dealStatus = self::STATUS_DISABLED; } //verify if product needs to be disabled $disableProduct = false; if (($currentDateTime >= $_deal->getDatetimeTo() || $_deal->getStatus() == self::STATUS_DISABLED) && $_deal->getDisable() == 2 && $_productStatus == 1) { $disableProduct = true; $dealStatus = self::STATUS_DISABLED; } if ($origDealStatus == $dealStatus && !$disableProduct) { return false; } else { return array('status' => $dealStatus, 'disable_product' => $disableProduct); } }
public function render(Varien_Object $row) { $url = $this->getUrl("*/*/changeStatus", array('template_id' => $row->getId())); $status = $this->__('Enable'); if ($row->getStatus()) { $status = $this->__('Disable'); } $value = '<a href="' . $url . '">' . $status . "</a>"; return $value; }
public function render(Varien_Object $row) { $url = $this->getUrl('marketplace/adminhtml_commission/pay', array('id' => $row->getEntityId())); $_approvedStatusId = Mage::getModel('marketplace/selleroptions')->getSellerApprovedStatusId(); $_sellerStatusId = $row->getStatus(); if (isset($_approvedStatusId) && $_approvedStatusId == $_sellerStatusId) { $html = '<a href="' . $url . '">Pay</a>'; } return $html; }
/** * Decorate status column values * * @param string $value Check result * @param Mage_Catalog_Model_Product|Varien_Object $row Current row * @return string Cell content */ public function decorateStatus($value, $row) { $class = ''; if ($row->getStatus()) { $cell = '<span class="grid-severity-notice"><span>' . $value . '</span></span>'; } else { $cell = '<span class="grid-severity-critical"><span>' . $value . '</span></span>'; } return $cell; }
public function render(Varien_Object $row) { $edit = $this->getUrl('*/*/edit', array('id' => $row->getId())); $cancel = $this->getUrl('*/*/cancelPayment', array('id' => $row->getId())); if ($row->getStatus() <= 2) { return sprintf('<a href="%s" title="%s">%s</a> | <a href="%s" title="%s">%s</a>', $edit, Mage::helper('affiliateplus')->__('Edit Withdrawals'), Mage::helper('affiliateplus')->__('Edit'), $cancel, Mage::helper('affiliateplus')->__('Cancel Withdrawals'), Mage::helper('affiliateplus')->__('Cancel')); } else { return sprintf('<a href="%s" title="%s">%s</a>', $edit, Mage::helper('affiliateplus')->__('Edit Withdrawals'), Mage::helper('affiliateplus')->__('Edit')); } }
/** * Renders grid column * * @param Varien_Object $row * @return string */ public function _getValue(Varien_Object $row) { $status = $row->getStatus(); if ($status == Noovias_Cron_Model_Schedule_Config::STATUS_DISABLED) { $style = 'color:red; font-weight:bold;'; } else { $style = ''; } $return = '<span style="' . $style . '">' . Mage::helper('noovias_cron')->__($status) . '</span>'; return $return; }
/** * Renders column * * Render column depending on row status value, which define whether cell is editable * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { $statusManager = Mage::getSingleton('enterprise_rma/item_status'); $statusManager->setStatus($row->getStatus()); $this->setStatusManager($statusManager); if ($statusManager->getAttributeIsEditable($this->getColumn()->getIndex())) { return $this->_getEditableView($row); } else { return $this->_getNonEditableView($row); } }
/** * Render grid row * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { $actions = array(array('caption' => $this->__('Preview'), 'url' => $this->getUrl('*/*/previewQueue', array('id' => $row->getId())), 'popup' => true)); if ($row->getStatus() == Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE) { $actions[] = array('caption' => $this->__('Edit'), 'url' => $this->getUrl('*/*/editQueue', array('id' => $row->getId()))); $actions[] = array('caption' => $this->__('Cancel'), 'url' => $this->getUrl('*/*/cancelQueue', array('id' => $row->getId())), 'confirm' => $this->__('Are you sure you want to cancel a message?')); } $actions[] = array('caption' => $this->__('Delete'), 'url' => $this->getUrl('*/*/deleteQueue', array('id' => $row->getId())), 'confirm' => $this->__('Are you sure you want to delete a message?')); $this->getColumn()->setActions($actions); return parent::render($row); }
public function render(Varien_Object $row) { $html = ''; $status = $row->getStatus(); $adjuststockId = $row->getAdjuststockId(); if ($status == 0) { $html = '<a href="' . $this->getUrl('inventoryplusadmin/adminhtml_adjuststock/edit', array('id' => $adjuststockId)) . '">' . Mage::helper('inventoryplus')->__('Edit') . '</a>'; } else { $html = '<a href="' . $this->getUrl('inventoryplusadmin/adminhtml_adjuststock/edit', array('id' => $adjuststockId)) . '">' . Mage::helper('inventoryplus')->__('View') . '</a>'; } return $html; }
public function render(Varien_Object $row) { $html = ''; $status = $row->getStatus(); $receipt_log_id = $row->getReceiptLogId(); if ($status == 1) { $html = '<a href="' . $this->getUrl('inventoryreceiptadmin/adminhtml_receiptlog/view', array('id' => $receipt_log_id)) . '">' . Mage::helper('inventoryplus')->__('Edit') . '</a>'; } else { $html = '<a href="' . $this->getUrl('inventoryreceiptadmin/adminhtml_receiptlog/view', array('id' => $receipt_log_id)) . '">' . Mage::helper('inventoryplus')->__('View') . '</a>'; } return $html; }
public function render(Varien_Object $row) { $status = $row->getStatus(); $productId = $row->getProductId(); $url = Mage::helper('adminhtml')->getUrl('adminhtml/catalog_product/edit', array('id' => $productId, 'tab' => 'product_info_tabs_group_49', 'deal' => 1)); if ($status == 3) { $label = Mage::helper('adminhtml')->__('Add new'); } else { $label = Mage::helper('adminhtml')->__('Edit'); } $html = '<a href="' . $url . '">' . $label . '</a>'; return $html; }
public function updateData($data) { $is_updated = false; $dataObject = new Varien_Object($data); $feedbackDataObject = new Varien_Object($dataObject->getFeedback()); $messages = $dataObject->getMessage(); $helper = Mage::helper('magenotification'); // update feedback if ($feedbackDataObject->getStatus() != $this->getStatus()) { $this->setStatus($feedbackDataObject->getStatus()); $is_updated = true; } if ($feedbackDataObject->getCouponCode() != $this->getCouponCode()) { $this->setCouponCode($feedbackDataObject->getCouponCode()); $is_updated = true; } if ($feedbackDataObject->getCouponValue() != $this->getCouponValue()) { $this->setCouponValue($feedbackDataObject->getCouponValue()); $is_updated = true; } if ($feedbackDataObject->getExpiredCoupon() != $this->getExpiredCoupon()) { $this->setExpiredCoupon($feedbackDataObject->getExpiredCoupon()); $is_updated = true; } $this->setUpdated(time()); $this->save(); //update message if (count($messages)) { $messageModel = Mage::getModel('magenotification/feedbackmessage'); foreach ($messages as $message) { $messageDataObject = new Varien_Object($message); $messageModel->import($messageDataObject); } } return $this; }
protected function _getProgressBarHtml(Varien_Object $row) { $percent = $row->getSaved() / $row->getTotal() * 100; if ($percent >= 100) { $percent = 100; $message = $row->getStatus(); } else { $message = $this->__('%s of %s messages processed', $row->getSaved(), $row->getTotal()); } return ' <div id="progress_bar"> <div class="status" style="width: ' . (int) $percent . '%;height:100%;"></div> <p>' . $message . '</p> </div>'; }
/** * Render grid row * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { $str = ''; if (is_numeric($row->getStatus())) { switch ($row->getStatus()) { case Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE: $str = $this->__('In Queue'); break; case Mage_XmlConnect_Model_Queue::STATUS_CANCELED: $str = $this->__('Cancelled'); break; case Mage_XmlConnect_Model_Queue::STATUS_COMPLETED: $str = $this->__('Completed'); break; case Mage_XmlConnect_Model_Queue::STATUS_DELETED: $str = $this->__('Deleted'); break; } } if ($str === '') { $str = $this->__('Undefined'); } return $this->escapeHtml($str); }
public function render(Varien_Object $row) { if ($row->getStatus() != 'unbound') { $orderdata = Mage::getResourceModel('sales/order_collection'); $orders = $orderdata->addFieldToFilter('increment_id', $row->getBindorder())->getItems(); foreach ($orders as $order) { $id = $order->getId(); } if (!($ordernumber = $row->getBindorder())) { $ordernumber = '000000000'; } $form = '<a href="' . $this->getUrl('adminhtml/sales_order/view/order_id/' . $id . '/') . '">' . $ordernumber . '</a>'; } else { $form = ''; } return $form; }
public function render(Varien_Object $row) { $status = $row->getStatus(); $isActive = $row->getIsActive(); $label = __('Disabled'); $class = 'grid-severity-major'; if ($isActive) { if ($status == 1) { $class = 'grid-severity-notice'; $label = __('Ready'); } else { $class = 'grid-severity-critical'; $label = __('Reindex Required'); } } return $formatString = "<span class='{$class}'><span>{$label}</span></span>"; }