本文整理汇总了PHP中Varien_Object::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Object::getId方法的具体用法?PHP Varien_Object::getId怎么用?PHP Varien_Object::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Object
的用法示例。
在下文中一共展示了Varien_Object::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
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);
}
示例2: render
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");
}
}
示例3: render
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;
}
示例4: getChilds
/**
* 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;
}
}
示例5: render
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;
}
示例6: render
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;
}
示例7: render
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");
}
}
示例8: _prepareForm
/**
* 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();
}
示例9: render
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>
';
}
示例10: render
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;
}
示例11: render
/**
* 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'));
}
示例12: render
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;
}
示例13: render
/**
* 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;
}
示例14: render
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);
}
示例15: render
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);
}
}