// bugfix admin products, adminattributesgroups, admincategories

// helper list and form improved
This commit is contained in:
mMarinetti
2011-11-03 17:04:33 +00:00
parent 2d3ce82382
commit 1927cbfaa3
24 changed files with 636 additions and 1263 deletions
@@ -140,15 +140,13 @@ class AdminAttributesGroupsControllerCore extends AdminController
$helper->token = $this->token;
$helper->table = $this->table;
$helper->simple_header = true;
$helper->show_toolbar = false;
$helper->bulk_actions = $this->bulk_actions;
if (file_exists($this->context->smarty->template_dir[0].'/'.$this->tpl_folder.'list_content.tpl'))
$helper->content_tpl = $this->tpl_folder.'list_content.tpl';
$content = $helper->generateList($this->_list, $this->fieldsDisplay);
echo Tools::jsonEncode(array('use_parent_structure' => false, 'data' => $content));
$this->content = Tools::jsonEncode(array('use_parent_structure' => false, 'data' => $content));
}
die;
}
/**
@@ -356,13 +354,13 @@ class AdminAttributesGroupsControllerCore extends AdminController
$str_attributes_groups .= '"'.$attribute_group['id_attribute_group'].'" : '.($attribute_group['group_type'] == 'color' ? '1' : '0' ) .', ';
$image = _PS_IMG_DIR_.$this->fieldImageSettings['dir'].'/'.$obj->id.'.jpg';
$this->context->smarty->assign(array(
$this->tpl_form_vars = array(
'strAttributesGroups' => $str_attributes_groups,
'colorAttributeProperties' => Validate::isLoadedObject($obj) && $obj->isColorAttribute(),
'imageTextureExists' => file_exists($image),
'imageTexture' => $image,
'imageTextureUrl' => Tools::safeOutput($_SERVER['REQUEST_URI']).'&deleteImage=1'
));
);
return parent::initForm();
}
@@ -542,4 +540,4 @@ class AdminAttributesGroupsControllerCore extends AdminController
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
}
}
}
@@ -98,7 +98,7 @@ class AdminCategoriesControllerCore extends AdminController
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->_filter .= 'AND `id_parent` = '.(int)$this->_category->id.' ';
$this->_filter .= ' AND `id_parent` = '.(int)$this->_category->id.' ';
$this->_select = 'position ';
$categories_tree = $this->_category->getParentsCategories($this->context->language->id);
@@ -129,21 +129,28 @@ class AdminCategoriesControllerCore extends AdminController
public function initToolbar()
{
$this->toolbar_title = stripslashes($this->_category->getName());
if (empty($this->display))
$this->toolbar_btn['new'] = array(
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
'desc' => $this->l('Add new')
);
if (Tools::getValue('id_category'))
$this->toolbar_btn['edit'] = array(
'href' => self::$currentIndex.'&update'.$this->table.'&id_category='.Tools::getValue('id_category').'&token='.$this->token,
'desc' => $this->l('Edit')
);
if ($this->display == 'view')
$this->toolbar_btn['new'] = array(
'href' => self::$currentIndex.'&add'.$this->table.'&id_parent='.Tools::getValue('id_category').'&token='.$this->token,
'desc' => $this->l('Add new')
);
parent::initToolbar();
}
public function initForm()
{
$this->initToolbar();
$obj = $this->loadObject(true);
$selected_cat = array(isset($obj->id_parent) ? $obj->id_parent : Tools::getValue('id_parent', 1));
if (sizeof($selected_cat) > 0)
@@ -207,7 +214,8 @@ class AdminCategoriesControllerCore extends AdminController
'selected_cat' => $selected_cat,
'input_name' => 'id_parent',
'use_radio' => true,
'use_search' => false
'use_search' => false,
'disabled_categories' => array(4),
)
),
array(
@@ -85,14 +85,10 @@ class AdminManufacturersControllerCore extends AdminController
parent::__construct();
}
public function setHelperListDisplay(Helper $helper)
{
$helper->toolbar = false;
parent::setHelperListDisplay($helper);
}
public function initList()
public function initListManufacturer()
{
$this->toolbar_title = $this->l('List of manufacturers:');
$this->addRowAction('view');
$this->addRowAction('edit');
$this->addRowAction('delete');
@@ -110,8 +106,14 @@ class AdminManufacturersControllerCore extends AdminController
$this->context->smarty->assign('title_list', $this->l('List of manufacturers:'));
$this->initToolbar();
$list_manufacturers = parent::initList();
$this->content .= parent::initList();
}
public function initListManufacturerAddresses()
{
$this->toolbar_title = $this->l('Manufacturers addresses:');
// reset actions and query vars
$this->actions = array();
unset($this->fieldsDisplay, $this->_select, $this->_join, $this->_group, $this->_filterHaving, $this->_filter);
@@ -191,14 +193,17 @@ class AdminManufacturersControllerCore extends AdminController
$this->postProcess();
$this->initToolbar();
$list_addresses = parent::initList();
$this->content .= parent::initList();
$this->context->smarty->assign(array(
'list_manufacturers' => $list_manufacturers,
'list_addresses' => $list_addresses
));
}
public function initList()
{
$this->initListManufacturer();
$this->initListManufacturerAddresses();
}
/**
* Display editaddresses action link
* @param string $token the token to add to the link
@@ -217,7 +222,7 @@ class AdminManufacturersControllerCore extends AdminController
'action' => self::$cache_lang['editaddresses'],
));
return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/manufacturers/list_action_edit_adresses.tpl');
return $this->context->smarty->fetch('manufacturers/list_action_edit_adresses.tpl');
}
public function initForm()
@@ -526,7 +531,7 @@ class AdminManufacturersControllerCore extends AdminController
$helper->allow_employee_form_lang = $this->allow_employee_form_lang;
$helper->fields_value = $this->getFieldsValue($address);
$helper->toolbar_btn = $this->toolbar_btn;
$helper->tpl = 'manufacturers/form_addresses.tpl';
// $helper->tpl = 'manufacturers/form_addresses.tpl';
$this->content .= $helper->generateForm($this->fields_form);
}
@@ -587,7 +587,6 @@ class AdminProductsController extends AdminController
Tools::getValue('attribute_weight') * Tools::getValue('attribute_weight_impact'),
Tools::getValue('attribute_unity') * Tools::getValue('attribute_unit_impact'),
Tools::getValue('attribute_ecotax'),
Tools::getValue('attribute_quantity'),
Tools::getValue('id_image_attr'),
Tools::getValue('attribute_reference'),
Tools::getValue('attribute_supplier_reference'),
@@ -3315,7 +3314,14 @@ $product->supplier_name = Supplier::getNameById($product->id_supplier);
return Tools::jsonEncode(array('error' => 'Undefined value'));
if (Tools::getValue('id_product_attribute') === false)
return Tools::jsonEncode(array('error' => 'Undefined id product attribute'));
// @todo : Product class should handle that
$stock_available = new StockAvailable(StockAvailable::getIdStockAvailable($product->id, (int)Tools::getValue('id_product_attribute')));
if (!$stock_available->id)
{
$stock_available->id_product = $product->id;
$stock_available->id_shop = Context::getContext()->shop->getID(true);
$stock_available->id_product_attribute = Tools::getValue('id_product_attribute');
}
$stock_available->quantity = (int)Tools::getValue('value');
$stock_available->save();
break;
+240 -72
View File
@@ -31,15 +31,43 @@ class AdminTrackingController extends AdminController
{
parent::__construct();
}
public function display()
public function postprocess()
{
$tpl_vars['categories'] = $this->getObjects('categories_empty')->displayCategories();
$tpl_vars['products_disabled'] = $this->getObjects('products_disabled')->displayProducts();
$tpl_vars['products_nostock'] = $this->getObjects('products_nostock')->displayProducts();
$tpl_vars['attributes_nostock'] = $this->getObjects('attributes_nostock')->displayAttributes();
if (Tools::getValue('id_product') && Tools::isSubmit('statusproduct'))
{
$this->table = 'product';
$this->identifier = 'id_product';
$this->action = 'status';
$this->className = 'Product';
}
else
if (Tools::getValue('id_category') && Tools::isSubmit('statuscategory'))
{
$this->table = 'category';
$this->identifier = 'id_category';
$this->action = 'status';
$this->className = 'Category';
}
parent::postprocess();
}
public function initContent()
{
//$tpl_vars['categories'] = $this->getObjects('categories_empty')->displayCategories();
$methods = get_class_methods($this);
$tpl_vars['arrayList'] = array();
foreach ($methods as $method_name)
if (preg_match('#getCustomList(.+)#', $method_name, $matches))
$tpl_vars['arrayList'][Tools::toUnderscoreCase($matches[1])] = call_user_func(array($this,$matches[0]));
// $tpl_vars['categories'] = $this->getMonitorCategoriesEmpty();
// $tpl_vars['products_disabled'] = $this->getObjects('products_disabled')->displayProducts();
// $tpl_vars['products_nostock'] = $this->getObjects('products_nostock')->displayProducts();
// attributes no stock is custom
// $tpl_vars['arrayList']['attributes_nostock'] = $this->getObjects('attributes_nostock')->displayAttributes();
$this->context->smarty->assign($tpl_vars);
parent::display();
$this->display = 'view';
parent::initContent();
}
public function getObjects($type)
@@ -55,7 +83,7 @@ class AdminTrackingController extends AdminController
FROM `'._DB_PREFIX_.'category_product`
)
';
$this->_list['message'] = $this->l('List of empty categories:');
// $this->_list['message'] = $this->l('List of empty categories:');
break ;
case 'products_disabled':
$sql = '
@@ -103,33 +131,70 @@ class AdminTrackingController extends AdminController
return $this;
}
public function getCustomListCategoriesEmpty()
{
$this->clearListOptions();
$this->table = 'category';
$this->lang = true;
$this->identifier = 'id_category';
$this->_defaultOrderBy = 'id_category';
$this->_defaultOrderWay = 'DESC';
$this->addRowAction('edit');
$this->addRowAction('delete');
$this->addRowAction('view');
$this->_filter = ' AND
a.id_category NOT IN (
SELECT DISTINCT(cp.id_category)
FROM `'._DB_PREFIX_.'category_product` cp)';
$this->fieldsDisplay = (array(
'id_category' => array('title' => $this->l('ID')),
'name' => array('title' => $this->l('Name')),
'description' => array('title' => $this->l('Description')),
'active' => array('title' => $this->l('Status'), 'type' => 'bool', 'active' => 'status'),
'action' => array('title' => $this->l('Actions'))
));
$this->getObjects('categories_empty');
$this->list_simple_header = 0;
$this->show_toolbar = 0;
$this->list_title = $this->l('List of empty categories:');
$list = $this->initList();
$this->_filter = '';
return $list;
}
public function displayCategories()
{
$content = '';
if (isset($this->_list['obj']))
{
$nbCategories = sizeof($this->_list['obj']);
$this->content .= '<h3>'.$this->_list['message'].' '.$nbCategories.' '.$this->l('found').'</h3>';
$content .= '<h3>'.$this->_list['message'].' '.$nbCategories.' '.$this->l('found').'</h3>';
if (!$nbCategories)
return ;
$this->content .= '
return $content;
$content .= '
<table cellspacing="0" cellpadding="0" class="table">';
$irow = 0;
foreach ($this->_list['obj'] AS $k => $category)
$this->content .= '<tr class="'.($irow++ % 2 ? 'alt_row' : '').'"><td>'.rtrim(getPath('index.php?tab=AdminCatalog', $category['id_category']), ' >').'</td></tr>';
$this->content .= '</table><br /><br />';
$content .= '<tr class="'.($irow++ % 2 ? 'alt_row' : '').'"><td>'.rtrim(getPath('index.php?controller=AdminCategory', $category['id_category']), ' >').'</td></tr>';
$content .= '</table><br /><br />';
}
return $content;
}
public function displayProducts()
public function getCustomListProductsAttributesNoStock()
{
if (isset($this->_list['obj']))
{
$nbProducts = sizeof($this->_list['obj']);
$this->content .= '<h3>'.$this->_list['message'].' '.$nbProducts.' '.$this->l('found').'</h3>';
if (!$nbProducts)
return ;
$this->fieldsDisplay = (array(
{
$this->clearListOptions();
$this->table = 'product';
$this->lang = true;
$this->identifier = 'id_product';
$this->_defaultOrderBy = 'id_product';
$this->_defaultOrderWay = 'DESC';
$this->fieldsDisplay = array(
'ID' => array('title' => $this->l('ID')),
'manufacturer' => array('title' => $this->l('Manufacturer')),
'reference' => array('title' => $this->l('Reference')),
@@ -138,55 +203,40 @@ class AdminTrackingController extends AdminController
'tax' => array('title' => $this->l('Tax')),
'stock' => array('title' => $this->l('Stock')),
'weight' => array('title' => $this->l('Weight')),
'status' => array('title' => $this->l('Status')),
'action' => array('title' => $this->l('Actions'))
'active' => array('title' => $this->l('Status'), 'type' => 'bool', 'active' => 'status'),
'action' => array('title' => $this->l('Actions')
));
$this->content .= '
<table class="table" cellpadding="0" cellspacing="0">
<tr>';
foreach ($this->fieldsDisplay AS $field)
$this->content .= '<th'.(isset($field['width']) ? 'style="width: '.$field['width'].'"' : '').'>'.$field['title'].'</th>';
$this->content .= '
</tr>';
foreach ($this->_list['obj'] AS $k => $prod)
{
$product = new Product((int)$prod['id_product'], false);
$product->name = $product->name[(int)$this->context->language->id];
$taxrate = $product->getTaxesRate();
$this->_join = '';
$this->_filter = 'AND a.id_product IN (
SELECT id_product
FROM `'._DB_PREFIX_.'product`
WHERE id_product IN (
SELECT DISTINCT(id_product)
FROM `'._DB_PREFIX_.'product_attribute`
)
AND quantity <= 0)';
$this->list_title = $this->l('Product out of stock with attributes');
$this->list_simple_header = 1;
$this->content .= '
<tr>
<td>'.$product->id.'</td>
<td align="center">'.($product->manufacturer_name != NULL ? stripslashes($product->manufacturer_name) : '--').'</td>
<td>'.$product->reference.'</td>
<td><a href="index.php?tab=AdminCatalog&id_product='.$product->id.'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id).'">'.stripslashes($product->name).'</a></td>
<td>'.Tools::displayPrice($product->getPrice(), $this->context->currency).'</td>
<td>'.(float)$taxrate.'% </td>
<td align="center">'.$product->quantity.'</td>
<td align="center">'.$product->weight.' '.Configuration::get('PS_WEIGHT_UNIT').'</td>
<td align="center"><a href="index.php?tab=AdminCatalog&id_product='.$product->id.'&status&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id).'"><img src="../img/admin/'.($product->active ? 'enabled.gif' : 'disabled.gif').'" alt="" /></a></td>
<td>
<a href="index.php?tab=AdminCatalog&id_product='.$product->id.'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id).'">
<img src="../img/admin/edit.gif" alt="'.$this->l('Modify this product').'" /></a>&nbsp;
<a href="index.php?tab=AdminCatalog&id_product='.$product->id.'&deleteproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id).'" onclick="return confirm(\''.addslashes($this->l('Do you want to delete').' '.str_replace('"', ' ', $product->name)).' ?\');">
<img src="../img/admin/delete.gif" alt="'.$this->l('Delete this product').'" /></a>
</td>
</tr>';
}
$this->content .= '</table><br /><br />';
}
$list = $this->initList();
$this->_filter = '';
return $list;
}
public function displayAttributes()
{
$this->clearListOptions();
$content = '';
$this->table = 'attribute';
$this->lang = true;
$this->identifier = 'id_attribute';
$this->_defaultOrderBy = 'id_attribute';
$this->_defaultOrderWay = 'DESC';
if (isset($this->_list['obj']))
{
$nbAttributes = sizeof($this->_list['obj']);
$this->content .= '<h3>'.$this->_list['message'].' '.$nbAttributes.' '.$this->l('found').'</h3>';
$content .= '<h3>'.$this->_list['message'].' '.$nbAttributes.' '.$this->l('found').'</h3>';
if (!$nbAttributes)
return ;
$this->fieldsDisplay = (array(
return $content;
$this->fieldsDisplay = array(
'ID' => array('title' => $this->l('ID')),
'manufacturer' => array('title' => $this->l('Manufacturer')),
'reference' => array('title' => $this->l('Reference')),
@@ -197,14 +247,14 @@ class AdminTrackingController extends AdminController
'weight' => array('title' => $this->l('Weight')),
'status' => array('title' => $this->l('Status')),
'action' => array('title' => $this->l('Actions'))
));
);
$this->content .= '
$content .= '
<table class="table" cellpadding="0" cellspacing="0">
<tr>';
foreach ($this->fieldsDisplay AS $field)
$this->content .= '<th'.(isset($field['width']) ? 'style="width: '.$field['width'].'"' : '').'>'.$field['title'].'</th>';
$this->content .= '
$content .= '<th'.(isset($field['width']) ? 'style="width: '.$field['width'].'"' : '').'>'.$field['title'].'</th>';
$content .= '
</tr>';
$attributes = array();
@@ -226,27 +276,145 @@ class AdminTrackingController extends AdminController
$product = new Product((int)$prod['id_product'], false);
$tax_rate = $product->getTaxesRate();
$this->content .= '
$content .= '
<tr>
<td>'.$prod['id_product'].'</td>
<td align="center">'.($prod['manufacturer_name'] != NULL ? stripslashes($prod['manufacturer_name']) : '--').'</td>
<td>'.$prod['reference'].'</td>
<td><a href="index.php?tab=AdminCatalog&id_product='.$prod['id_product'].'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id).'">'.stripslashes($prod['name']).' ('.$prod['combination_name'].')'.'</a></td>
<td><a href="'.$this->context->link->getAdminLink('AdminProducts').'&amp;id_product='.$prod['id_product'].'&addproduct">'.stripslashes($prod['name']).' ('.$prod['combination_name'].')'.'</a></td>
<td>'.Tools::displayPrice(Product::getPriceStatic((int)($prod['id_product']), true, $prod['id_product_attribute']), $this->context->currency).'</td>
<td>'.(float)$tax_rate.'% </td>
<td align="center">'.$prod['quantity'].'</td>
<td align="center">'.($prod['weight'] + $prod['product_weight']).' '.Configuration::get('PS_WEIGHT_UNIT').'</td>
<td align="center"><a href="index.php?tab=AdminCatalog&id_product='.$prod['id_product'].'&status&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id).'"><img src="../img/admin/'.($prod['active'] ? 'enabled.gif' : 'disabled.gif').'" alt="" /></a></td>
<td align="center"><a href="'.$this->context->link->getAdminLink('AdminProducts').'&amp;id_product='.$prod['id_product'].'&amp;status"><img src="../img/admin/'.($prod['active'] ? 'enabled.gif' : 'disabled.gif').'" alt="" /></a></td>
<td>
<a href="index.php?tab=AdminCatalog&id_product='.$prod['id_product'].'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id).'">
<a href="'.$this->context->link->getAdminLink('AdminProducts').'&amp;id_product='.$prod['id_product'].'&amp;addproduct">
<img src="../img/admin/edit.gif" alt="'.$this->l('Modify this product').'" /></a>&nbsp;
<a href="index.php?tab=AdminCatalog&id_product='.$prod['id_product'].'&deleteproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id).'" onclick="return confirm(\''.addslashes($this->l('Do you want to delete').' '.$prod['name']).' ?\');">
<a href="'.$this->context->link->getAdminLink('AdminProducts').'&amp;id_product='.$prod['id_product'].'" onclick="return confirm(\''.addslashes($this->l('Do you want to delete').' '.$prod['name']).' ?\');">
<img src="../img/admin/delete.gif" alt="'.$this->l('Delete this product').'" /></a>
</td>
</tr>';
}
$this->content .= '</table><br /><br />';
$content .= '</table><br /><br />';
}
return $content;
}
public function getCustomListProductsNoStock()
{
$this->clearListOptions();
$this->table = 'product';
$this->lang = true;
$this->identifier = 'id_product';
$this->_defaultOrderBy = 'id_product';
$this->_defaultOrderWay = 'DESC';
$this->fieldsDisplay = array(
'ID' => array('title' => $this->l('ID')),
'manufacturer' => array('title' => $this->l('Manufacturer')),
'reference' => array('title' => $this->l('Reference')),
'name' => array('title' => $this->l('Name')),
'price' => array('title' => $this->l('Price')),
'tax' => array('title' => $this->l('Tax')),
'stock' => array('title' => $this->l('Stock')),
'weight' => array('title' => $this->l('Weight')),
'active' => array('title' => $this->l('Status'), 'type' => 'bool', 'active' => 'status'),
'action' => array('title' => $this->l('Actions')
));
$this->_join = '';
$this->_filter = 'AND a.id_product IN (
SELECT id_product
FROM `'._DB_PREFIX_.'product`
WHERE id_product NOT IN (
SELECT DISTINCT(id_product)
FROM `'._DB_PREFIX_.'product_attribute`
)
AND quantity <= 0)';
$this->list_title = $this->l('Product out of stock');
$this->list_simple_header = 1;
$list = $this->initList();
$this->_filter = '';
return $list;
}
public function getCustomListProductsDisabled()
{
$this->clearListOptions();
$content = '';
$this->table = 'product';
$this->lang = true;
$this->identifier = 'id_product';
$this->_defaultOrderBy = 'id_product';
$this->_defaultOrderWay = 'DESC';
$this->_filter = 'AND active = 0';
$this->list_no_filter = true;
$this->list_title = $this->l('Product disabled');
$list = $this->initList();
$this->_filter = '';
return $list;
if (isset($this->_list['obj']))
{
$nbProducts = sizeof($this->_list['obj']);
$content .= '<h3>'.$this->_list['message'].' '.$nbProducts.' '.$this->l('found').'</h3>';
if (!$nbProducts)
return ;
$this->fieldsDisplay = (array(
'ID' => array('title' => $this->l('ID')),
'manufacturer' => array('title' => $this->l('Manufacturer')),
'reference' => array('title' => $this->l('Reference')),
'name' => array('title' => $this->l('Name')),
'price' => array('title' => $this->l('Price')),
'tax' => array('title' => $this->l('Tax')),
'stock' => array('title' => $this->l('Stock')),
'weight' => array('title' => $this->l('Weight')),
'status' => array('title' => $this->l('Status')),
'action' => array('title' => $this->l('Actions'))
));
$content .= '
<table class="table" cellpadding="0" cellspacing="0">
<tr>';
foreach ($this->fieldsDisplay AS $field)
$content .= '<th'.(isset($field['width']) ? 'style="width: '.$field['width'].'"' : '').'>'.$field['title'].'</th>';
$content .= '
</tr>';
foreach ($this->_list['obj'] AS $k => $prod)
{
$product = new Product((int)$prod['id_product'], false);
$product->name = $product->name[(int)$this->context->language->id];
$taxrate = $product->getTaxesRate();
$content .= '
<tr>
<td>'.$product->id.'</td>
<td align="center">'.($product->manufacturer_name != NULL ? stripslashes($product->manufacturer_name) : '--').'</td>
<td>'.$product->reference.'</td>
<td><a href="'.$this->context->link->getAdminLink('AdminProducts').'&amp;id_product='.$product->id.'&addproduct">'.stripslashes($product->name).'</a></td>
<td>'.Tools::displayPrice($product->getPrice(), $this->context->currency).'</td>
<td>'.(float)$taxrate.'% </td>
<td align="center">'.$product->quantity.'</td>
<td align="center">'.$product->weight.' '.Configuration::get('PS_WEIGHT_UNIT').'</td>
<td align="center"><a href="'.$this->context->link->getAdminLink('AdminProducts').'&amp;id_product='.$product->id.'&amp;status"><img src="../img/admin/'.($product->active ? 'enabled.gif' : 'disabled.gif').'" alt="" /></a></td>
<td>
<a href="'.$this->context->link->getAdminLink('AdminProducts').'&amp;id_product='.$product->id.'&addproduct">
<img src="../img/admin/edit.gif" alt="'.$this->l('Modify this product').'" /></a>&nbsp;
<a href="'.$this->context->link->getAdminLink('AdminProducts').'&amp;id_product='.$product->id.'&deleteproduct" onclick="return confirm(\''.addslashes($this->l('Do you want to delete').' '.str_replace('"', ' ', $product->name)).' ?\');">
<img src="../img/admin/delete.gif" alt="'.$this->l('Delete this product').'" /></a>
</td>
</tr>';
}
$content .= '</table><br /><br />';
}
return $content;
}
public function clearListOptions(){
$this->table = '';
$this->lang = false;
$this->identifier = '';
$this->_defaultOrderBy = '';
$this->_defaultOrderWay = '';
$this->_filter = '';
$this->list_no_filter = true;
$this->list_title = $this->l('Product disabled');
}
}