[*] BO : search results improvements (no unaccessible tabs, better display, better information)
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -142,3 +142,4 @@ input[type="text"],input[type="search"],input[type="password"], textarea, select
|
|||||||
@import "admin-theme/admin-carrier-wizard"
|
@import "admin-theme/admin-carrier-wizard"
|
||||||
@import "admin-theme/admin-modules"
|
@import "admin-theme/admin-modules"
|
||||||
@import "admin-theme/admin-dashboard"
|
@import "admin-theme/admin-dashboard"
|
||||||
|
@import "admin-theme/admin-search"
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
.adminsearch
|
||||||
|
#content
|
||||||
|
.panel .panel
|
||||||
|
padding: 0
|
||||||
|
margin: 0
|
||||||
|
border: none
|
||||||
|
@include border-radius(0)
|
||||||
|
@include box-shadow(0)
|
||||||
@@ -29,19 +29,32 @@ $(function() {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{if isset($features)}
|
{if !$nb_results}
|
||||||
<div class="panel">
|
<h2>{l s='There are no results matching your query "%s".' sprintf=$query}</h2>
|
||||||
{if !$features}
|
{else}
|
||||||
<h3>{l s='No features matching your query'} : {$query}</h3>
|
<h2>
|
||||||
|
{if $nb_results == 1}
|
||||||
|
{l s='1 result matches your query "%s".' sprintf=$query}
|
||||||
{else}
|
{else}
|
||||||
<h3>{l s='Features matching your query'} : {$query}</h3>
|
{l s='%d results match your query "%s".' sprintf=[$nb_results|intval, $query]}
|
||||||
|
{/if}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
{if isset($features)}
|
||||||
|
<div class="panel">
|
||||||
|
<h3>
|
||||||
|
{if $features|@count == 1}
|
||||||
|
{l s='1 feature'}
|
||||||
|
{else}
|
||||||
|
{l s='%d features' sprintf=$features|@count}
|
||||||
|
{/if}
|
||||||
|
</h3>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach $features key=key item=feature}
|
{foreach $features key=key item=feature}
|
||||||
{foreach $feature key=k item=val name=feature_list}
|
{foreach $feature key=k item=val name=feature_list}
|
||||||
<tr>
|
<tr>
|
||||||
<td><strong>{if $smarty.foreach.feature_list.first}{$key}{/if}</strong></td>
|
<td><strong>{if $smarty.foreach.feature_list.first}{$key}{/if}</strong></td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<a href="{$val.link}">{$val.value}</a>
|
<a href="{$val.link}">{$val.value}</a>
|
||||||
</td>
|
</td>
|
||||||
@@ -50,16 +63,18 @@ $(function() {
|
|||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if isset($modules)}
|
{if isset($modules) && $modules}
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
{if !$modules}
|
<h3>
|
||||||
<h3>{l s='No modules matching your query'} : {$query}</h3>
|
{if $modules|@count == 1}
|
||||||
{else}
|
{l s='1 module'}
|
||||||
<h3>{l s='Modules matching your query'} : {$query}</h3>
|
{else}
|
||||||
|
{l s='%d modules' sprintf=$modules|@count}
|
||||||
|
{/if}
|
||||||
|
</h3>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach $modules key=key item=module}
|
{foreach $modules key=key item=module}
|
||||||
@@ -70,16 +85,18 @@ $(function() {
|
|||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if isset($categories)}
|
{if isset($categories) && $categories}
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
{if !$categories}
|
<h3>
|
||||||
<h3>{l s='No categories matching your query'} : {$query}</h3>
|
{if $categories|@count == 1}
|
||||||
{else}
|
{l s='1 category'}
|
||||||
<h3>{l s='Categories matching your query'} : {$query}</h3>
|
{else}
|
||||||
|
{l s='%d categories' sprintf=$categories|@count}
|
||||||
|
{/if}
|
||||||
|
</h3>
|
||||||
<table cellspacing="0" cellpadding="0" class="table">
|
<table cellspacing="0" cellpadding="0" class="table">
|
||||||
{foreach $categories key=key item=category}
|
{foreach $categories key=key item=category}
|
||||||
<tr class="alt_row">
|
<tr class="alt_row">
|
||||||
@@ -87,39 +104,45 @@ $(function() {
|
|||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</table>
|
</table>
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if isset($products)}
|
{if isset($products) && $products}
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
{if !$products}
|
<h3>
|
||||||
<h3>{l s='There are no products matching your query'} : {$query}</h3>
|
{if $products|@count == 1}
|
||||||
{else}
|
{l s='1 product'}
|
||||||
<h3>{l s='Products matching your query'} : {$query}</h3>
|
{else}
|
||||||
|
{l s='%d products' sprintf=$products|@count}
|
||||||
|
{/if}
|
||||||
|
</h3>
|
||||||
{$products}
|
{$products}
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if isset($customers)}
|
{if isset($customers) && $customers}
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
{if !$customers}
|
<h3>
|
||||||
<h3>{l s='There are no customers matching your query'} : {$query}</h3>
|
{if $customers|@count == 1}
|
||||||
{else}
|
{l s='1 customer'}
|
||||||
<h3>{l s='Customers matching your query'} : {$query}</h3>
|
{else}
|
||||||
|
{l s='%d customers' sprintf=$customers|@count}
|
||||||
|
{/if}
|
||||||
|
</h3>
|
||||||
{$customers}
|
{$customers}
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if isset($orders)}
|
{if isset($orders) && $orders}
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
{if !$orders}
|
<h3>
|
||||||
<h3>{l s='There are no orders matching your query'} : {$query}</h3>
|
{if $orders|@count == 1}
|
||||||
{else}
|
{l s='1 order'}
|
||||||
<h3>{l s='Orders matching your query'} : {$query}</h3>
|
{else}
|
||||||
|
{l s='%d orders' sprintf=$orders|@count}
|
||||||
|
{/if}
|
||||||
|
</h3>
|
||||||
{$orders}
|
{$orders}
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
{/if}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
{if $display_header}
|
{if $display_header}
|
||||||
<body class="{if $employee->bo_menu}page-sidebar {* page-sidebar-closed *}{else}page-topbar{/if}">
|
<body class="{if $employee->bo_menu}page-sidebar {* page-sidebar-closed *}{else}page-topbar{/if} {$smarty.get.controller|escape|strtolower}">
|
||||||
|
|
||||||
{* begin HEADER *}
|
{* begin HEADER *}
|
||||||
<header id="header">
|
<header id="header">
|
||||||
|
|||||||
@@ -217,8 +217,10 @@ class AdminSearchControllerCore extends AdminController
|
|||||||
$result = Db::getInstance()->executeS('
|
$result = Db::getInstance()->executeS('
|
||||||
SELECT class_name, name
|
SELECT class_name, name
|
||||||
FROM '._DB_PREFIX_.'tab t
|
FROM '._DB_PREFIX_.'tab t
|
||||||
INNER JOIN '._DB_PREFIX_.'tab_lang tl ON (t.id_tab = tl.id_tab AND tl.id_lang = '.(int)$this->context->language->id.')
|
INNER JOIN '._DB_PREFIX_.'tab_lang tl ON (t.id_tab = tl.id_tab AND tl.id_lang = '.(int)$this->context->employee->id_lang.')
|
||||||
WHERE active = 1');
|
LEFT JOIN '._DB_PREFIX_.'access a ON (a.id_tab = t.id_tab AND a.id_profile = '.(int)$this->context->employee->id_profile.')
|
||||||
|
WHERE active = 1
|
||||||
|
'.($this->context->employee->id_profile != 1 ? 'AND view = 1' : ''));
|
||||||
foreach ($result as $row)
|
foreach ($result as $row)
|
||||||
{
|
{
|
||||||
$tabs[strtolower($row['class_name'])] = $row['name'];
|
$tabs[strtolower($row['class_name'])] = $row['name'];
|
||||||
@@ -227,6 +229,8 @@ class AdminSearchControllerCore extends AdminController
|
|||||||
foreach (AdminTab::$tabParenting as $key => $value)
|
foreach (AdminTab::$tabParenting as $key => $value)
|
||||||
{
|
{
|
||||||
$value = stripslashes($value);
|
$value = stripslashes($value);
|
||||||
|
if (!isset($tabs[strtolower($key)]) || !isset($tabs[strtolower($value)]))
|
||||||
|
continue;
|
||||||
$tabs[strtolower($key)] = $tabs[strtolower($value)];
|
$tabs[strtolower($key)] = $tabs[strtolower($value)];
|
||||||
$key_match[strtolower($key)] = $key;
|
$key_match[strtolower($key)] = $key;
|
||||||
}
|
}
|
||||||
@@ -324,16 +328,22 @@ class AdminSearchControllerCore extends AdminController
|
|||||||
return parent::renderView();
|
return parent::renderView();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (isset($this->_list['features']))
|
$nb_results = 0;
|
||||||
|
foreach ($this->_list as $list)
|
||||||
|
if ($list != false)
|
||||||
|
$nb_results += count($list);
|
||||||
|
$this->tpl_view_vars['nb_results'] = $nb_results;
|
||||||
|
|
||||||
|
if (isset($this->_list['features']) && count($this->_list['features']))
|
||||||
$this->tpl_view_vars['features'] = $this->_list['features'];
|
$this->tpl_view_vars['features'] = $this->_list['features'];
|
||||||
if (isset($this->_list['categories']))
|
if (isset($this->_list['categories']) && count($this->_list['categories']))
|
||||||
{
|
{
|
||||||
$categories = array();
|
$categories = array();
|
||||||
foreach ($this->_list['categories'] as $category)
|
foreach ($this->_list['categories'] as $category)
|
||||||
$categories[] = getPath($this->context->link->getAdminLink('AdminCategories', false), $category['id_category']);
|
$categories[] = getPath($this->context->link->getAdminLink('AdminCategories', false), $category['id_category']);
|
||||||
$this->tpl_view_vars['categories'] = $categories;
|
$this->tpl_view_vars['categories'] = $categories;
|
||||||
}
|
}
|
||||||
if (isset($this->_list['products']))
|
if (isset($this->_list['products']) && count($this->_list['products']))
|
||||||
{
|
{
|
||||||
$view = '';
|
$view = '';
|
||||||
$this->initProductList();
|
$this->initProductList();
|
||||||
@@ -353,7 +363,7 @@ class AdminSearchControllerCore extends AdminController
|
|||||||
|
|
||||||
$this->tpl_view_vars['products'] = $view;
|
$this->tpl_view_vars['products'] = $view;
|
||||||
}
|
}
|
||||||
if (isset($this->_list['customers']))
|
if (isset($this->_list['customers']) && count($this->_list['customers']))
|
||||||
{
|
{
|
||||||
$view = '';
|
$view = '';
|
||||||
$this->initCustomerList();
|
$this->initCustomerList();
|
||||||
@@ -376,7 +386,7 @@ class AdminSearchControllerCore extends AdminController
|
|||||||
}
|
}
|
||||||
$this->tpl_view_vars['customers'] = $view;
|
$this->tpl_view_vars['customers'] = $view;
|
||||||
}
|
}
|
||||||
if (isset($this->_list['orders']))
|
if (isset($this->_list['orders']) && count($this->_list['orders']))
|
||||||
{
|
{
|
||||||
$view = '';
|
$view = '';
|
||||||
$this->initOrderList();
|
$this->initOrderList();
|
||||||
@@ -396,7 +406,7 @@ class AdminSearchControllerCore extends AdminController
|
|||||||
$this->tpl_view_vars['orders'] = $view;
|
$this->tpl_view_vars['orders'] = $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->_list['modules']))
|
if (isset($this->_list['modules']) && count($this->_list['modules']))
|
||||||
$this->tpl_view_vars['modules'] = $this->_list['modules'];
|
$this->tpl_view_vars['modules'] = $this->_list['modules'];
|
||||||
|
|
||||||
return parent::renderView();
|
return parent::renderView();
|
||||||
|
|||||||
Reference in New Issue
Block a user