// fixes to orders->view product, adminsearch->toolbar, admintaxrules hint

This commit is contained in:
tDidierjean
2011-11-23 13:14:07 +00:00
parent 01b1f1ebcc
commit 52840edca2
5 changed files with 45 additions and 22 deletions
@@ -28,7 +28,7 @@
<tr> <tr>
<td align="center">{if ($product.image->id)}{$product.image_tag}{else}'--'{/if}</td> <td align="center">{if ($product.image->id)}{$product.image_tag}{else}'--'{/if}</td>
<td> <td>
<a href="index.php?tab=AdminCatalog&id_product={$product['product_id']}&updateproduct&token={getAdminToken tab='AdminCatalog'}"> <a href="index.php?controller=adminproducts&id_product={$product['product_id']}&updateproduct&token={getAdminToken tab='AdminProducts'}">
<span class="productName">{$product['product_name']} - {l s='customized'}</span><br /> <span class="productName">{$product['product_name']} - {l s='customized'}</span><br />
{if ($product['product_reference'])}{l s='Ref:'} {$product['product_reference']}<br />{/if} {if ($product['product_reference'])}{l s='Ref:'} {$product['product_reference']}<br />{/if}
{if ($product['product_supplier_reference'])}{l s='Ref Supplier:'} {$product['product_supplier_reference']}{/if} {if ($product['product_supplier_reference'])}{l s='Ref Supplier:'} {$product['product_supplier_reference']}{/if}
@@ -34,7 +34,7 @@
{if ($product['product_quantity'] > $product['customizationQuantityTotal'])} {if ($product['product_quantity'] > $product['customizationQuantityTotal'])}
<tr{if isset($product.image) && $product.image->id && isset($product.image_size)} height="{$product['image_size'][1] + 7}"{/if}> <tr{if isset($product.image) && $product.image->id && isset($product.image_size)} height="{$product['image_size'][1] + 7}"{/if}>
<td align="center">{if isset($product.image) && $product.image->id}{$product.image_tag}{/if}</td> <td align="center">{if isset($product.image) && $product.image->id}{$product.image_tag}{/if}</td>
<td><a href="index.php?tab=AdminCatalog&id_product={$product['product_id']}&updateproduct&token={getAdminToken tab='AdminCatalog'}"> <td><a href="index.php?controller=adminproducts&id_product={$product['product_id']}&updateproduct&token={getAdminToken tab='AdminProducts'}">
<span class="productName">{$product['product_name']}</span><br /> <span class="productName">{$product['product_name']}</span><br />
{if $product.product_reference}{l s='Ref:'} {$product.product_reference}<br />{/if} {if $product.product_reference}{l s='Ref:'} {$product.product_reference}<br />{/if}
{if $product.product_supplier_reference}{l s='Ref Supplier:'} {$product.product_supplier_reference}{/if} {if $product.product_supplier_reference}{l s='Ref Supplier:'} {$product.product_supplier_reference}{/if}
+14 -2
View File
@@ -30,9 +30,21 @@ $(function() {
}); });
</script> </script>
{if isset($features) || isset($categories) || isset($products) || isset($customers)} {if $show_toolbar}
<h2>{l s='Search results'} :</h2> <div class="toolbar-placeholder">
<div class="toolbarBox {if $toolbar_fix}toolbarHead{/if}">
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
<div class="pageTitle">
<h3>
{block name=pageTitle}
<span id="current_obj" style="font-weight: normal;">{$title|default:'&nbsp;'}</span>
{/block}
</h3>
</div>
</div>
</div>
{/if} {/if}
{if isset($features)} {if isset($features)}
{if !$features} {if !$features}
<h3>{l s='No features matching your query'} : {$query}</h3> <h3>{l s='No features matching your query'} : {$query}</h3>
+24 -13
View File
@@ -42,7 +42,7 @@ class AdminSearchControllerCore extends AdminController
{ {
if (!$searchType and strlen($this->query) > 1) if (!$searchType and strlen($this->query) > 1)
$this->searchFeatures(); $this->searchFeatures();
/* Product research */ /* Product research */
if (!$searchType OR $searchType == 1) if (!$searchType OR $searchType == 1)
{ {
@@ -64,7 +64,7 @@ class AdminSearchControllerCore extends AdminController
if ($searchType AND (int)$this->query AND Validate::isUnsignedInt((int)$this->query)) if ($searchType AND (int)$this->query AND Validate::isUnsignedInt((int)$this->query))
if ($customer = new Customer((int)$this->query) AND Validate::isLoadedObject($customer)) if ($customer = new Customer((int)$this->query) AND Validate::isLoadedObject($customer))
Tools::redirectAdmin('index.php?tab=AdminCustomers&id_customer='.(int)($customer->id).'&viewcustomer'.'&token='.Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)$this->context->employee->id)); Tools::redirectAdmin('index.php?tab=AdminCustomers&id_customer='.(int)($customer->id).'&viewcustomer'.'&token='.Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)$this->context->employee->id));
/* Normal customer search */ /* Normal customer search */
$this->searchCustomer(); $this->searchCustomer();
} }
@@ -100,9 +100,9 @@ class AdminSearchControllerCore extends AdminController
// 6 - but it is included in the customer block // 6 - but it is included in the customer block
} }
$this->display = 'view'; $this->display = 'view';
} }
public function searchIP() public function searchIP()
{ {
if (!ip2long(trim($this->query))) if (!ip2long(trim($this->query)))
@@ -131,10 +131,10 @@ class AdminSearchControllerCore extends AdminController
* @params string $query String to find in the catalog * @params string $query String to find in the catalog
*/ */
public function searchCustomer() public function searchCustomer()
{ {
$this->_list['customers'] = Customer::searchByName($this->query); $this->_list['customers'] = Customer::searchByName($this->query);
} }
/** /**
* Search a feature in all store * Search a feature in all store
* *
@@ -166,13 +166,13 @@ class AdminSearchControllerCore extends AdminController
$this->_list['features'][$tabs[$key]][] = array('link' => '?tab='.Tools::safeOutput($key).'&token='.Tools::getAdminTokenLite($key) , 'value' => Tools::safeOutput($value)); $this->_list['features'][$tabs[$key]][] = array('link' => '?tab='.Tools::safeOutput($key).'&token='.Tools::getAdminTokenLite($key) , 'value' => Tools::safeOutput($value));
} }
} }
if (!count($this->_list['features'])) if (!count($this->_list['features']))
$this->_list['features'] = false; $this->_list['features'] = false;
else else
$this->_list['features']; $this->_list['features'];
} }
protected function initCustomerList() protected function initCustomerList()
{ {
$genders_icon = array('default' => 'unknown.gif'); $genders_icon = array('default' => 'unknown.gif');
@@ -194,7 +194,7 @@ class AdminSearchControllerCore extends AdminController
'active' => array('title' => $this->l('Enabled'),'align' => 'center','active' => 'status','type' => 'bool'), 'active' => array('title' => $this->l('Enabled'),'align' => 'center','active' => 'status','type' => 'bool'),
)); ));
} }
protected function initProductList() protected function initProductList()
{ {
$this->show_toolbar = false; $this->show_toolbar = false;
@@ -207,16 +207,27 @@ class AdminSearchControllerCore extends AdminController
'status' => array('title' => $this->l('Status'), 'align' => 'center'), 'status' => array('title' => $this->l('Status'), 'align' => 'center'),
)); ));
} }
public function setMedia() public function setMedia()
{ {
parent::setMedia(); parent::setMedia();
$this->addJqueryPlugin('highlight'); $this->addJqueryPlugin('highlight');
} }
// Override because we don't want any buttons
public function initToolbar()
{
}
public function initToolbarTitle()
{
$this->toolbar_title = $this->l('Search results');
}
public function initView() public function initView()
{ {
$this->tpl_view_vars['query'] = $this->query; $this->tpl_view_vars['query'] = $this->query;
$this->tpl_view_vars['show_toolbar'] = true;
if (sizeof($this->_errors)) if (sizeof($this->_errors))
return parent::initView(); return parent::initView();
@@ -259,10 +270,10 @@ class AdminSearchControllerCore extends AdminController
foreach($this->_list['customers'] as $key => $val) foreach($this->_list['customers'] as $key => $val)
$this->_list['customers'][$key]['orders'] = Order::getCustomerNbOrders((int)$val['id_customer']); $this->_list['customers'][$key]['orders'] = Order::getCustomerNbOrders((int)$val['id_customer']);
$view = $helper->generateList($this->_list['customers'], $this->fieldsDisplay['customers']); $view = $helper->generateList($this->_list['customers'], $this->fieldsDisplay['customers']);
} }
$this->tpl_view_vars['customers'] = $view; $this->tpl_view_vars['customers'] = $view;
} }
return parent::initView(); return parent::initView();
} }
} }
} }
@@ -286,11 +286,11 @@ class AdminTaxRulesGroupControllerCore extends AdminController
'id' => 'id', 'id' => 'id',
'name' => 'name' 'name' => 'name'
), ),
'hint' => array( 'hint' =>
$this->l('Define the behavior if an address matches multiple rules:'), $this->l('Define the behavior if an address matches multiple rules:').'<br />
'<b>'.$this->l('This Tax Only:').'</b> '.$this->l('Will apply only this tax'), <b>'.$this->l('This Tax Only:').'</b> '.$this->l('Will apply only this tax').'<br />
'<b>'.$this->l('Combine:').'</b> '.$this->l('Combine taxes (eg: 10% + 5% => 15%)'), <b>'.$this->l('Combine:').'</b> '.$this->l('Combine taxes (eg: 10% + 5% => 15%)').'<br />
'<b>'.$this->l('One After Another:').'</b> '.$this->l('Apply taxes one after another (eg: 100€ + 10% => 110€ + 5% => 115.5€)') <b>'.$this->l('One After Another:').'</b> '.$this->l('Apply taxes one after another (eg: 100€ + 10% => 110€ + 5% => 115.5€)'
) )
), ),
array( array(