public function render(Varien_Object $row) { $actions[] = array('url' => $this->getUrl('*/*/edit', array('item_id' => $row->getId())), 'caption' => Mage::helper('robots')->__('Edit')); $actions[] = array('url' => $this->getUrl('*/*/delete', array('item_id' => $row->getId())), 'caption' => Mage::helper('robots')->__('Delete'), 'confirm' => Mage::helper('robots')->__('Are you sure you want to delete this item ?')); $this->getColumn()->setActions($actions); return parent::render($row); }
public function render(Varien_Object $row) { $manage_stock = Mage::getStoreConfig("cataloginventory/item_options/manage_stock"); if ($row->getManageStock() || $row->getUse_config_manage_stock() && $manage_stock) { if (in_array($row->getTypeId(), array('simple', 'virtual', 'downloadable'))) { $data = Mage::getModel('advancedinventory/stock')->getStockByProductIdAndPlaceId($row->getId(), $this->getColumn()->getPlaceId()); $qty = (int) $data->getQuantityInStock(); $enabled = $data->getManageStock(); if (!$row->getMultistock_enabled()) { $html = "-"; } else { if (!$enabled) { return Mage::helper('advancedinventory')->__("X"); } else { $html = "<input class='keydown inventory_input' value='" . $qty . "' / >"; } if (Mage::helper("advancedinventory/data")->isBackorderable($data)) { $html .= "<div title='Backorder allowed' class='ai-marker backorder'></div>"; } } } else { $html = "-"; } return "<span class='PosQty' id='PosQty_" . $row->getId() . "_" . $this->getColumn()->getPlaceId() . "'>" . $html . "</span>"; } else { return Mage::helper('advancedinventory')->__("X"); } }
public function render(Varien_Object $row) { $inventoryShipments = Mage::getModel('inventoryplus/warehouse_shipment')->getCollection()->addFieldToFilter('order_id', $row->getId())->addFieldToFilter('qty_shipped', array('gt' => 0)); $inventoryShipments->getSelect()->group('warehouse_id'); $html = ''; $htmlExport = ''; $whs = Mage::helper('inventoryshipment')->getAllWarehouseName(); if ($inventoryShipments->getSize() > 0) { foreach ($inventoryShipments as $inventoryShipment) { if ($inventoryShipment->getWarehouseId() != 0) { $html .= '<a href="' . $this->getUrl('inventoryplusadmin/adminhtml_warehouse/edit', array('id' => $inventoryShipment->getWarehouseId())) . '" >' . $whs[$inventoryShipment->getWarehouseId()] . '</a><br/>'; $htmlExport .= $whs[$inventoryShipment->getWarehouseId()] . ','; } } } else { if (Mage::helper('core')->isModuleEnabled('Magestore_Inventorydropship')) { $dropship = Mage::getModel('inventorydropship/inventorydropship')->getCollection()->addFieldToFilter('order_id', $row->getId())->addFieldToFilter('status', array('neq' => 5))->getFirstItem(); if ($dropship->getId()) { $html = 'Use Dropship'; } else { $html .= 'None'; } } else { $html .= 'None'; } } $htmlExport = rtrim($htmlExport, ','); if (in_array(Mage::app()->getRequest()->getActionName(), array('exportCsv', 'exportExcel'))) { return $htmlExport; } return $html; }
/** * Getting all available childs for Invoice, Shipmen or Creditmemo item * * @param Varien_Object $item * @return array */ public function getChilds($item) { $_itemsArray = array(); if ($item instanceof Mage_Sales_Model_Order_Item) { $_items = $item->getOrder()->getAllItems(); } else { if ($item instanceof Mage_Sales_Model_Order_Invoice_Item) { $_items = $item->getInvoice()->getAllItems(); } else { if ($item instanceof Mage_Sales_Model_Order_Shipment_Item) { $_items = $item->getShipment()->getAllItems(); } else { if ($item instanceof Mage_Sales_Model_Order_Creditmemo_Item) { $_items = $item->getCreditmemo()->getAllItems(); } } } } if ($_items) { foreach ($_items as $_item) { $parentItem = $_item->getParentItem(); if ($parentItem) { $_itemsArray[$parentItem->getId()][$_item->getId()] = $_item; } else { $_itemsArray[$_item->getId()][$_item->getId()] = $_item; } } } if (isset($_itemsArray[$item->getId()])) { return $_itemsArray[$item->getId()]; } else { return null; } }
public function render(Varien_Object $row) { $var = '<script type="text/javascript">function loginradiusChangeRaasStatus(fieldId, url, event) { new Ajax.Request(url, { method: "POST", parameters: {lr_entity_id: fieldId}, onSuccess: function (response) { document.getElementById("lr_block_unblock"+fieldId).textContent=response.responseText; return false; } }); return false;} </script>'; $url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . 'customerregistration/'; $connection = Mage::getSingleton('core/resource'); $readConnection = $connection->getConnection('core_read'); $tableName = $connection->getTableName('lr_sociallogin'); $query = "select status from {$tableName} where entity_id= '" . $row->getId() . "'"; $result = $readConnection->query($query)->fetch(); $statusText = 'Block'; if (is_array($result) && in_array('blocked', $result)) { $statusText = 'Unblock'; } else { if (isset($result['status']) && $result['status'] == 'blocked') { $statusText = 'Unblock'; } } return '<a href="#"><span id="lr_block_unblock' . $row->getId() . '" onclick="loginradiusChangeRaasStatus(' . $row->getId() . ', "' . $url . '");">' . $statusText . '</span></a>' . $var; }
public function render(Varien_Object $row) { $html = '<a href="#" onclick="editPopup(\'' . $row->getId() . '\'); return false;">' . $this->__('Edit') . '</a>'; $html .= ' | '; $html .= '<a href="#" onclick="deleteAnswer(\'' . $row->getId() . '\'); return false;">' . $this->__('Delete') . '</a>'; return $html; }
public function render(Varien_Object $row) { $html = ''; $manage_stock = Mage::getStoreConfig("cataloginventory/item_options/manage_stock"); if ($row->getManageStock() || $row->getUse_config_manage_stock() && $manage_stock) { if (in_array($row->getTypeId(), array('simple', 'virtual', 'downloadable'))) { $permissions = Mage::helper('advancedinventory/permissions')->getUserPermissions(); $all = $permissions->isAdmin(); $pos = $permissions->getPos(); if ($this->getStoreId()) { $places = Mage::getModel('pointofsale/pointofsale')->getPlacesByStoreId($this->getStoreId()); } else { $places = Mage::getModel('pointofsale/pointofsale')->getPlaces(); } $html = (int) 0; foreach ($places as $p) { if (in_array($p->getPlaceId(), $pos) || $all) { $data = Mage::getModel('advancedinventory/stock')->getStockByProductIdAndPlaceId($row->getId(), $p->getPlaceId()); $html += $data["quantity_in_stock"]; } } } else { $html = "-"; } $enabled = $row->getMultistock_enabled() ? 'enabled' : 'disabled'; return "<span class='GlobalQty' id='GlobalQty_" . $row->getId() . "' multistock='" . $enabled . "'>" . $html . "</span>"; } else { return Mage::helper('advancedinventory')->__("X"); } }
/** * Prepare form * * @return Mage_Adminhtml_Block_Widget_Form */ protected function _prepareForm() { $model = Mage::registry('current_template'); if (!$model) { $model = new Varien_Object(); } $action = $this->getUrl('*/*/saveTemplate'); $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $action, 'method' => 'post', 'enctype' => 'multipart/form-data')); $form->setHtmlIdPrefix('template_'); $fieldset = $form->addFieldset('edit_template', array('legend' => $this->__('Template'))); $this->_addElementTypes($fieldset); if ($model->getId()) { $fieldset->addField('id', 'hidden', array('name' => 'id')); $fieldset->addField('template_id', 'hidden', array('name' => 'template_id')); } $fieldset->addField('application_id', 'select', array('name' => 'application_id', 'label' => $this->__('Application'), 'title' => $this->__('Application'), 'disabled' => $model->getId() || !$this->_fieldsEnabled ? true : false, 'values' => Mage::helper('xmlconnect')->getApplicationOptions(), 'note' => $this->__('Creating a Template is allowed only for applications which have device type iPhone.'), 'required' => true)); $fieldset->addField('name', 'text', array('name' => 'name', 'label' => $this->__('Template Name'), 'title' => $this->__('Template Name'), 'required' => true, 'disabled' => $model->getId() || !$this->_fieldsEnabled ? true : false, 'note' => $this->__('Maximum length is 255'), 'maxlength' => 255)); $fieldset->addField('push_title', 'text', array('name' => 'push_title', 'label' => $this->__('Push Title'), 'title' => $this->__('Push Title'), 'required' => true, 'disabled' => !$this->_fieldsEnabled ? true : false, 'note' => $this->__('Maximum length is 140'), 'maxlength' => 140)); $this->_dependentFields['message_title'] = $fieldset->addField('message_title', 'text', array('name' => 'message_title', 'label' => $this->__('Message Title'), 'title' => $this->__('Message Title'), 'required' => true, 'disabled' => !$this->_fieldsEnabled ? true : false, 'note' => $this->__('Maximum length is 255'), 'maxlength' => 255)); $widgetFilters = array('is_email_compatible' => 1); $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('widget_filters' => $widgetFilters)); $this->_dependentFields['content'] = $fieldset->addField('content', 'editor', array('label' => $this->__('Template Content'), 'title' => $this->__('Template Content'), 'name' => 'content', 'style' => 'height:30em;', 'state' => 'html', 'required' => true, 'disabled' => !$this->_fieldsEnabled ? true : false, 'config' => $wysiwygConfig)); $form->setValues($model->getData()); $form->setUseContainer(true); $this->setForm($form); return parent::_prepareForm(); }
public function render(Varien_Object $row) { $fields = array(); try { $fields = unserialize($row->getFields()); } catch (Exception $e) { // } if (empty($fields)) { return ''; } $fieldsHtml = '<dl style="margin-top: 10px">'; foreach ($fields as $field) { $fieldsHtml .= '<dt><strong>' . $field['name'] . '</strong></dt>'; $fieldsHtml .= ' <dd style="padding-left: 15px; padding-bottom: 10px"> <pre>' . htmlspecialchars($field['content']) . '</pre> </dd> '; } $fieldsHtml .= '</dl>'; return ' <a href="#" onclick="javascript:document.getElementById(\'fields-' . $row->getId() . '\').style.display = \'block\';">Show</a> <span style="color:#666">|</span> <a href="#" onclick="javascript:document.getElementById(\'fields-' . $row->getId() . '\').style.display = \'none\';">Hide</a> <div id="fields-' . $row->getId() . '" style="display: none">' . $fieldsHtml . '</div> '; }
public function render(Varien_Object $row) { $url = Mage::helper("adminhtml")->getUrl("quickpaypayment/order/", array("id" => $row->getId())); $image = Mage::helper('quickpaypayment')->getImage($row->getId()); $content = $this->getLayout()->createBlock('core/template')->setTemplate('quickpaypayment/grid/fraudprobability.phtml')->setInfoUrl($url)->setImage($image)->toHtml(); return $content; }
/** * Renders grid column * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { $readDetailsHtml = $row->getUrl() ? '<a target="_blank" href="' . $row->getUrl() . '">' . Mage::helper('Mage_AdminNotification_Helper_Data')->__('Read Details') . '</a> | ' : ''; $markAsReadHtml = !$row->getIsRead() ? '<a href="' . $this->getUrl('*/*/markAsRead/', array('_current' => true, 'id' => $row->getId())) . '">' . Mage::helper('Mage_AdminNotification_Helper_Data')->__('Mark as Read') . '</a> | ' : ''; $encodedUrl = $this->helper('Mage_Core_Helper_Url')->getEncodedUrl(); return sprintf('%s%s<a href="%s" onClick="deleteConfirm(\'%s\', this.href); return false;">%s</a>', $readDetailsHtml, $markAsReadHtml, $this->getUrl('*/*/remove/', array('_current' => true, 'id' => $row->getId(), Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED => $encodedUrl)), Mage::helper('Mage_AdminNotification_Helper_Data')->__('Are you sure?'), Mage::helper('Mage_AdminNotification_Helper_Data')->__('Remove')); }
public function render(Varien_Object $row) { $values = $this->getColumn()->getValues(); $value = $row->getData($this->getColumn()->getIndex()); if ($this->getColumn()->getRadioValue() == '') { $checked = !in_array($row->getId(), $values) ? ' checked="checked"' : ''; } elseif (is_array($values)) { $checked = in_array($row->getId(), $values) ? ' checked="checked"' : ''; } else { $checked = $row->getId() === $this->getColumn()->getValue() ? ' checked="checked"' : ''; } $disabled = ''; if ($this->getColumn()->getDisabled()) { $disabled = ' disabled="disabled"'; } $html = '<label><input type="radio" name="' . $this->getColumn()->getHtmlName() . '[' . $row->getId() . ']" '; $html .= 'value="' . $this->getColumn()->getRadioValue() . '" class="radio"' . $checked . $disabled . ' rawid=' . $row->getId() . ' />'; $options = $this->getColumn()->getOptions(); $optionsScope = $this->getColumn()->getOptionsScope(); if (!empty($options) && is_array($options)) { if (isset($options[$value])) { $html .= $this->escapeHtml($options[$value]); } } $html .= '</label>'; return $html; }
/** * Renders grid column * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { $value = ''; if ($barcodeProducts = Mage::getModel('admin/session')->getData('barcode_product_import')) { foreach ($barcodeProducts as $barcodeProduct) { if ($barcodeProduct['PRODUCT_ID'] == $row->getProductId()) { if (isset($barcodeProduct['BARCODE']) && $barcodeProduct['BARCODE']) { $value = $barcodeProduct['BARCODE']; } } } } $checked = 'checked="checked"'; if ($value) { $checked = ''; } $html = Mage::helper('inventorybarcode')->__('Auto') . ': <input onclick="setBarcodeAuto(this,\'barcode-' . $row->getId() . '\')" type="checkbox" name="barcode_auto" ' . $checked . ' value="">'; $html .= '<input type="text" '; $html .= 'id="barcode-' . $row->getId() . '" '; $html .= 'name="' . $this->getColumn()->getId() . '" '; $html .= 'value="' . $value . '"'; $html .= 'class="input-text' . $this->getColumn()->getInlineCss() . '" readonly />'; // $html .= '<p class="note" id="note_barcode"><span>'.Mage::helper('inventory')->__('Just [A-Z][a-z][0-9] are allowed').'</span></p>'; return $html; }
public function render(Varien_Object $_15ded6f30a13ef74e4a6288cd249a3be115e0ad0) { $_b4b4ae1cce58b916954ba6a30ef73681af8a36c4 = array(); $_b4b4ae1cce58b916954ba6a30ef73681af8a36c4[] = array('@' => array('href' => $this->getUrl('adminhtml/customer/edit', array('id' => $_15ded6f30a13ef74e4a6288cd249a3be115e0ad0->getEntityId())), 'target' => '_blank'), '#' => Mage::helper('sublogin')->__('Edit Customer')); $_b4b4ae1cce58b916954ba6a30ef73681af8a36c4[] = array('@' => array('href' => $this->getUrl('sublogin/adminhtml_index/edit', array('id' => $_15ded6f30a13ef74e4a6288cd249a3be115e0ad0->getId())), 'target' => '_self'), '#' => Mage::helper('sublogin')->__('Edit Sublogin')); $_b4b4ae1cce58b916954ba6a30ef73681af8a36c4[] = array('@' => array('href' => $this->getUrl('sublogin/adminhtml_index/deleteSingleSublogin', array('id' => $_15ded6f30a13ef74e4a6288cd249a3be115e0ad0->getId())), 'target' => '_self'), '#' => Mage::helper('sublogin')->__('Delete Sublogin')); return $this->_actionsToHtml($_b4b4ae1cce58b916954ba6a30ef73681af8a36c4); }
public function render(Varien_Object $row) { $actions = array(); if ($row->getId() > 1) { $actions[] = array('@' => array('href' => $this->getUrl('*/*/edit', array('id' => $row->getId(), 'store' => Mage::registry('store_id')))), '#' => Mage::helper('downloads')->__('Edit')); return $this->_actionsToHtml($actions); } }
/** * Renders grid column * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { if (!$row->getIsRead()) { return sprintf('<a target="_blank" href="%s">%s</a> | <a href="%s">%s</a> | <a href="%s" onClick="deleteConfirm(\'%s\',this.href); return false;">%s</a>', $row->getUrl(), AO::helper('adminnotification')->__('Read Details'), $this->getUrl('*/*/markAsRead/', array('_current' => true, 'id' => $row->getId())), AO::helper('adminnotification')->__('Mark as Read'), $this->getUrl('*/*/remove/', array('_current' => true, 'id' => $row->getId())), AO::helper('adminnotification')->__('Are you sure?'), AO::helper('adminnotification')->__('Remove')); } else { return sprintf('<a target="_blank" href="%s">%s</a> | <a href="%s" onClick="deleteConfirm(\'%s\',this.href); return false;">%s</a>', $row->getUrl(), AO::helper('adminnotification')->__('Read Details'), $this->getUrl('*/*/remove/', array('_current' => true, 'id' => $row->getId())), AO::helper('adminnotification')->__('Are you sure?'), AO::helper('adminnotification')->__('Remove')); } }
public function render(Varien_Object $row) { $helper = Mage::helper('downloads'); $actions = array(); $actions[] = array('@' => array('href' => $this->getUrl('*/*/edit', array('id' => $row->getId(), 'store' => Mage::registry('store_id')))), '#' => $helper->__('Edit')); $actions[] = array('@' => array('href' => $this->getUrl('*/*/download', array('id' => $row->getId(), 'store' => Mage::registry('store_id')))), '#' => $helper->__('Download')); $actions[] = array('@' => array('href' => '#', 'onclick' => "alert('{$helper->getDownloadLink($row)}'); return false;"), '#' => $helper->__('Get Link')); return $this->_actionsToHtml($actions); }
/** * Renders grid column * * @param Varien_Object $row * @return string */ public function render(Varien_Object $_row) { if (ITwebexperts_Payperrentals_Helper_Data::isReservationType($_row->getId())) { $data = intval(ITwebexperts_Payperrentals_Helper_Data::getAttributeCodeForId($_row->getId(), 'payperrentals_quantity')); } else { $data = intval($_row->getQty()); } return $data; }
public function render(Varien_Object $row) { if ($row->isValidForSend()) { $actions[] = array('url' => $this->getUrl('*/newsletter_queue/edit', array('template_id' => $row->getId())), 'caption' => Mage::helper('newsletter')->__('Queue Newsletter...')); } $actions[] = array('url' => $this->getUrl('*/*/preview', array('id' => $row->getId())), 'popup' => true, 'caption' => Mage::helper('newsletter')->__('Preview')); $this->getColumn()->setActions($actions); return parent::render($row); }
public function render(Varien_Object $row) { if ($row->isValidForSend()) { $actions[] = array('url' => $this->getUrl('*/admin_queue/edit', array('campaign_id' => $row->getId())), 'caption' => Mage::helper('mzax_emarketing')->__('Queue Campaign...')); } $actions[] = array('url' => $this->getUrl('*/*/preview', array('campaign' => $row->getId())), 'popup' => true, 'caption' => Mage::helper('mzax_emarketing')->__('Preview')); $this->getColumn()->setActions($actions); return parent::render($row); }
public function deletePageDrafts(Varien_Object $page) { if ($page->getId()) { $adapter = $this->_getWriteAdapter(); $where = array('is_draft = ?' => 1, 'page_id = ?' => $page->getId()); return $adapter->delete($this->getMainTable(), $where); } return true; }
/** * Override for immediate action on a recommendation * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { $actions = array(); $actions[] = array('url' => $this->getUrl('*/*/edit', array('id' => $row->getId())), 'caption' => $this->__('Edit')); $actions[] = array('url' => $this->getUrl('*/*/copy', array('id' => $row->getId())), 'caption' => $this->__('Copy'), 'confirm' => $this->__('Are you sure you want to copy the selected recommendation?')); $actions[] = array('url' => $this->getUrl('*/*/delete', array('id' => $row->getId())), 'caption' => $this->__('Delete'), 'confirm' => $this->__('Are you sure you want to delete the selected recommendation?')); $actions[] = array('url' => $this->getUrl('*/*/preview', array('entity_id' => $row->getId(), 'ret' => 'index')), 'caption' => $this->__('Preview')); $this->getColumn()->setActions($actions); return parent::render($row); }
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')); } }
public function render(Varien_Object $row) { $customer_id = $row->getId(); $customer = Mage::getModel('customer/customer')->load($customer_id); $emailAdrress = $customer->getData('email'); if ($customer) { return sprintf('<a target="_blank" href="%s">%s</a>', $this->getUrl('adminhtml/customer/edit', array('id' => $customer->getId())), $emailAdrress); } return $row->getId(); }
/** * Override for immediate action on a delivery * * @param Varien_Object $row * @return string */ public function render(Varien_Object $row) { $actions = array(); if ($row->isCancelable()) { $actions[] = array('url' => $this->getUrl('*/postpurchase/cancel', array('id' => $row->getId())), 'caption' => $this->__('Cancel'), 'confirm' => $this->__('Are you sure you want to cancel the %s for order #%s?', $row->getPostName(), $row->getOrderIncrementId())); } $actions[] = array('url' => $this->getUrl('*/postpurchase/delete', array('id' => $row->getId())), 'caption' => $this->__('Purge'), 'confirm' => $this->__('Are you sure you want to purge the %s for order #%s?', $row->getPostName(), $row->getOrderIncrementId())); $this->getColumn()->setActions($actions); return parent::render($row); }
/** * Renders grid column * * @param Varien_Object $row * @return string */ public function render(Varien_Object $_row) { if (ITwebexperts_Payperrentals_Helper_Data::isReservationType($_row->getId())) { $dates = Mage::helper('payperrentals/timebox')->getProductGridDates(); $data = intval(ITwebexperts_Payperrentals_Helper_Inventory::getQuantity($_row->getId(), $dates['start_date'], $dates['end_date'])); } else { $data = 0; } return $data; }
/** * Retrive gift message save url * * @param Varien_Object $item * @param string $type * @param array $params * @return string */ public function getEditUrl(Varien_Object $item, $type, $params = array()) { if ($item->getGiftMessageId()) { $params = array_merge($params, array('message' => $item->getGiftMessageId(), 'item' => $item->getId(), 'type' => $type)); return $this->_getUrl('giftmessage/index/edit', $params); } else { $params = array_merge($params, array('item' => $item->getId(), 'type' => $type)); return $this->_getUrl('giftmessage/index/new', $params); } }
public function render(Varien_Object $row) { $time = ''; $count = 0; $totalTime = 0; $now = time(); // or your date as well $block = new Magestore_Inventoryreports_Block_Adminhtml_Supplier_Product_Grid(); $filter = $block->getParam($block->getVarNameFilter(), null); $condorder = ''; if ($filter) { $data = $this->helper('adminhtml')->prepareFilterString($filter); foreach ($data as $value => $key) { if ($value == 'supplier_id') { $condorder = $key; } } } if (Mage::helper('core')->isModuleEnabled('Magestore_Inventorybarcode')) { $resource = Mage::getSingleton('core/resource'); $readConnection = $resource->getConnection('core_read'); $results = ''; $purchaseOrderIds = array(); // if($condorder){ // $sql = 'SELECT distinct(`warehouse_warehouse_id`) FROM '.$resource->getTableName('inventorybarcode/barcode').' where (`product_entity_id` = '.$row->getId(). // ') and (`supplier_supplier_id` = '. $condorder .') and (`qty` > '. 0 .')'; // }else{ $sql = 'SELECT `warehouse_warehouse_id` FROM ' . $resource->getTableName('inventorybarcode/barcode') . ' where (`product_entity_id` = ' . $row->getId() . ') and (`qty` > ' . 0 . ')'; // } $results = $readConnection->query($sql); $warehouseIds = array(); if ($results) { foreach ($results as $result) { $warehouseId = $result['warehouse_warehouse_id']; $warehouseId = explode(',', $warehouseId); foreach ($warehouseId as $wId) { if (!in_array($wId, $warehouseIds)) { $warehouseIds[] = $wId; } } } } $warehouses = Mage::getModel('inventoryplus/warehouse')->getCollection()->addFieldToFilter('warehouse_id', array('in' => $warehouseIds)); $count += $warehouses->getSize(); if ($count == 0) { return $this->__('N/A'); } $resultWarehouse = ''; foreach ($warehouses as $warehouse) { //$resultWarehouse .= $warehouse->getWarehouseName().'<br />'; $resultWarehouse .= "<a href=\"#\" onclick=\"showWarehouseInventory(" . $warehouse->getId() . "," . $row->getId() . ");return false;\" title=\"" . Mage::helper('inventoryreports')->__('Report Time Inventory by Warehouse') . "\">" . $warehouse->getWarehouseName() . "<a/>" . "<br/>"; } return $resultWarehouse; } }
/** * 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 = ''; $permission = Mage::helper('inventoryplus')->getPermission($row->getWarehouseId(), 'can_physical'); if ($row->getPhysicalStatus() == 0 && $permission) { $html = '<a href="' . $this->getUrl('inventoryphysicalstocktakingadmin/adminhtml_physicalstocktaking/edit', array('id' => $row->getId())) . '">' . Mage::helper('inventoryphysicalstocktaking')->__('Edit') . '</a>'; } else { $html = '<a href="' . $this->getUrl('inventoryphysicalstocktakingadmin/adminhtml_physicalstocktaking/edit', array('id' => $row->getId())) . '">' . Mage::helper('inventoryphysicalstocktaking')->__('View') . '</a>'; } return $html; }