Skip to content

Commit c621546

Browse files
author
Tobias Merkl
committed
fix mysql result if string is too long, set orders always active
1 parent 74e4631 commit c621546

4 files changed

Lines changed: 17 additions & 18 deletions

File tree

Controller/Admin/NavigationController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public function getOxcomAdminSearchResults()
5555
if ($this->getOxcomAdminSearchConfigParam("blOxComAdminSearchShowCmsPages")) {
5656
$aData["cmspages"] = $this->_getOxcomAdminSearchCmsPages();
5757
}
58-
if ($this->getOxcomAdminSearchConfigParam("blOxComAdminSearchShowOrders")) {
59-
$aData["orders"] = $this->_getOxcomAdminSearchOrders();
60-
}
58+
//if ($this->getOxcomAdminSearchConfigParam("blOxComAdminSearchShowOrders")) {
59+
$aData["orders"] = $this->_getOxcomAdminSearchOrders();
60+
//}
6161
if ($this->getOxcomAdminSearchConfigParam("blOxComAdminSearchShowUsers")) {
6262
$aData["users"] = $this->_getOxcomAdminSearchUsers();
6363
}
@@ -98,7 +98,7 @@ public function getOxcomAdminSearchConfigParam($sParam = '')
9898
protected function _getOxcomAdminSearchArticles()
9999
{
100100
$sViewName = $this->_sViewNameGenerator->getViewName("oxarticles");
101-
$sSql = "SELECT oxid, CONCAT(oxartnum, ' / ', oxtitle, '', oxvarselect) FROM $sViewName WHERE CONCAT(oxartnum, oxtitle, oxvarselect) LIKE " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote('%' . $this->_sQueryName . '%');
101+
$sSql = "SELECT oxid, CONCAT_WS(' / ', oxartnum, oxtitle, '', oxvarselect) FROM $sViewName WHERE CONCAT_WS(' / ', oxartnum, oxtitle, oxvarselect) LIKE " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote('%' . $this->_sQueryName . '%');
102102

103103
return $this->_getOxcomAdminSearchData($sSql, 'article');
104104
}
@@ -137,7 +137,7 @@ protected function _getOxcomAdminSearchCmsPages()
137137
protected function _getOxcomAdminSearchOrders()
138138
{
139139
$sViewName = $this->_sViewNameGenerator->getViewName("oxorder");
140-
$sSql = "SELECT oxid, CONCAT(oxordernr, ' / ', oxbillfname, ' ', oxbilllname, ' / ', oxbillemail, ' / ', oxtrackcode, ' / ', oxremark) AS search FROM $sViewName WHERE CONCAT(oxordernr, oxbillfname, oxbilllname, oxbillemail, oxtrackcode, oxremark) LIKE " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote('%' . $this->_sQueryName . '%');
140+
$sSql = "SELECT oxid, CONCAT_WS(' / ', oxordernr, oxbillfname, oxbilllname, oxbillemail, oxtrackcode, oxremark) AS search FROM $sViewName WHERE CONCAT_WS(' / ', oxordernr, oxbillfname, oxbilllname, oxbillemail, oxtrackcode, oxremark) LIKE " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote('%' . $this->_sQueryName . '%');
141141

142142
return $this->_getOxcomAdminSearchData($sSql, 'admin_order');
143143
}
@@ -150,7 +150,7 @@ protected function _getOxcomAdminSearchOrders()
150150
protected function _getOxcomAdminSearchUsers()
151151
{
152152
$sViewName = $this->_sViewNameGenerator->getViewName("oxuser");
153-
$sSql = "SELECT oxid, CONCAT(oxcustnr, ' / ', oxfname, ' ', oxlname, ' / ', oxusername, ' / ', oxzip) FROM $sViewName WHERE CONCAT(oxcustnr, oxlname, oxfname, oxusername, oxzip) LIKE " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote('%' . $this->_sQueryName . '%');
153+
$sSql = "SELECT oxid, CONCAT_WS(' / ', oxcustnr, oxfname, oxlname, oxusername, oxzip) FROM $sViewName WHERE CONCAT_WS(' / ', oxcustnr, oxlname, oxfname, oxusername, oxzip) LIKE " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote('%' . $this->_sQueryName . '%');
154154

155155
return $this->_getOxcomAdminSearchData($sSql, 'admin_user');
156156
}

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Module version for OXID eShop 6. See here for [V4](https://github.com/OXIDprojec
55
# Features
66

77
Global admin search for
8-
- articles
8+
- articles
99
- categories
1010
- cms pages
1111
- users
12-
- orders
12+
- orders (always active)
1313
- vendors
1414
- manufacturers
1515
- modules
@@ -27,7 +27,8 @@ composer require oxid-community/adminsearch
2727

2828
# Changelog
2929

30-
2020-02-21 1.2.0 add oxremark to ordersearch
30+
2022-02-11 1.2.1 fix mysql result if string is too long, set orders always active
31+
2020-02-21 1.2.0 add oxremark to ordersearch
3132
2020-08-25 1.1.1 improve searches, fix ordersearch
3233
2020-08-24 1.1.0 improve ordersearch (add oxtrackcode)
3334
2018-03-23 1.0.4 search companies

metadata.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'de' => 'Globale Suche im Shop-Admin',
2323
'en' => 'Global search shop admin'
2424
],
25-
'version' => '1.2.0',
25+
'version' => '1.2.1',
2626
'author' => 'OXID Community',
2727
'url' => 'https://github.com/OXIDprojects/adminsearch',
2828
'extend' => [
@@ -37,7 +37,7 @@
3737
['group' => 'oxcom_adminsearch_main', 'name' => 'blOxComAdminSearchShowArticles', 'type' => 'bool', 'value' => true],
3838
['group' => 'oxcom_adminsearch_main', 'name' => 'blOxComAdminSearchShowCategories', 'type' => 'bool', 'value' => true],
3939
['group' => 'oxcom_adminsearch_main', 'name' => 'blOxComAdminSearchShowCmsPages', 'type' => 'bool', 'value' => true],
40-
['group' => 'oxcom_adminsearch_main', 'name' => 'blOxComAdminSearchShowOrders', 'type' => 'bool', 'value' => true],
40+
//['group' => 'oxcom_adminsearch_main', 'name' => 'blOxComAdminSearchShowOrders', 'type' => 'bool', 'value' => true],
4141
['group' => 'oxcom_adminsearch_main', 'name' => 'blOxComAdminSearchShowUsers', 'type' => 'bool', 'value' => true],
4242
['group' => 'oxcom_adminsearch_main', 'name' => 'blOxComAdminSearchShowCompanies', 'type' => 'bool', 'value' => true],
4343
['group' => 'oxcom_adminsearch_main', 'name' => 'blOxComAdminSearchShowVendors', 'type' => 'bool', 'value' => true],

views/blocks/admin_navigation_menustructure.tpl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@
3939
}
4040
},
4141
categories: [
42+
{
43+
listLocation: "orders",
44+
header: "[{ oxmultilang ident="OXCOM_ADMINSEARCH_ORDERS" }]"
45+
}
4246
[{ if $oView->getOxcomAdminSearchConfigParam("blOxComAdminSearchShowArticles") }]
43-
{
47+
,{
4448
listLocation: "articles",
4549
header: "[{ oxmultilang ident="OXCOM_ADMINSEARCH_ARTICLES" }]"
4650
}
@@ -57,12 +61,6 @@
5761
header: "[{ oxmultilang ident="OXCOM_ADMINSEARCH_CMSPAGES" }]"
5862
}
5963
[{ /if }]
60-
[{ if $oView->getOxcomAdminSearchConfigParam("blOxComAdminSearchShowOrders") }]
61-
,{
62-
listLocation: "orders",
63-
header: "[{ oxmultilang ident="OXCOM_ADMINSEARCH_ORDERS" }]"
64-
}
65-
[{ /if }]
6664
[{ if $oView->getOxcomAdminSearchConfigParam("blOxComAdminSearchShowUsers") }]
6765
,{
6866
listLocation: "users",

0 commit comments

Comments
 (0)