[*] 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-modules"
|
||||
@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>
|
||||
|
||||
{if isset($features)}
|
||||
<div class="panel">
|
||||
{if !$features}
|
||||
<h3>{l s='No features matching your query'} : {$query}</h3>
|
||||
{if !$nb_results}
|
||||
<h2>{l s='There are no results matching your query "%s".' sprintf=$query}</h2>
|
||||
{else}
|
||||
<h2>
|
||||
{if $nb_results == 1}
|
||||
{l s='1 result matches your query "%s".' sprintf=$query}
|
||||
{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">
|
||||
<tbody>
|
||||
{foreach $features key=key item=feature}
|
||||
{foreach $feature key=k item=val name=feature_list}
|
||||
<tr>
|
||||
<td><strong>{if $smarty.foreach.feature_list.first}{$key}{/if}</strong></td>
|
||||
|
||||
<td>
|
||||
<a href="{$val.link}">{$val.value}</a>
|
||||
</td>
|
||||
@@ -50,16 +63,18 @@ $(function() {
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if isset($modules)}
|
||||
{if isset($modules) && $modules}
|
||||
<div class="panel">
|
||||
{if !$modules}
|
||||
<h3>{l s='No modules matching your query'} : {$query}</h3>
|
||||
{else}
|
||||
<h3>{l s='Modules matching your query'} : {$query}</h3>
|
||||
<h3>
|
||||
{if $modules|@count == 1}
|
||||
{l s='1 module'}
|
||||
{else}
|
||||
{l s='%d modules' sprintf=$modules|@count}
|
||||
{/if}
|
||||
</h3>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
{foreach $modules key=key item=module}
|
||||
@@ -70,16 +85,18 @@ $(function() {
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if isset($categories)}
|
||||
{if isset($categories) && $categories}
|
||||
<div class="panel">
|
||||
{if !$categories}
|
||||
<h3>{l s='No categories matching your query'} : {$query}</h3>
|
||||
{else}
|
||||
<h3>{l s='Categories matching your query'} : {$query}</h3>
|
||||
<h3>
|
||||
{if $categories|@count == 1}
|
||||
{l s='1 category'}
|
||||
{else}
|
||||
{l s='%d categories' sprintf=$categories|@count}
|
||||
{/if}
|
||||
</h3>
|
||||
<table cellspacing="0" cellpadding="0" class="table">
|
||||
{foreach $categories key=key item=category}
|
||||
<tr class="alt_row">
|
||||
@@ -87,39 +104,45 @@ $(function() {
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if isset($products)}
|
||||
{if isset($products) && $products}
|
||||
<div class="panel">
|
||||
{if !$products}
|
||||
<h3>{l s='There are no products matching your query'} : {$query}</h3>
|
||||
{else}
|
||||
<h3>{l s='Products matching your query'} : {$query}</h3>
|
||||
<h3>
|
||||
{if $products|@count == 1}
|
||||
{l s='1 product'}
|
||||
{else}
|
||||
{l s='%d products' sprintf=$products|@count}
|
||||
{/if}
|
||||
</h3>
|
||||
{$products}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if isset($customers)}
|
||||
{if isset($customers) && $customers}
|
||||
<div class="panel">
|
||||
{if !$customers}
|
||||
<h3>{l s='There are no customers matching your query'} : {$query}</h3>
|
||||
{else}
|
||||
<h3>{l s='Customers matching your query'} : {$query}</h3>
|
||||
<h3>
|
||||
{if $customers|@count == 1}
|
||||
{l s='1 customer'}
|
||||
{else}
|
||||
{l s='%d customers' sprintf=$customers|@count}
|
||||
{/if}
|
||||
</h3>
|
||||
{$customers}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if isset($orders)}
|
||||
{if isset($orders) && $orders}
|
||||
<div class="panel">
|
||||
{if !$orders}
|
||||
<h3>{l s='There are no orders matching your query'} : {$query}</h3>
|
||||
{else}
|
||||
<h3>{l s='Orders matching your query'} : {$query}</h3>
|
||||
<h3>
|
||||
{if $orders|@count == 1}
|
||||
{l s='1 order'}
|
||||
{else}
|
||||
{l s='%d orders' sprintf=$orders|@count}
|
||||
{/if}
|
||||
</h3>
|
||||
{$orders}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
</head>
|
||||
|
||||
{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 *}
|
||||
<header id="header">
|
||||
|
||||
@@ -217,8 +217,10 @@ class AdminSearchControllerCore extends AdminController
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT class_name, name
|
||||
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.')
|
||||
WHERE active = 1');
|
||||
INNER JOIN '._DB_PREFIX_.'tab_lang tl ON (t.id_tab = tl.id_tab AND tl.id_lang = '.(int)$this->context->employee->id_lang.')
|
||||
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)
|
||||
{
|
||||
$tabs[strtolower($row['class_name'])] = $row['name'];
|
||||
@@ -227,6 +229,8 @@ class AdminSearchControllerCore extends AdminController
|
||||
foreach (AdminTab::$tabParenting as $key => $value)
|
||||
{
|
||||
$value = stripslashes($value);
|
||||
if (!isset($tabs[strtolower($key)]) || !isset($tabs[strtolower($value)]))
|
||||
continue;
|
||||
$tabs[strtolower($key)] = $tabs[strtolower($value)];
|
||||
$key_match[strtolower($key)] = $key;
|
||||
}
|
||||
@@ -324,16 +328,22 @@ class AdminSearchControllerCore extends AdminController
|
||||
return parent::renderView();
|
||||
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'];
|
||||
if (isset($this->_list['categories']))
|
||||
if (isset($this->_list['categories']) && count($this->_list['categories']))
|
||||
{
|
||||
$categories = array();
|
||||
foreach ($this->_list['categories'] as $category)
|
||||
$categories[] = getPath($this->context->link->getAdminLink('AdminCategories', false), $category['id_category']);
|
||||
$this->tpl_view_vars['categories'] = $categories;
|
||||
}
|
||||
if (isset($this->_list['products']))
|
||||
if (isset($this->_list['products']) && count($this->_list['products']))
|
||||
{
|
||||
$view = '';
|
||||
$this->initProductList();
|
||||
@@ -353,7 +363,7 @@ class AdminSearchControllerCore extends AdminController
|
||||
|
||||
$this->tpl_view_vars['products'] = $view;
|
||||
}
|
||||
if (isset($this->_list['customers']))
|
||||
if (isset($this->_list['customers']) && count($this->_list['customers']))
|
||||
{
|
||||
$view = '';
|
||||
$this->initCustomerList();
|
||||
@@ -376,7 +386,7 @@ class AdminSearchControllerCore extends AdminController
|
||||
}
|
||||
$this->tpl_view_vars['customers'] = $view;
|
||||
}
|
||||
if (isset($this->_list['orders']))
|
||||
if (isset($this->_list['orders']) && count($this->_list['orders']))
|
||||
{
|
||||
$view = '';
|
||||
$this->initOrderList();
|
||||
@@ -396,7 +406,7 @@ class AdminSearchControllerCore extends AdminController
|
||||
$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'];
|
||||
|
||||
return parent::renderView();
|
||||
|
||||
Reference in New Issue
Block a user