// Merge -> revision 8059

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8062 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-08-16 09:10:40 +00:00
parent bbb8acc0de
commit 21ca4d15d7
31 changed files with 188 additions and 84 deletions
+1
View File
@@ -84,6 +84,7 @@ echo '
<option value="0">'.translate('everywhere').'</option>
<option value="1" '.(Tools::getValue('bo_search_type') == 1 ? 'selected="selected"' : '').'>'.translate('catalog').'</option>
<option value="2" '.(Tools::getValue('bo_search_type') == 2 ? 'selected="selected"' : '').'>'.translate('customers').'</option>
<option value="6" '.(Tools::getValue('bo_search_type') == 6 ? 'selected="selected"' : '').'>'.translate('ip address').'</option>
<option value="3" '.(Tools::getValue('bo_search_type') == 3 ? 'selected="selected"' : '').'>'.translate('orders').'</option>
<option value="4" '.(Tools::getValue('bo_search_type') == 4 ? 'selected="selected"' : '').'>'.translate('invoices').'</option>
<option value="5" '.(Tools::getValue('bo_search_type') == 5 ? 'selected="selected"' : '').'>'.translate('carts').'</option>
+10 -7
View File
@@ -214,13 +214,16 @@ class AdminCategories extends AdminTab
<label class="t" for="active_off"><img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
</div>
<label>'.$this->l('Parent category:').' </label>
<div class="margin-form">
<select name="id_parent">';
$categories = Category::getCategories((int)$this->context->language->id, false);
Category::recurseCategory($categories, $categories[0][1], 1, ($obj->id ? $this->getFieldValue($obj, 'id_parent') : $id_category));
echo '
</select>
</div>
<div class="margin-form">';
// Translations are not automatic for the moment ;)
$trads = array(
'Home' => $this->l('Home'),
'selected' => $this->l('selected'),
'Collapse All' => $this->l('Collapse All'),
'Expand All' => $this->l('Expand All')
);
echo Helper::renderAdminCategorieTree($trads, array(isset($obj->id_parent) ? $obj->id_parent : 1), 'id_parent', true);
echo '</div>
<label>'.$this->l('Description:').' </label>
<div class="margin-form translatable">';
foreach ($this->_languages AS $language)
+2 -2
View File
@@ -2830,7 +2830,7 @@ class AdminProducts extends AdminTab
</td></tr>
<tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr>
<tr>
<td class="col-left">'.$this->l('Short description:').'<br /><br /><i>('.$this->l('appears in search results').')</i></td>
<td class="col-left">'.$this->l('Short description:').'<br /><br /><i>('.$this->l('appears in the product lists and on the top of the product page').')</i></td>
<td style="padding-bottom:5px;" class="translatable">';
foreach ($this->_languages as $language)
echo ' <div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').';float: left;">
@@ -2840,7 +2840,7 @@ class AdminProducts extends AdminTab
</td>
</tr>
<tr>
<td class="col-left">'.$this->l('Description:').'</td>
<td class="col-left">'.$this->l('Description:').'<br /><br /><i>('.$this->l('appears in the body of the product page').')</i></td>
<td style="padding-bottom:5px;" class="translatable">';
foreach ($this->_languages as $language)
echo ' <div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').';float: left;">
+23 -5
View File
@@ -28,6 +28,19 @@
class AdminSearch extends AdminTab
{
public function searchIP($query)
{
if (!ip2long(trim($query)))
return;
$this->_list['customers'] = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT DISTINCT c.*
FROM `'._DB_PREFIX_.'customer` c
LEFT JOIN `'._DB_PREFIX_.'guest` g ON g.id_customer = c.id_customer
LEFT JOIN `'._DB_PREFIX_.'connections` co ON g.id_guest = co.id_guest
WHERE co.`ip_address` = \''.ip2long(trim($query)).'\'');
}
/**
* Search a specific string in the products and categories
*
@@ -120,9 +133,7 @@ class AdminSearch extends AdminTab
'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'))
));
@@ -137,7 +148,7 @@ class AdminSearch extends AdminTab
}
/* Customer */
if (!$searchType OR $searchType == 2)
if (!$searchType OR $searchType == 2 OR $searchType == 6)
{
$this->fieldsDisplay['customers'] = (array(
'ID' => array('title' => $this->l('ID')),
@@ -151,6 +162,8 @@ class AdminSearch extends AdminTab
'actions' => array('title' => $this->l('Actions'))
));
if (!$searchType OR $searchType == 2)
{
/* Handle customer ID */
if ($searchType AND (int)$query AND Validate::isUnsignedInt((int)$query))
if ($customer = new Customer((int)$query) AND Validate::isLoadedObject($customer))
@@ -160,6 +173,10 @@ class AdminSearch extends AdminTab
$this->searchCustomer($query);
}
if ($searchType == 6)
$this->searchIP($query);
}
/* Order */
if ($searchType == 3)
{
@@ -183,6 +200,9 @@ class AdminSearch extends AdminTab
Tools::redirectAdmin('index.php?tab=AdminCarts&id_cart='.(int)($cart->id).'&viewcart'.'&token='.Tools::getAdminToken('AdminCarts'.(int)(Tab::getIdFromClassName('AdminCarts')).(int)$this->context->employee->id));
$this->_errors[] = Tools::displayError('No cart found with this ID:').' '.Tools::htmlentitiesUTF8($query);
}
/* IP */
// 6 - but it is included in the customer block
}
}
@@ -222,9 +242,7 @@ class AdminSearch extends AdminTab
<td>'.$product['reference'].'</td>
<td><a href="'.self::$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id).'">'.stripslashes($product['nameh']).'</a></td>
<td>'.Tools::displayPrice($product['price'], $this->context->currency).'</td>
<td>'.stripslashes($product['tax_name']).'</td>
<td align="center">'.$product['quantity'].'</td>
<td align="center">'.$product['weight'].' '.Configuration::get('PS_WEIGHT_UNIT').'</td>
<td align="center"><a href="'.self::$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&status&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id).'">
<img src="../img/admin/'.($product['active'] ? 'enabled.gif' : 'forbbiden.gif').'" alt="" /></a></td>
<td>
+2 -1
View File
@@ -50,7 +50,8 @@ class AdminTranslations extends AdminTab
{
parent::__construct();
self::$tpl_regexp = '/\{l s=\''._PS_TRANS_PATTERN_.'\'( mod=\'.+\')?( js=1)?\}/U';
self::$php_regexp = '/->l\(\''._PS_TRANS_PATTERN_.'\'(, \'(.+)\')?(, (.+))?\)/U';
// added ? after spaces because some peoples forget them. see PSCFI-2501
self::$php_regexp = '/->l\(\''._PS_TRANS_PATTERN_.'\'(, ?\'(.+)\')?(, ?(.+))?\)/U';
}
/**