// fix links in main menu,

// + moved tab AdminTracking.php to AdminTrackingController.php


git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8894 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mMarinetti
2011-09-29 16:13:34 +00:00
parent df9948c445
commit 940d412a0c
4 changed files with 31 additions and 31 deletions
+1 -1
View File
@@ -195,7 +195,7 @@
{/if}
{foreach $tabs AS $t}
<li class="submenu_size {if $t.current}active{/if}" id="maintab{$t.id_tab}">
<a href="index.php?controller={$t.class_name}&token={$t.token}">
<a href="{$t.href}">
<img src="{$t.img}" alt="" /> {$t.name}
</a>
</li>
+5
View File
@@ -0,0 +1,5 @@
<h2 class="space">{l s='Catalog tracking'}</h2>
{$categories}
{$products_disabled}
{$products_nostock}
{$attributes_nostock}
+1 -1
View File
@@ -681,7 +681,7 @@ class AdminControllerCore extends Controller
// tab[class_name] does not contains the "Controller" suffix
$tabs[$index]['current'] = ($tab['class_name'].'Controller' == get_class($this)) || (Tab::getCurrentParentId() == $tab['id_tab']);
$tabs[$index]['img'] = $img;
$tabs[$index]['token'] = Tools::getAdminToken($tab['class_name'].(int)($tab['id_tab']).(int)$this->context->employee->id);
$tabs[$index]['href'] = $this->context->link->getAdminLink($tab['class_name']);
$sub_tabs = Tab::getTabs($this->context->language->id, $tab['id_tab']);
foreach ($sub_tabs AS $index2 => $sub_tab)
@@ -25,27 +25,21 @@
* International Registered Trademark & Property of PrestaShop SA
*/
class AdminTracking extends AdminTab
class AdminTrackingController extends AdminController
{
public function __construct()
{
$this->table = 'none';
$this->className = 'none';
parent::__construct();
}
public function display()
{
echo '<h2 class="space">'.$this->l('Catalog tracking').'</h2>';
$this->getObjects('categories_empty');
$this->displayCategories();
$this->getObjects('products_disabled');
$this->displayProducts();
$this->getObjects('products_nostock');
$this->displayProducts();
$this->getObjects('attributes_nostock');
$this->displayAttributes();
$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();
$this->context->smarty->assign($tpl_vars);
parent::display();
}
public function getObjects($type)
@@ -106,6 +100,7 @@ class AdminTracking extends AdminTab
break ;
}
$this->_list['obj'] = Db::getInstance()->ExecuteS($sql);
return $this;
}
public function displayCategories()
@@ -113,15 +108,15 @@ class AdminTracking extends AdminTab
if (isset($this->_list['obj']))
{
$nbCategories = sizeof($this->_list['obj']);
echo '<h3>'.$this->_list['message'].' '.$nbCategories.' '.$this->l('found').'</h3>';
$this->content .= '<h3>'.$this->_list['message'].' '.$nbCategories.' '.$this->l('found').'</h3>';
if (!$nbCategories)
return ;
echo '
$this->content .= '
<table cellspacing="0" cellpadding="0" class="table">';
$irow = 0;
foreach ($this->_list['obj'] AS $k => $category)
echo '<tr class="'.($irow++ % 2 ? 'alt_row' : '').'"><td>'.rtrim(getPath('index.php?tab=AdminCatalog', $category['id_category']), ' >').'</td></tr>';
echo '</table><br /><br />';
$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 />';
}
}
@@ -131,7 +126,7 @@ class AdminTracking extends AdminTab
if (isset($this->_list['obj']))
{
$nbProducts = sizeof($this->_list['obj']);
echo '<h3>'.$this->_list['message'].' '.$nbProducts.' '.$this->l('found').'</h3>';
$this->content .= '<h3>'.$this->_list['message'].' '.$nbProducts.' '.$this->l('found').'</h3>';
if (!$nbProducts)
return ;
$this->fieldsDisplay = (array(
@@ -146,12 +141,12 @@ class AdminTracking extends AdminTab
'status' => array('title' => $this->l('Status')),
'action' => array('title' => $this->l('Actions'))
));
echo '
$this->content .= '
<table class="table" cellpadding="0" cellspacing="0">
<tr>';
foreach ($this->fieldsDisplay AS $field)
echo '<th'.(isset($field['width']) ? 'style="width: '.$field['width'].'"' : '').'>'.$field['title'].'</th>';
echo '
$this->content .= '<th'.(isset($field['width']) ? 'style="width: '.$field['width'].'"' : '').'>'.$field['title'].'</th>';
$this->content .= '
</tr>';
foreach ($this->_list['obj'] AS $k => $prod)
{
@@ -159,7 +154,7 @@ class AdminTracking extends AdminTab
$product->name = $product->name[(int)$this->context->language->id];
$taxrate = $product->getTaxesRate();
echo '
$this->content .= '
<tr>
<td>'.$product->id.'</td>
<td align="center">'.($product->manufacturer_name != NULL ? stripslashes($product->manufacturer_name) : '--').'</td>
@@ -178,7 +173,7 @@ class AdminTracking extends AdminTab
</td>
</tr>';
}
echo '</table><br /><br />';
$this->content .= '</table><br /><br />';
}
}
@@ -188,7 +183,7 @@ class AdminTracking extends AdminTab
if (isset($this->_list['obj']))
{
$nbAttributes = sizeof($this->_list['obj']);
echo '<h3>'.$this->_list['message'].' '.$nbAttributes.' '.$this->l('found').'</h3>';
$this->content .= '<h3>'.$this->_list['message'].' '.$nbAttributes.' '.$this->l('found').'</h3>';
if (!$nbAttributes)
return ;
$this->fieldsDisplay = (array(
@@ -204,12 +199,12 @@ class AdminTracking extends AdminTab
'action' => array('title' => $this->l('Actions'))
));
echo '
$this->content .= '
<table class="table" cellpadding="0" cellspacing="0">
<tr>';
foreach ($this->fieldsDisplay AS $field)
echo '<th'.(isset($field['width']) ? 'style="width: '.$field['width'].'"' : '').'>'.$field['title'].'</th>';
echo '
$this->content .= '<th'.(isset($field['width']) ? 'style="width: '.$field['width'].'"' : '').'>'.$field['title'].'</th>';
$this->content .= '
</tr>';
$attributes = array();
@@ -231,7 +226,7 @@ class AdminTracking extends AdminTab
$product = new Product((int)$prod['id_product'], false);
$tax_rate = $product->getTaxesRate();
echo '
$this->content .= '
<tr>
<td>'.$prod['id_product'].'</td>
<td align="center">'.($prod['manufacturer_name'] != NULL ? stripslashes($prod['manufacturer_name']) : '--').'</td>
@@ -250,7 +245,7 @@ class AdminTracking extends AdminTab
</td>
</tr>';
}
echo '</table><br /><br />';
$this->content .= '</table><br /><br />';
}
}
}